<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: [Live-devel] new rtspclient implementation
question</title></head><body>
<blockquote type="cite" cite>I just recently started developing some
code to implement a simple RTSP client.</blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite>I have been using the new RTSPClient
implementation. (the one with the non blocking sockets)</blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite>Below is an excerpt from my
code:</blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite>&nbsp;<b> rtspclient =
RTSPClient::createNew(*env,link,verbosity_level,app_name,tunnel);</b
></blockquote>
<blockquote type="cite" cite><b><br></b></blockquote>
<blockquote type="cite" cite><b>&nbsp; *env &lt;&lt; &quot;created
rtsp client\n&quot;;</b></blockquote>
<blockquote type="cite" cite><b><br></b></blockquote>
<blockquote type="cite" cite><b>&nbsp; RTSPClient::responseHandler
*fun = &amp;printOptions; //printOptions prints the options response
to stdout</b></blockquote>
<blockquote type="cite" cite><b>&nbsp; cseq =
rtspclient-&gt;sendOptionsCommand(fun,NULL);</b></blockquote>
<blockquote type="cite" cite><b>&nbsp; *env &lt;&lt; &quot;Options
Cseq = &quot;&lt;&lt; cseq &lt;&lt; &quot;\n&quot;;</b></blockquote>
<blockquote type="cite" cite><b><br></b></blockquote>
<blockquote type="cite" cite><b>&nbsp; fun =
&amp;printDescribe;//printDescribe prints the sdp description to
stdout</b></blockquote>
<blockquote type="cite" cite><b>&nbsp; cseq =
rtspclient-&gt;sendDescribeCommand(fun,NULL);</b></blockquote>
<blockquote type="cite" cite><b>&nbsp; *env &lt;&lt; &quot;Describe
Cseq = &quot; &lt;&lt; cseq &lt;&lt; &quot;\n&quot;;</b></blockquote>
<blockquote type="cite" cite><b><br></b></blockquote>
<blockquote type="cite" cite><b>&nbsp;&nbsp;
env-&gt;taskScheduler().doEventLoop();&nbsp;</b></blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite><br></blockquote>
<blockquote type="cite" cite>Now, I know that the last statement
effectively terminates the current thread of execution.</blockquote>
<div><br></div>
<div>No it doesn't - it just moves the &quot;current thread of
execution&quot; into the event loop.</div>
<div><br></div>
<div>And that's exactly what should be happening.&nbsp; The handling
of incoming RTSP responses - and the subsequent calling of the
response handler function for each response - takes place within the
event loop.&nbsp; Note that LIVE555 applications are
event-driven.</div>
<div><br></div>
<div>If you set the &quot;verbosity_level&quot; parameter to 1, you
should see more information about what's happening.</div>
<div><br></div>
<div>I notice, though, that you're trying to send 'pipelined'
requests: I.e., you're sending a &quot;DESCRIBE&quot; command before
you receive a response to the previous &quot;OPTIONS&quot; command.&nbsp;
This is something that RTSP allows, and which our RTSP client software
supports (though it has not been extensively tested yet).&nbsp;
However, it's possible that your server does not support it.</div>
<div><br></div>
<div>So, at least at first, I suggest that you don't try to pipeline
requests.&nbsp; In particular, I suggest that you move the call to
&quot;doEventLoop()&quot; after the call to
&quot;sendOptionsCommand()&quot; (and then move the call to
&quot;sendDescribeCommand()&quot; to the end of the
&quot;printOptions&quot; response handler).</div>
<x-sigsep><pre>-- 
</pre></x-sigsep>
<div><br>
Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/</div>
</body>
</html>