<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Hi,<BR>
&nbsp;<BR>
I replace "non-blocking fashion " with a "while" sentence like : while(HasItemForH264==0) for experiment;<BR>
&nbsp;<BR>
In client, i implemented:[root@localhost ~]# mplayer rtsp://10.13.72.91:8554/H264LiveVideoTest<BR>
&nbsp;<BR>
(The result is :)<BR>
&nbsp;<BR>
MPlayer 1.0rc1-3.2.3 (C) 2000-2006 MPlayer Team<BR>CPU: Intel(R) Pentium(R) 4 CPU 3.06GHz (Family: 15, Model: 4, Stepping: 9)<BR>CPUflags:&nbsp; MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1<BR>Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2<BR>
Playing rtsp://10.13.72.91:8554/H264LiveVideoTest.<BR>Resolving 10.13.72.91 for AF_INET6...<BR>Couldn't resolve name for AF_INET6: 10.13.72.91<BR>Connecting to server 10.13.72.91[10.13.72.91]: 8554...<BR>rtsp_session: unsupported RTSP server. Server type is 'unknown'.<BR>STREAM_LIVE555, URL: rtsp://10.13.72.91:8554/H264LiveVideoTest<BR>Stream not seekable!<BR>&nbsp;file format detected.<BR>Initiated "video/H264" RTP subsession on port 32770<BR>demux_rtp: Guessed the video frame rate as 16 frames-per-second.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (If this is wrong, use the "-fps &lt;frame-rate&gt;" option instead.)<BR>VIDEO:&nbsp; [H264]&nbsp; 0x0&nbsp; 0bpp&nbsp; 16.000 fps&nbsp;&nbsp;&nbsp; 0.0 kbps ( 0.0 kbyte/s)<BR>It seems there is no Xvideo support for your video card available.<BR>Run 'xvinfo' to verify its Xv support and read DOCS/HTML/en/video.html#xv!<BR>See 'mplayer -vo help' for other (non-xv) video out drivers. Try -vo x11<BR>==========================================================================<BR>Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family<BR>Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)<BR>==========================================================================<BR>Audio: no sound<BR>Starting playback...<BR>Error while decoding frame!<BR>[h264 @ 0x87b73f4]non existing PPS referenced<BR>[h264 @ 0x87b73f4]decode_slice_header error<BR>Error while decoding frame!<BR>Error while decoding frame!,?% 0 0<BR>[h264 @ 0x87b73f4]non existing PPS referenced<BR>[h264 @ 0x87b73f4]decode_slice_header error<BR>Error while decoding frame!<BR>Error while decoding frame!,?% 0 0<BR>Error while decoding frame!,?% 0 0<BR>V:&nbsp;&nbsp; 0.1&nbsp;&nbsp; 6/&nbsp; 6 ??% ??% ??,?% 0 0<BR>
&nbsp;<BR>
Would you please give some suggestions about this result?<BR>
&nbsp;<BR>
Thanks very much!&nbsp;<BR><BR>
<BR><BR><BR><BR>&nbsp;<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_stopSpelling>
From: zjuchenjun@hotmail.com<BR>To: live-devel@ns.live555.com<BR>Date: Thu, 18 Jan 2007 12:58:39 +0800<BR>Subject: Re: [Live-devel] "createNewStreamSource()" member function<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:9pt;font-family:Tahoma;}
</STYLE>
Hi Ross,<BR>&nbsp;<BR>I want to ask another question before you answer my previous question :)<BR>&nbsp;<BR>In DeviceSource::doGetNextFrame() ,it mentiond a "non-blocking fashion ", I read the maillist and <BR>&nbsp;<BR>write my own code ,but it doesn't work. Where is my fault? <BR>&nbsp;<BR>Thanks in advance.<BR>&nbsp;<BR>void H264VideoStreamDiscreteFramer::doGetNextFrame()<BR>&nbsp;{<BR>&nbsp; <BR><BR>//**************************non-blocking fashion**************************//<BR>while(1){<BR>&nbsp;<BR>&nbsp;&nbsp;envforH264-&gt;taskScheduler().doEventLoop(HasItemForH264);<BR><BR>&nbsp;&nbsp; pthread_mutex_lock(&amp;mutexforH264);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(*HasItemForH264==99)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;deliverFrame();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * HasItemForH264=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pthread_mutex_unlock(&amp;mutexforH264);&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;sleep(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;//if (0 /* the source stops being readable */) {<BR>&nbsp;//&nbsp;&nbsp; handleClosure(this);<BR>&nbsp;//&nbsp; return;<BR>&nbsp;// }<BR>&nbsp;<BR>&nbsp; <BR>}<BR><BR><BR><BR><BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_EC_stopSpelling>
From: zjuchenjun@hotmail.com<BR>To: live-devel@ns.live555.com<BR>Date: Wed, 17 Jan 2007 10:35:24 +0800<BR>Subject: Re: [Live-devel] "createNewStreamSource()" member function<BR><BR>
<STYLE>
.ExternalClass P
{padding:0px;}
.ExternalClass
{font-size:9pt;font-family:Tahoma;}
</STYLE>
<FONT size=2>Hi ROSS,</FONT><BR><FONT size=2>Thanks for your reply!</FONT><BR><FONT size=2>I had defined "H264VideoStreamDiscreteFramer" to be a subclass of ""H264VideoStreamFramer".And the class "H264VideoStreamDiscreteFramer" included </FONT><BR><FONT size=2>two&nbsp;member function(I read your reply in maillist):void H264VideoStreamDiscreteFramer::doGetNextFrame(),</FONT><BR><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT size=2>&nbsp;Boolean&nbsp; H264VideoStreamDiscreteFramer::currentNALUnitEndsAccessUnit().</FONT><BR><FONT size=2>Is it right ?</FONT><BR><FONT size=2>&nbsp;</FONT><BR><FONT size=2>According&nbsp;to&nbsp;your reply, I rewrite my code like this :</FONT><BR><FONT size=2></FONT>&nbsp;<BR><FONT size=2>//***********************************************************************************************! *************************************//<BR>FramedSource* H264VideoLiveServerMediaSubsession<BR>::createNewStreamSource(unsigned /*clientSessionId*/, unsigned&amp; estBitrate) {</FONT><BR><FONT size=2>&nbsp; estBitrate = 320; // kbps, estimate ; see my notebook</FONT><BR><FONT size=2></FONT>&nbsp;<BR><BR><FONT size=2>&nbsp; // Create the video source:<BR>H264VideoStreamDiscreteFramer *liveSource<BR>&nbsp;&nbsp;&nbsp;&nbsp; =H264VideoStreamDiscreteFramer::createNew(*env_H264,&nbsp; NULL, buffers_H264, length_H264, bufferhasitem_H264, mutex_H264);<BR>&nbsp;&nbsp; if (liveSource == NULL)&nbsp; return NULL;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return&nbsp; liveSource;<BR>&nbsp; <BR>}<BR><BR>//***********************************************************************************************************************************//</FONT><BR><FONT size=2></FONT>&nbsp;<BR><FONT size=2>Is it right?</FONT><BR><FONT size=3></FONT>&nbsp;<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_EC_EC_stopSpelling>
Date: Tue, 16 Jan 2007 06:13:07 -0800<BR>To: live-devel@ns.live555.com<BR>From: finlayson@live555.com<BR>Subject: Re: [Live-devel] "createNewStreamSource()" member function<BR><BR>
<STYLE>
.ExternalClass blockquote, .ExternalClass dl, .ExternalClass ul, .ExternalClass ol, .ExternalClass li
{padding-top:0;padding-bottom:0;}
</STYLE>

<BLOCKQUOTE><FONT face="Times New Roman">&nbsp;return H264VideoStreamFramer::createNew(envir(),liveSource);&nbsp;</FONT></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>You can't do this, because "H264VideoStreamFramer" is a virtual base class.&nbsp; Instead, you should define your own class "H263VideoStreamDiscreteFramer" to be a subclass of ""H264VideoStreamFramer".&nbsp; Then, your "H263VideoStreamDiscreteFramer" object can be the value returned by your implementation of "createNewStreamSource()".</DIV><PRE>-- 
</PRE>
<DIV><BR>Ross Finlayson<BR>Live Networks, Inc.<BR>http://www.live555.com/</DIV></BLOCKQUOTE><BR>
<HR>
率先尝试 Windows Live Mail。 <A href="http://http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d" target=_blank>Windows Live Mail</A> </BLOCKQUOTE><BR>
<HR>
率先尝试 Windows Live Mail。 <A href="http://http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d" target=_blank>Windows Live Mail</A> </BLOCKQUOTE><br /><hr />率先尝试 Windows Live Mail。 <a href='http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d' target='_new'>Windows Live Mail</a></body>
</html>