locked
Is it possible to send the MediaElement's video content to Directx pipeline?

    Question

  • Hi,

    Is it possible to send the MediaElement's video content to Directx pipeline then render that video content into Directx back Buffer?

    I don't want to use MediaEngine or Windows media foundation because there's more work for me to do by using MediaEngine.

    I would like to use C#, XAML, Directx and MediaElement.

    Regards,

    Weera


    Wednesday, April 01, 2015 5:50 PM

Answers

  • Hello,

    The VideoBrush is only supported in Silverlight apps. It is not supported for Runtime apps.

    AFAIK it is not possible to pass the MediaElement to the SurfaceImageSource (although we made changes to the underlying architecture so both the ME and XAML are using DirectComposite to render the UI elements, so this may be theoretically possible but is not exposed or documented to my knowledge).

    Again the Media Engine is the recommended technology for direct interop with video and D3D. Please take a look a this sample for more information on using the Media Engine with D3D: Media engine native C++ video playback sample

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, April 02, 2015 6:09 PM
    Moderator

All replies

  • Hello,

    Calling DirectX methods from C# is not supported. The only supported way to render video to a D3D surface or quad is to use the Media Engine and C++. While it may be possible to make something work from managed code using 3rd party tools such as SharpDX this is not something that it going to be supported and the performance, particularly on the Phone platform, will likely be very poor.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, April 01, 2015 8:10 PM
    Moderator
  • Hi James.

    Thanks James. I am looking for following function:

    https://msdn.microsoft.com/en-us/library/aa969770(v=vs.110).aspx

    Is it possible to passing MediaElement to the "SurfaceImageSource"? C++/CX

    https://code.msdn.microsoft.com/windowsapps/XAML-SurfaceImageSource-58f7e4d5

    I don't have any problem to use Windows Media Foundation or MediaEngine but there's a lot of work for me to do.

    Regards,

    Weera


    Wednesday, April 01, 2015 8:40 PM
  • Hello,

    The VideoBrush is only supported in Silverlight apps. It is not supported for Runtime apps.

    AFAIK it is not possible to pass the MediaElement to the SurfaceImageSource (although we made changes to the underlying architecture so both the ME and XAML are using DirectComposite to render the UI elements, so this may be theoretically possible but is not exposed or documented to my knowledge).

    Again the Media Engine is the recommended technology for direct interop with video and D3D. Please take a look a this sample for more information on using the Media Engine with D3D: Media engine native C++ video playback sample

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Thursday, April 02, 2015 6:09 PM
    Moderator
  • Hi James,

    Thanks for confirmation.

    Have a nice day,

    Weera

    Friday, April 03, 2015 4:55 PM