Media Foundation - Custom Media Source & Sensor Profile

438 views Asked by At

I am writing an application for previewing, capturing and snapshotting camera input. To this end I am using Media Foundation for the input. One of the requirements is that this works with a Black Magic Intensive Pro 4K capture card, which behaves similar to a normal camera.

Media Foundation is unfortunately unable to create an IMFMediaSource object from this device. Some research lead me to believe that I could implement my own MediaSource.

Then I started looking at samples, and tried to unravel the documentation. At that point I encountered some questions:

  1. Does anyone know if what I am trying to do is possible?
  2. A Windows example shows a basic implementation of a source, but uses IMFSensorProfile. What is a Sensor Profile, and what should I use it for? There is almost no documentation about this.
  3. Can somebody explain how implementing a custom media source works in terms of: what actually happens on the inside? Am I simply creating my own format, or does it allow me to pull my own frames from the camera and process them myself? I tried following the msdn guide, but no luck so far.

Specifics:

  • Using WPF with C# but I can write C++ and use it in C#.
  • Rendering to screen uses Direct3D9.
  • The capture card specs can be found on their site (BlackMagic Intensity Pro 4K).
  • The specific problem that occurs is that I can acquire the IMFActivator for the device, but I am not able to activate it. On activation, an MF_E_INVALIDMEDIATYPE error occurs.
  • The IMFActivator can tell me that the device should output a UYVY format.
  • My last resort is using the DeckLinkAPI, but since I am working with several different types of cameras, I do not want to be stuck with another dependency.

Any pointers or help would be appreciated. Let me know if anything is unclear or needs more detail.

0

There are 0 answers