[Live-devel] Patch for MultiFramedRTPSink.cpp

Eric Peters epeters at graphics.cs.uni-sb.de
Thu Nov 4 11:51:23 PST 2004


Hallo Ross,

we tried to stream live tv program from a ivtv card with mpeg2 encoder
chip. We tried this scenario with linux. There you can access the tvcard
directly over /dev/video0. In MultiFramedRTPSink the start value for
fNextSendTime is set in the constructor. Then the first image is requested.

We have the same results by using a dvbcard as tv source.

For initiliazing the tvcard and sending the image there is a duration of
0.5 seconds. So, many frames has been dropped and the result on the
receiver side was very awful. I tried to set the start value for
fNextSendTime when the first image was received and the result on the
receiver side was perfect.

I created a patch for the MultiFramedRTPSink where the value for
fSendNextTime is set in afterGettingFrame1 when the first frame from the
tv card is received.

It would be very kind of you to apply this patch, so we can stream from
live tv sources.

Eric

-------------- next part --------------
--- MultiFramedRTPSink.cpp	Tue Nov  2 11:25:40 2004
+++ ../../live_02_11/liveMedia/MultiFramedRTPSink.cpp	Wed Nov  3 15:54:49 2004
@@ -110,9 +110,6 @@
 #endif
 
 Boolean MultiFramedRTPSink::continuePlaying() {
-  // Record the fact that we're starting to play now:
-  gettimeofday(&fNextSendTime, &Idunno);
-
   // Send the first packet.
   // (This will also schedule any future sends.)
   buildAndSendPacket(True);
@@ -190,6 +187,10 @@
 ::afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes,
 		     struct timeval presentationTime,
 		     unsigned durationInMicroseconds) {
+  if (fIsFirstPacket) {
+    // Record the fact that we're starting to play now:
+    gettimeofday(&fNextSendTime, &Idunno);
+  }
   if (numTruncatedBytes > 0) {
     unsigned const bufferSize = fOutBuf->totalBytesAvailable();
     unsigned newNumPacketsLimit



More information about the live-devel mailing list