Posted By: Ben Waggoner | Oct 1st @ 10:04 AM
My colleague Larry Olson has posted the first public demo project for MediaStreamSource. This new Silverlight 2 feature enables file parsers and network protocols to be implemented in managed code inside of Silverlight, thus enabling support beyond the built-in native formats. Since MSS passes off the compressed media samples to the native decoders, it should offer nearly the same performance as a native code implementation (parsers aren't that expensive). But since it runs inside of the Silverlight managed code sandbox, support for new formats and protocols can be just added into player's .XAP package file, and will be completely transparent to the end user.

MediaStreamSource is one of the biggest enabling features in Silverlight 2. At IBC, people came up with all kinds of crazy, awesome, and even useful ideas of what to do with it beyond anything I'd ever imagined. Really, the only big limitation is that you can't use UDP packets, as they're not supported by the Silverlight networking stack.

Some people have had trouble finding the MSDN docs about MSS, so I'll list them here as well:

MediaStreamSource Class
MediaStreamSource Members
Rating:
0
0

Technically, what this feature supports is to be able to plug in to a callback event from a MediaElement, and whenever it needs the next sample to play, you are notified and you are supposed to prepare the sample. The sample format has to be in a format that MediaElement understands which is currently WMV, WMA, and MP3.

This feature is great especially if you want to have more control on how your media is played back, and also it is great to have your own custom media server setup on the backend.

However, I am confused about your statement "since it runs inside of the Silverlight managed code sandbox, support for new formats and protocols can be just added into player's .XAP package file". Assuming that H.264 and AAC will be available soon, you are still limited to a number of formats that Silverlight supports including MP3, WMA, and WMV.  So why would you create your media in a different format than what Silverlight supports given that you have to convert it again to a format that Silverlight supports, especially when none of the formats are raw formats like PCM (what I mean you have to pay licensing for decoding)?
It would be possible technically, but would it make sense performance-wise? IMHO it would be too slow to ship your videos in, for example, H.263 and convert them to WMV right before you feed them to a MediaElement.

Am I missing something?