locked
Create network streaming sink - howto? RRS feed

  • Question

  • Hi!

    Is there an example, how to use the MFCreateASFStreamingMediaSinkActivate function?
    The documentation is pretty poor on MSDN.
    How to get/prepare the first parameter (*ByteStreamActivate) when the main goal is to stream ASF over network?
    In the SDK samples there is nothing about that.

    Thank you in advance!
    Friday, December 25, 2015 3:03 PM

Answers

All replies

  • Hi

    I never was into Network Streaming with Media Foundation, but i am planing to do it mid to end of this year.

    You are right, there is not much info regarding ASF Streaming over Network in the Media Foundation docs, however there is plenty of documentation outside of MF about sending ASF data over network. This link could help you implementing a custom Byte Stream :

    "Broadcasting ASF Data"

    All you need to do is :

    1. Build a class which implements IMFByteStream. Use Media Format documentation to send data.

    2. Build a class which implements IMFActivate and handles you over the custom Byte Stream object.

    Its weird that Microsoft hasnt build a standard implementation for an ASF Network Byte Stream yet. One would think that there is a function to create such a stream as they are asking for it in the "MFCreateASFStreamingMediaSinkActivate" method. Well i couldnt find any...

    I hope i could help you at least a bit with the idea of sending data from a custom implementation.

    Regards,

    Francis



    • Proposed as answer by Francis Grave Saturday, January 9, 2016 11:04 AM
    • Unproposed as answer by Francis Grave Saturday, January 9, 2016 11:05 AM
    • Edited by Francis Grave Tuesday, May 31, 2016 3:12 PM Edit
    Friday, January 8, 2016 7:30 PM
  • In some API's you get IStream objects which you can use with MFCreateMFByteStreamOnStream but i couldnt find any for creating a network stream. I found this though when i googled a few minutes more this morning :

    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4148ffcd-4826-4c27-82cd-b6ebb3a71f35/how-to-send-a-video-sample-over-network-using-winsock?forum=mediafoundationdevelopment

    There an MSFT member hinted to the use of MFCreateASFStreamingMediaSink with the need to write/implement a Byte Stream. So it seems that it is realy up to you to write a custom Byte Stream. You can use WINSOCK or Media Format to send data over network. I think with WINSOCK it is more fiddeling. The best solution seems to be using the Media Format SDK as i meantioned in my first post.

    Regards,

    Francis



    Saturday, January 9, 2016 11:00 AM
  • Hi!

    I forgot to mention that I am doing the whole thing in C# using MediaFoundation.NET library.

    But anyway I will try following:
    1. implement System.Runtime.InteropServices.ComTypes.IStream interface (found an example for that)

    2. use it as input in MFCreateMFByteStreamOnStream and the result IMFByteStream

    3. pass to MFCreateASFStreamingMediaSink function.

    Thanks for tips!

    Regards,
    Ladislav



    Sunday, January 10, 2016 7:48 PM