[Live-devel] "createNewStreamSource()" member function

chenjun zjuchenjun at hotmail.com
Wed Jan 17 20:58:39 PST 2007


Hi Ross,
 
I want to ask another question before you answer my previous question :)
 
In DeviceSource::doGetNextFrame() ,it mentiond a "non-blocking fashion ", I read the maillist and 
 
write my own code ,but it doesn't work. Where is my fault? 
 
Thanks in advance.
 
void H264VideoStreamDiscreteFramer::doGetNextFrame() {  //**************************non-blocking fashion**************************//while(1){
 
  envforH264->taskScheduler().doEventLoop(HasItemForH264);
   pthread_mutex_lock(&mutexforH264);
 
       if(*HasItemForH264==99)        {                  deliverFrame();                * HasItemForH264=0;        }                        pthread_mutex_unlock(&mutexforH264);  
        
             sleep(1);            }                  
 //if (0 /* the source stops being readable */) { //   handleClosure(this); //  return; // }   }


From: zjuchenjun at hotmail.comTo: live-devel at ns.live555.comDate: Wed, 17 Jan 2007 10:35:24 +0800Subject: Re: [Live-devel] "createNewStreamSource()" member function


Hi ROSS,Thanks for your reply!I had defined "H264VideoStreamDiscreteFramer" to be a subclass of ""H264VideoStreamFramer".And the class "H264VideoStreamDiscreteFramer" included two member function(I read your reply in maillist):void H264VideoStreamDiscreteFramer::doGetNextFrame(),                                 Boolean  H264VideoStreamDiscreteFramer::currentNALUnitEndsAccessUnit().Is it right ? According to your reply, I rewrite my code like this : //************************************************************************************************************************************//FramedSource* H264VideoLiveServerMediaSubsession::createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {  estBitrate = 320; // kbps, estimate ; see my notebook   // Create the video source:H264VideoStreamDiscreteFramer *liveSource     =H264VideoStreamDiscreteFramer::createNew(*env_H264,  NULL, buffers_H264, length_H264, bufferhasitem_H264, mutex_H264);   if (liveSource == NULL)  return NULL;       return  liveSource;  }//***********************************************************************************************************************************// Is it right? 


Date: Tue, 16 Jan 2007 06:13:07 -0800To: live-devel at ns.live555.comFrom: finlayson at live555.comSubject: Re: [Live-devel] "createNewStreamSource()" member function


 return H264VideoStreamFramer::createNew(envir(),liveSource); 

You can't do this, because "H264VideoStreamFramer" is a virtual base class.  Instead, you should define your own class "H263VideoStreamDiscreteFramer" to be a subclass of ""H264VideoStreamFramer".  Then, your "H263VideoStreamDiscreteFramer" object can be the value returned by your implementation of "createNewStreamSource()".-- 

Ross FinlaysonLive Networks, Inc.http://www.live555.com/

率先尝试 Windows Live Mail。 Windows Live Mail 
_________________________________________________________________
Windows Live Safety Center 为您的计算机提供免费的安全扫描服务。
http://safety.live.com/site/ZH-CN/default.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20070117/fb23f9da/attachment.html 


More information about the live-devel mailing list