]> git.sesse.net Git - vlc/commitdiff
handle h261 video streams over rtp
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Thu, 15 Apr 2004 22:22:55 +0000 (22:22 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Thu, 15 Apr 2004 22:22:55 +0000 (22:22 +0000)
modules/demux/livedotcom.cpp

index eb383a14a88efc75fde431bce9ad4648db7bb913..4a8584c1ab4cbffddaef975a0699e8409e73fa3f 100644 (file)
@@ -936,14 +936,32 @@ static void StreamRead( void *p_private, unsigned int i_size, struct timeval pts
              i_size,
              pts.tv_sec * 1000000LL + pts.tv_usec );
 #endif
+    if( tk->fmt.i_codec == VLC_FOURCC('h','2','6','1') )
+    {
+        i_size += 4;        
+    }
+    
     if( i_size > 65536 )
     {
         msg_Warn( p_demux, "buffer overflow" );
     }
     /* FIXME could i_size be > buffer size ? */
     p_block = block_New( p_demux, i_size );
-
-    memcpy( p_block->p_buffer, tk->buffer, i_size );
+    if( tk->fmt.i_codec == VLC_FOURCC('h','2','6','1') )
+    {
+        H261VideoRTPSource *h261Source = (H261VideoRTPSource*)tk->rtpSource;
+        uint32_t header = h261Source->lastSpecialHeader();
+        memcpy( p_block->p_buffer, &header, 4 );
+        memcpy( p_block->p_buffer + 4, tk->buffer, i_size );        
+    }
+    else
+    {
+        memcpy( p_block->p_buffer, tk->buffer, i_size );
+    }
+    if( tk->rtpSource->curPacketMarkerBit() )
+    {        
+        p_block->i_flags |= BLOCK_FLAG_HEADER;
+    }
     //p_block->i_rate = p_input->stream.control.i_rate;
 
     if( i_pts != tk->i_pts && !tk->b_muxed )