locked
Add public constructor to Media Extension runtime component

    Question

  • I am working on a ByteStreamHandler media extension, my code is based on the Media extensions sample MPEG1Decoder. I want to be able to create an instance of the extension from C#, but I do not know how to add a constructor to it which is publicly visible. I already tried to add the "activatable" attribute in the .def file and move the ActivatableClass macro from dllmain to below the class definition as it is seen here: http://msdn.microsoft.com/en-us/library/hh973463.aspx. Still no luck.

    Can someone show me what needs to be added/changed to the MPEG1Decoder sample, so I can see and use its constructor in C#? In the C#,C++ Sample, just open one of the .cs files and add the line: "var d = new MPEG1Decoder.MPEG1Decoder()" and it will tell you that MPEG1Decoder does not have constructors defined.

    Background is that I also want to use my ByteStreamHandler also with MFMediaEngine. For that scenario I have to create it myself and pass the instance to the media engine class factory.


    • Edited by lukas.f Saturday, December 1, 2012 6:59 PM
    Saturday, December 1, 2012 6:22 PM

All replies

  • I still have not succeeded. It would be great if someone from Microsoft can check on this.

    To my understanding, the WRL is the base of the new windows runtime classes. Everything that is possible by using the "ref class" language projections should as well be possible by using WRL templates. Adding a constructor to an already existing WRL class cannot be that hard, can it?

    Any help would be greatly appreciated.

    Tuesday, December 11, 2012 9:20 AM