<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>