<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Ross, hello everbody else there,<div><br></div><div>Well, I'm currently trying to get through the RTSPClient lib and mixing it up with some objC.</div><div>Thus we get a nice meal called: obj-C++ :-)</div><div><br></div><div>My current aim is to fetch a h264-stream from a server and write it to a file on the client-side.</div><div>this works so far.</div><div>I'm available to:</div><div>- get an SDPDescription from the server</div><div>- create my basicUsageEnivironment with that description</div><div>- creating a Filesink for h264</div><div>- writing to a file ...</div><div><br></div><div>... but:</div><div>after a final call to <span class="Apple-style-span" style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px; "><span style="color: #4f8187">env</span><span style="color: #000000">-></span>taskScheduler<span style="color: #000000">().</span>doEventLoop<span style="color: #000000">(); this leads obviously to an infinity loop ... </span></span></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">which I want to end, after all data is received and written to file.</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">therefore I tried some solutions from older postings in this list using the "watcherVariable", especially the one introducing</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;">a modified "dummyTask" where I point to a global visible watchVariable:</span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #bb2ca2">void</span> dummyTask(<span style="color: #4f8187">UsageEnvironment</span>* <span style="color: #4f8187">env</span>, <span style="color: #bb2ca2">char</span>* myWatchVariable) {</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">                </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>// Call this again, after a brief delay:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2ca2">int</span> uSecsToDelay = <span style="color: #272ad8">1000000</span>; <span style="color: #008400">//</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"></span></span><span class="Apple-tab-span" style="white-space:pre">        </span>//*env->taskScheduler().scheduleDelayedTask(uSecsToDelay,(TaskFunc*)dummyTask, NULL);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #4f8187">env</span>-><span style="color: #31595d">taskScheduler</span>().<span style="color: #31595d">scheduleDelayedTask</span>(uSecsToDelay, (TaskFunc*)dummyTask, <span style="color: #bb2ca2">NULL</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(209, 47, 27); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(209, 47, 27); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"></span></span><span style="color: #3d1d81"><span class="Apple-tab-span" style="white-space:pre">        </span>NSLog</span><span style="color: #000000">(</span>@"dummyTask called :-) ... waiting a second\n"<span style="color: #000000">); //"printf" in objC</span></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(61, 29, 129); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 132, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>//setting watchVariable to "NULL" -> EventLoop will end!</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>myWatchVariable = <span style="color: #272ad8">'\0'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">}</div><div><br></div><div><br></div><div><br></div><div>my problem is, that my stream will not get written to the file, as the eventloop will be finished before this could be done, in fact zero bytes are written, only the filename ist created/updated.</div><div><br></div><div><br></div><div>So my question:</div><div>How can I get the eventLoop to end AFTER my file is written (seems the buffer needs to be checked or something else)?</div><div>Do I have to setup "<span class="Apple-style-span" style="color: rgb(49, 89, 93); "><span style="color: #4f8187">BasicTaskScheduler</span><span style="color: #000000">::</span>turnOnBackgroundReadHandling" for this?</span></div><div><br></div><div><br></div><div>Any help would be great :-)</div><div><br></div><div>cheers</div><div>Sven</div><div><br></div></span></font></div></body></html>