[Live-devel] Re: Re: newbie problem delivering frames to parser

xavier nikoxan at mixmail.com
Sat Jul 17 02:37:45 PDT 2004


Thank you Ross for your help.

I've updated the library to the latest version and now use the
"testMPEG1or2AudioVideoStreamer" as a base code. Also made some changes on my code trying
to correct my errors:

static struct timezone quin;
static AVFrame *picture;
static int size;//en bytes

void RPVRFramedSource::doGetNextFrame() {
fFrameSize = size;
   if (fFrameSize > fMaxSize) 
   {
	fNumTruncatedBytes = fFrameSize - fMaxSize;
	fFrameSize = fMaxSize;
   }
   memmove(fTo, picture->data[0], fFrameSize);

    gettimeofday(&fPresentationTime, &quin);
  
   nextTask()
    = envir().taskScheduler().scheduleDelayedTask(0, (TaskFunc*)afterGetting,
						  this);
}

this is the modified play() method of the main code (I've left the rest untouched).

RTPSink* videoSink;
FramedSource* videoSource;
RTPSink* videoSink;

void  play() { 
 RPVRFramedSource* videoES=RPVRFramedSource::createNew(*env);

  // Create a framer for the Elementary Stream:
   
   videoSource
    = MPEG1or2VideoStreamFramer::createNew(*env, videoES, iFramesOnly); 

  // Finally, start playing the sink.
  *env << "Beginning to read ...\n";
  videoSink->startPlaying(*videoES, afterPlaying, videoSink);
   }
 then, in the main loop:

sms->addSubsession(PassiveServerMediaSubsession::createNew(*videoSink, videoRTCP));
  rtspServer->addServerMediaSession(sms);


and now the StreamParser does not complain at all. Although vlc now receives the sdp
descriptor with the correct rtp session parameters (before following ross's advice, it
wouldn't even communicate with the server), its decoder outputs a TaskInterrupt all the
time. I don't know if my server is not streaming the rtp session at all or if the
information from my AVFrame gets messed up in the parsing process. Maybe the
fPresentationTime that I acquire from the system lead to an error?

Thank you in advance for your information, it is helping me so much
		Xavier
---------------------------------------------------------
Este verano... ¡Aprovecha para enamorarte! Con el 2x1 de Muchagente http://www.muchagente.com
Ya.com ADSL Router Wi-Fi: Sólo 29,90 €/mes + IVA*. Router + Antivirus y firewall ¡Gratis! http://acceso.ya.com/adsl/256router



More information about the live-devel mailing list