Skip to content

Instantly share code, notes, and snippets.

@marek-stoj
Created September 5, 2012 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marek-stoj/3637293 to your computer and use it in GitHub Desktop.
Save marek-stoj/3637293 to your computer and use it in GitHub Desktop.
SharpDX MediaEngine on Win8 Metro
// This code (the line with new MediaEngine(...) specifically) throws:
// HRESULT: [0xC00D36BD], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown
// Startup MediaManager
MediaManager.Startup();
// Create a DXGI Device Manager
dxgiDeviceManager = new DXGIDeviceManager();
dxgiDeviceManager.ResetDevice(devices.DeviceDirect3D);
// Setup Media Engine attributes
var attributes = new MediaEngineAttributes
{
DxgiManager = dxgiDeviceManager,
VideoOutputFormat = (int) SharpDX.DXGI.Format.B8G8R8A8_UNorm,
};
using (var factory = new MediaEngineClassFactory())
using (var mediaEngine = new MediaEngine(factory, attributes, MediaEngineCreateflags.Audioonly))
mediaEngineEx = mediaEngine.QueryInterface<MediaEngineEx>();
@thereverand
Copy link

Possibly a silly question: But why are you disposing of the MediaEngine instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment