[Sumover-dev] [svn commit] r4408 - vic/branches/mpeg4/codec

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu Apr 9 10:35:46 BST 2009


Author: piers
Date: Thu Apr  9 10:35:44 2009
New Revision: 4408

Modified:
   vic/branches/mpeg4/codec/ffmpeg_codec.cpp
   vic/branches/mpeg4/codec/packetbuffer.cpp
   vic/branches/mpeg4/codec/packetbuffer.h

Log:
Added a method to extract a packet from packet buffer - mostly just used for testing.
Also added some commented code (which doesn't work) to ffmpeg_codec which could allow access to H264 SPS fields but the ffmpeg header files seem to make it virtually impossible to include them - they're designed for internal use only. The advantage of accessing this field in the SPS would be that we wouldn't need to patch ffmpeg for IOCOM interoperability. Thought I'd put it there just in case we come up with a neat way around it.


Modified: vic/branches/mpeg4/codec/ffmpeg_codec.cpp
==============================================================================
--- vic/branches/mpeg4/codec/ffmpeg_codec.cpp	(original)
+++ vic/branches/mpeg4/codec/ffmpeg_codec.cpp	Thu Apr  9 10:35:44 2009
@@ -6,6 +6,10 @@
 #include <math.h>
 #include "debug.h"
 #include "ffmpeg_codec.h"
+/*#include "dsputil.h"
+#include "avcodec.h"
+#include "mpegvideo.h"
+#include "h264.h"*/
 
 #ifndef _UNISTD_H
 extern "C" int getpid();
@@ -237,6 +241,10 @@
 		return -1;
     }
     
+    if (state) {
+      //H264Context *h = c->priv_data;
+      //printf("h->sps.ref_frame_count: %d",h->sps.ref_frame_count);
+    }
 	if (c->width != width || c->height != height) {
 		debug_msg("ffmpegcodec: resize from %dx%d (framesize:%d) to %dx%d, (size: %d) got_picture: %d, len: %d\n", width, height, 
 			frame_size, c->width, c->height, size, got_picture, len);

Modified: vic/branches/mpeg4/codec/packetbuffer.cpp
==============================================================================
--- vic/branches/mpeg4/codec/packetbuffer.cpp	(original)
+++ vic/branches/mpeg4/codec/packetbuffer.cpp	Thu Apr  9 10:35:44 2009
@@ -73,6 +73,15 @@
 }
 
 //return bitstream , corrupted packets will be ignored
+char *PacketBuffer::getPacket(int n)
+{
+  if (isDataRecv[n]) 
+    return packets[n]->getData();
+  else
+    debug_msg("packet %d\n", n);	
+    
+}
+
 DataBuffer *PacketBuffer::getStream()
 {
     if (totalPkts == 0)

Modified: vic/branches/mpeg4/codec/packetbuffer.h
==============================================================================
--- vic/branches/mpeg4/codec/packetbuffer.h	(original)
+++ vic/branches/mpeg4/codec/packetbuffer.h	Thu Apr  9 10:35:44 2009
@@ -19,6 +19,7 @@
     int getTotalPkts();
     bool isComplete();
     DataBuffer *getStream();
+    char *getPacket(int);
     void clear();
     DataBuffer *packets[MAX_PACKETS];
   private:



More information about the Sumover-dev mailing list