<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 17/12/12 12:18, Ross Finlayson wrote:
<blockquote
cite="mid:9CC85C20-5082-4DCF-8FAA-F8C801904218@live555.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div>Since the "testOnDemandRTSPServer" demonstrates how to stream
from *files* to (unicast) clients, it does not 'demonstrate'
multicast to unicast RTSP relaying at all. Therefore, you must
have modified the supplied application's code in some
(unspecified) way. So I don't really see how I can help you.</div>
<div><br>
</div>
</blockquote>
<br>
I have copied testOnDemandRTSPServer.cpp to another file and
modified it - the modification is simply the removal of all
available streams with the exception of the following block:<br>
<br>
// A MPEG-2 Transport Stream, coming from a live UDP (raw-UDP or
RTP/UDP) source:<br>
{<br>
char const* streamName =
"mpeg2TransportStreamFromUDPSourceTest";<br>
char const* inputAddressStr = "239.255.42.42";<br>
// This causes the server to take its input from the stream
sent by the "testMPEG2TransportStreamer" demo application.<br>
// (Note: If the input UDP source is unicast rather than
multicast, then change this to NULL.)<br>
portNumBits const inputPortNum = 1234;<br>
// This causes the server to take its input from the stream
sent by the "testMPEG2TransportStreamer" demo application.<br>
Boolean const inputStreamIsRawUDP = False;<br>
ServerMediaSession* sms<br>
= ServerMediaSession::createNew(*env, streamName, streamName,<br>
descriptionString);<br>
sms->addSubsession(MPEG2TransportUDPServerMediaSubsession<br>
::createNew(*env, inputAddressStr,
inputPortNum, inputStreamIsRawUDP));<br>
rtspServer->addServerMediaSession(sms);<br>
<br>
char* url = rtspServer->rtspURL(sms);<br>
*env << "\n\"" << streamName << "\" stream,
from a UDP Transport Stream input source \n\t(";<br>
if (inputAddressStr != NULL) {<br>
*env << "IP multicast address " << inputAddressStr
<< ",";<br>
} else {<br>
*env << "unicast;";<br>
}<br>
*env << " port " << inputPortNum << ")\n";<br>
*env << "Play this stream using the URL \"" << url
<< "\"\n";<br>
delete[] url;<br>
}<br>
<br>
<blockquote
cite="mid:9CC85C20-5082-4DCF-8FAA-F8C801904218@live555.com"
type="cite">
<div>
<div><br>
</div>
</div>
Once again, you haven't said how you have modified the supplied
code, but it sounds like you added a new
"OnDemandServerMediaSubsession" subclass that (1) correctly sets
"reuseFirstSource" to True, and (2) redefines the
"createNewStreamSource()" virtual function to create a new input
source object (of some unspecified type...).
<div><br>
</div>
</blockquote>
<br>
Correct, I have specified reuseFirstSource as true. As above, I
have used the code block from the supplied test program, with the
multicast group and port modified to suit local conditions.<br>
<br>
<blockquote
cite="mid:9CC85C20-5082-4DCF-8FAA-F8C801904218@live555.com"
type="cite">
<div>
<div>If you do this, then, yes, the input source object will get
closed (and its destructor called) whenever the last RTSP
client leaves. This is the proper behavior, because we want
the input source to be closed when noone is requesting its
data. (Similarly, when another client arrives later,
"createNewStreamSource()" will get called again, and a new
input source object will get created.)</div>
</div>
<div><br>
</div>
</blockquote>
<br>
Now, if that was the behaviour I am observing, then I would be quite
happy with that! However, when another client arrives later, the
multicast stream source does not appear to become active again. I
can confirm however that createNewStreamSource from
MPEG2TransportUDPServerMediaSubsession.cpp is being called as you
say it should be when the client arrives.<br>
<br>
I am confident the source is still present on the network, as the
source is directly connected to an ethernet port on the testing
machine. I can see no reason why the library shouldn't be able to
resubscribe to this source, either.<br>
<br>
Thanks and regards,<br>
<br>
-Tim<br>
</body>
</html>