<div dir="ltr">I just use command "testRTSPClient rtsp://<a href="http://192.168.122.199">192.168.122.199</a>" to receive h.264 stream from an ip camera, not using multicast.<div><br></div><div>I've noticed the client can't get local ip address using "ourIPAddress" function when the default gateway ip is missed.</div>
<div><br></div><div>"ourIPAddress" will send a multicast packet to get local ip.</div><div><br></div><div>Using gprof as ROSS told me, I got this:</div><div><br></div><div><b>without gateway ip:</b></div><div><ul>
<li>Each sample counts as 0.01 seconds.<br></li><li>  %   cumulative   self              self     total           <br></li><li> time   seconds   seconds    calls  us/call  us/call  name    <br></li><li> 23.53      0.08     0.08                             write<br>
</li><li> 11.76      0.12     0.04                             sendto<br></li><li>  5.88      0.14     0.02                             close<br></li><li>  5.88      0.16     0.02                             recvmsg<br></li>
<li>  5.88      0.18     0.02                             vfprintf<br></li><li>  2.94      0.19     0.01      203    49.26    49.26  DummySink::afterGettingFrame(unsigned int, unsigned int, timeval, unsigned int)<br></li>
<li>  2.94      0.20     0.01                             _IO_default_xsputn<br></li><li>  2.94      0.21     0.01                             ourIPAddress(UsageEnvironment&)<br></li><li>  2.94      0.22     0.01                             DelayQueue::synchronize()<br>
</li><li>  2.94      0.23     0.01                             FramedSource::afterGetting(FramedSource*)<br></li><li>  2.94      0.24     0.01                             ___xstat64<br></li><li>  2.94      0.25     0.01                             __tzstring<br>
</li><li>  2.94      0.26     0.01                             _int_malloc<br></li><li>  2.94      0.27     0.01                             _xstat<br></li><li>  2.94      0.28     0.01                             make_request<br>
</li><li>  2.94      0.29     0.01                             mempcpy<br></li><li>  2.94      0.30     0.01                             our_random<br></li><li>  2.94      0.31     0.01                             puts<br>
</li><li>  2.94      0.32     0.01                             select<br></li><li>  2.94      0.33     0.01                             setsockopt<br></li><li>  2.94      0.34     0.01                             socket<br>
</li><li>  0.00      0.34     0.00      205     0.00     0.00  DummySink::continuePlaying()<br></li><li>  0.00      0.34     0.00      203     0.00    49.26  DummySink::afterGettingFrame(void*, unsigned int, unsigned int, timeval, unsigned int)<br>
</li><li>  0.00      0.34     0.00       11     0.00     0.00  operator<<(UsageEnvironment&, RTSPClient const&)<br></li><li>  0.00      0.34     0.00        9     0.00     0.00  operator<<(UsageEnvironment&, MediaSubsession const&)<br>
</li><li>  0.00      0.34     0.00        4     0.00     0.00  setupNextSubsession(RTSPClient*)<br></li><li>  0.00      0.34     0.00        3     0.00     0.00  continueAfterSETUP(RTSPClient*, int, char*)<br></li><li>  0.00      0.34     0.00        3     0.00     0.00  DummySink::createNew(UsageEnvironment&, MediaSubsession&, char const*)<br>
</li><li>  0.00      0.34     0.00        3     0.00     0.00  DummySink::DummySink(UsageEnvironment&, MediaSubsession&, char const*)<br></li><li>  0.00      0.34     0.00        1     0.00     0.00  continueAfterPLAY(RTSPClient*, int, char*)<br>
</li><li>  0.00      0.34     0.00        1     0.00     0.00  continueAfterDESCRIBE(RTSPClient*, int, char*)<br></li><li>  0.00      0.34     0.00        1     0.00     0.00  openURL(UsageEnvironment&, char const*, char const*)<br>
</li><li>  0.00      0.34     0.00        1     0.00     0.00  ourRTSPClient::createNew(UsageEnvironment&, char const*, int, char const*, unsigned short)<br></li><li>  0.00      0.34     0.00        1     0.00     0.00  ourRTSPClient::ourRTSPClient(UsageEnvironment&, char const*, int, char const*, unsigned short)<br>
</li><li>  0.00      0.34     0.00        1     0.00     0.00  main<br></li></ul></div><div><br></div><div><b>with gateway ip:</b></div><div><div><ul><li>Each sample counts as 0.01 seconds.<br></li><li>  %   cumulative   self              self     total           <br>
</li><li> time   seconds   seconds    calls  Ts/call  Ts/call  name    <br></li><li> 53.33      0.08     0.08                             write<br></li><li> 13.33      0.10     0.02                             _int_malloc<br>
</li><li>  6.67      0.11     0.01                             BasicUsageEnvironment::operator<<(char const*)<br></li><li>  6.67      0.12     0.01                             cfree<br></li><li>  6.67      0.13     0.01                             new_do_write<br>
</li><li>  6.67      0.14     0.01                             recvfrom<br></li><li>  6.67      0.15     0.01                             vfprintf<br></li><li>  0.00      0.15     0.00      337     0.00     0.00  DummySink::continuePlaying()<br>
</li><li>  0.00      0.15     0.00      335     0.00     0.00  DummySink::afterGettingFrame(void*, unsigned int, unsigned int, timeval, unsigned int)<br></li><li>  0.00      0.15     0.00      335     0.00     0.00  DummySink::afterGettingFrame(unsigned int, unsigned int, timeval, unsigned int)<br>
</li><li>  0.00      0.15     0.00       11     0.00     0.00  operator<<(UsageEnvironment&, RTSPClient const&)<br></li><li>  0.00      0.15     0.00        9     0.00     0.00  operator<<(UsageEnvironment&, MediaSubsession const&)<br>
</li><li>  0.00      0.15     0.00        4     0.00     0.00  setupNextSubsession(RTSPClient*)<br></li><li>  0.00      0.15     0.00        3     0.00     0.00  continueAfterSETUP(RTSPClient*, int, char*)<br></li><li>  0.00      0.15     0.00        3     0.00     0.00  DummySink::createNew(UsageEnvironment&, MediaSubsession&, char const*)<br>
</li><li>  0.00      0.15     0.00        3     0.00     0.00  DummySink::DummySink(UsageEnvironment&, MediaSubsession&, char const*)<br></li><li>  0.00      0.15     0.00        1     0.00     0.00  continueAfterPLAY(RTSPClient*, int, char*)<br>
</li><li>  0.00      0.15     0.00        1     0.00     0.00  continueAfterDESCRIBE(RTSPClient*, int, char*)<br></li><li>  0.00      0.15     0.00        1     0.00     0.00  openURL(UsageEnvironment&, char const*, char const*)<br>
</li><li>  0.00      0.15     0.00        1     0.00     0.00  ourRTSPClient::createNew(UsageEnvironment&, char const*, int, char const*, unsigned short)<br></li><li>  0.00      0.15     0.00        1     0.00     0.00  ourRTSPClient::ourRTSPClient(UsageEnvironment&, char const*, int, char const*, unsigned short)<br>
</li><li>  0.00      0.15     0.00        1     0.00     0.00  main<br></li></ul></div></div><div><br></div><div>I still don't know where is the problem. Please help.</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 29, 2014 at 4:15 AM, Warren Young <span dir="ltr"><<a href="mailto:warren@etr-usa.com" target="_blank">warren@etr-usa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 4/28/2014 02:34, Cheng Lei wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If delete default gateway ip addrss, then run the test program<br>
testRTSPClient, CPU percentage is 6%, then I add the default gateway ip<br>
by using cmd such as "route add default gw 192.168.122.1", CPU decrease<br>
to 1%. If you guys know the issue, please help, thanks.<br>
</blockquote>
<br></div>
Are the streams you're setting up via RTSP multicast, by chance?  I have noticed that the Linux network stack seems to require a gateway to do multicasting correctly, even when the packets never leave the LAN.<br>
<br>
If you absolutely cannot have a real gateway IP, try using the machine's own IP as the "gateway" address.  That is usually enough to placate the routing layer of the stack.<div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/<u></u>mailman/listinfo/live-devel</a><br>
</div></div></blockquote></div><br></div>