locked
Sample code for SinkWriter

    Question

  • In the thread http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/49bffa74-4e84-4fd6-9d67-42e8385611b8 there is sample code given with a Javascript client and a C++ component for using a SinkWriter. I am trying to create a solution using the exact same code but I get a lot of errors. For the C++ component I am using the Windows Runtime Component template. I add a class MediaWriter and add the MediaWritter::WriteAsync declaration to the MediaWriter.h file. Then it gives me the error that there is an unknown namespace Extensions. When I delete that statement, building gives me errors like 'unresolved external symbol _MFVideoFormat_RGB32'.

    Is the namespace Extensions an existing component, or do I have to create it myself? Do I use the wrong project template?

    I have a C# background and no C++ knowledge and I am struggling to get something working with a C# client and a C++ component using a SinkWriter. Any help from C++ experts is greatly appreciated.

    Ronald

     

     

     

     


    Friday, December 21, 2012 10:18 AM

Answers

  • Found it myself. All steps above described are good.

    Additional steps :

    Add following libraries through Project Properties->Configuration Properties->Linker->Input: Add

    dxva2.lib
    evr.lib
    mf.lib
    mfplat.lib
    mfplay.lib
    mfreadwrite.lib
    mfuuid.lib

    If you have created a new class in the C++ component, make sure that this class is visible in C# client by adding a namespace and add 'public ref class <classname> sealed' to the class declaration in the header file.

    Ronald

    Friday, December 21, 2012 11:16 AM

All replies

  • Found it myself. All steps above described are good.

    Additional steps :

    Add following libraries through Project Properties->Configuration Properties->Linker->Input: Add

    dxva2.lib
    evr.lib
    mf.lib
    mfplat.lib
    mfplay.lib
    mfreadwrite.lib
    mfuuid.lib

    If you have created a new class in the C++ component, make sure that this class is visible in C# client by adding a namespace and add 'public ref class <classname> sealed' to the class declaration in the header file.

    Ronald

    Friday, December 21, 2012 11:16 AM

  • Thanks for sharing.

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 24, 2012 6:32 AM