locked
Cnverting System::IO::Stream to IMFByteStream for MFCreateSourceReaderFromByteStream RRS feed

  • Question

  • Hi

    I have a managed .NET client that needs to invoke a Windows Media foundation dll and pass  byte stream for transcoding some media files directly from memory.

    I need to convert a Array<byte> to IMFByteStream but can't find anything on the subject. Any help would be appreciated.

    Sunday, February 10, 2013 12:31 PM

All replies

  • Got it working using the following code:

    (IStream*)Marshal::GetComInterfaceForObject(source, System::Runtime::InteropServices::ComTypes::IStream::typeid).ToPointer();

    source is an instance of a class that implements System::Runtime::InteropServices::ComTypes::IStream interface

    Saturday, February 16, 2013 6:03 PM