Hello, <div>I have done what you are describing. </div><div>Extended on demand server to stream on demand from unicast or multicast to unicast or multicast clients any UDP or RTP TS stream. </div><div><br></div><div>Its rather simple once you get the hang of it. </div>

<div>Stared at it for a month then came up with  working code in 1-2 days.</div><div><br></div><div>Contact me, perhaps we can exchange knowledge.</div><div><br></div><div>Zed</div><div><br><div class="gmail_quote">On Fri, Dec 10, 2010 at 3:23 PM, Wiser, Tyson <span dir="ltr"><<a href="mailto:TWiser@logostech.net">TWiser@logostech.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Ross,<br>
<br>
Thanks for the help.  After doing a quick test it appears that making the suggested modifications to my subclass of "OnDemandServerMediaSubsession" does work as expected.  I appreciate your great work on this library.<br>


<font color="#888888"><br>
Tyson<br>
</font><div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: <a href="mailto:live-devel-bounces@ns.live555.com">live-devel-bounces@ns.live555.com</a> [mailto:<a href="mailto:live-devel-bounces@ns.live555.com">live-devel-bounces@ns.live555.com</a>] On Behalf Of Ross Finlayson<br>


Sent: Friday, December 10, 2010 3:10 AM<br>
To: LIVE555 Streaming Media - development & use<br>
Subject: Re: [Live-devel] OnDemandServerMediaSubsession and FramedSource subclassing<br>
<br>
>Basically, I need a server that streams data on demand from a live<br>
>source to a client.  The stream needs to be able to be sent using<br>
>either unicast or multicast to an address and port combination<br>
>dictated by the client in the SETUP message.<br>
<br>
It's usually the server, not the client, that decides whether or not<br>
the stream is unicast or multicast.  The usual way for a server to<br>
support both kinds of stream is to have both a<br>
"OnDemandServerMediaSubsession" and a "PassiveServerMediaSubsession"<br>
- with different names, of course.  The client could use the stream<br>
name to choose between unicast and multicast.<br>
<br>
In principle this would work, but in your case you'd have a problem:<br>
The 'reuseFirstSource' mechanism has been implemented only for<br>
"OnDemandServerMediaSubsession"s; not for<br>
"PassiveServerMediaSubsession".  Furthernore, there's no way for<br>
those two separate classes to share the same input source.  So, to<br>
have both the unicast and multicast streams reading from the same<br>
source, you'd need to modify the code.<br>
<br>
A simpler alternative is to do what you seem to be doing: Allow the<br>
client to specify the destination address (i.e., unicast or<br>
multicast), using a "destination=" parameter in the RTSP "SETUP"<br>
message.  To support this, you'll need to define<br>
        RTSP_ALLOW_CLIENT_DESTINATION_SETTING<br>
before you compile "RTSPServer.cpp"; I presume that you've done this.<br>
<br>
<br>
>First, if I wanted to subclass OnDemandServerMediaSubsession to<br>
>handle multicast as well as unicast, is it sufficient to change<br>
>getStreamParameters() so that it doesn't automatically set<br>
>isMulticast to False, but instead sets it based on the destination<br>
>address?<br>
<br>
I haven't tested this, but yes, I believe so.  It should be easy:<br>
Your subclass could redefine the "getStreamParameters()" virtual<br>
function to do this:<br>
<br>
void mySubclass::getStreamParameters( ...parameters... ) {<br>
        OnDemandServerMediaSubsession::getStreamParameters( ...parameters... );<br>
        if (IsMulticastAddress(destinationAddress) isMulticast = True;<br>
}<br>
<br>
<br>
>The problem, when using OnDemandServerMediaSubsession, is that I<br>
>don't know how to get a reference to my source object.  That object,<br>
>as the name of the class implies, is created on demand and I have<br>
>not found any functions that return to me a FramedSource* or a<br>
>RTPSink*.  I have made sure that I set reuseFirstSource to True when<br>
>creating the OnDemandServerMediaSubsession subclass, which I<br>
>understand to mean that there will only ever be one source.  Is<br>
>there a way to get a reference to that source?<br>
<br>
Yes, when your "OnDemandServerMediaSubsession " subclass creates a<br>
source object - in your implementation of the<br>
"createNewStreamSource()" virtual function - you can store a pointer<br>
to the source object (e.g., in a global variable).  (Because<br>
"reuseFirstSource" is true, "createNewStreamSource()" should be<br>
called just once, so there will be only one such source object.)<br>
--<br>
<br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a><br>
_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br>
_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Zdenek Bouresh<br>NextStream LTD.<br><br>The information contained within this email transmission and any attachments is confidential and intended solely for the attention and use of the named individual addressee(s) or entity. It may not be legally revealed or be disclosed to any other person or third party without the express authority (prior written approval) of NextStream LTD and/or the original recipient, or the intended recipients, or both. If you are not the intended recipient, you must not disclose, copy, distribute, print, rely on or retain this message or any part of it. The information contained within is strictly prohibited. If you have received this email in error please notify the sender by reply, and delete this message from your email system(s). Any hard copies must also be destroyed.<br>


</div>