gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libmedia/ffmpeg/MediaParserFfmp...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libmedia/ffmpeg/MediaParserFfmp...
Date: Mon, 16 Jun 2008 16:06:15 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/06/16 16:06:15

Modified files:
        .              : ChangeLog 
        libmedia/ffmpeg: MediaParserFfmpeg.cpp 

Log message:
        push encoded frames to queue. NetStream-SquareTest.swf shows the ogg 
now.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6943&r2=1.6944
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/MediaParserFfmpeg.cpp?cvsroot=gnash&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6943
retrieving revision 1.6944
diff -u -b -r1.6943 -r1.6944
--- ChangeLog   16 Jun 2008 14:49:01 -0000      1.6943
+++ ChangeLog   16 Jun 2008 16:06:14 -0000      1.6944
@@ -1,3 +1,8 @@
+2008-06-16 Sandro Santilli <address@hidden>
+
+       * libmedia/ffmpeg/MediaParserFfmpeg.cpp: push encoded frames to
+         queue. NetStream-SquareTest.swf shows the ogg now.
+
 2008-06-16 Benjamin Wolsey <address@hidden>
 
        * server/array.cpp: remove direct dependence on VM::get() (it's now

Index: libmedia/ffmpeg/MediaParserFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/MediaParserFfmpeg.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- libmedia/ffmpeg/MediaParserFfmpeg.cpp       16 Jun 2008 14:41:53 -0000      
1.16
+++ libmedia/ffmpeg/MediaParserFfmpeg.cpp       16 Jun 2008 16:06:15 -0000      
1.17
@@ -139,7 +139,7 @@
        //
        boost::uint64_t timestamp = static_cast<boost::uint64_t>(packet.dts * 
as_double(_videoStream->time_base) * 1000.0); 
 
-#if 1
+#if 0
        LOG_ONCE( log_unimpl("%s", __PRETTY_FUNCTION__) );
        return false;
 #else
@@ -147,9 +147,13 @@
        // flags, for keyframe
        //bool isKeyFrame = packet.flags&PKT_FLAG_KEY;
 
-       // TODO: check if we need to copy the packet.data
-       std::auto_ptr<EncodedVideoFrame> frame(new 
EncodedVideoFrame(packet.data, packet.size, 0, timestamp));
-       packet.data = 0;
+       // TODO: FIXME: *2 is an hack to avoid libavcodec reading past end of 
allocated space
+       //       we might do proper padding or (better) avoid the copy as a 
whole by making
+       //       EncodedVideoFrame virtual.
+       size_t allocSize = packet.size*2;
+       boost::uint8_t* data = new boost::uint8_t[allocSize];
+       std::copy(packet.data, packet.data+packet.size, data);
+       std::auto_ptr<EncodedVideoFrame> frame(new EncodedVideoFrame(data, 
packet.size, 0, timestamp));
 
        pushEncodedVideoFrame(frame);
 
@@ -173,13 +177,20 @@
        //
        boost::uint64_t timestamp = static_cast<boost::uint64_t>(packet.dts * 
as_double(_audioStream->time_base) * 1000.0); 
 
-#if 1
+#if 0
        LOG_ONCE( log_unimpl("%s", __PRETTY_FUNCTION__) );
        return false;
 #else
        std::auto_ptr<EncodedAudioFrame> frame ( new EncodedAudioFrame );
 
-       frame->data.reset(packet.data); // TODO: check if we need to copy this
+       // TODO: FIXME: *2 is an hack to avoid libavcodec reading past end of 
allocated space
+       //       we might do proper padding or (better) avoid the copy as a 
whole by making
+       //       EncodedVideoFrame virtual.
+       size_t allocSize = packet.size*2;
+       boost::uint8_t* data = new boost::uint8_t[allocSize];
+       std::copy(packet.data, packet.data+packet.size, data);
+
+       frame->data.reset(data); 
        frame->dataSize = packet.size;
        frame->timestamp = timestamp;
 
@@ -211,9 +222,9 @@
 
        AVPacket packet;
 
-       log_debug("av_read_frame call");
+       //log_debug("av_read_frame call");
        int rc = av_read_frame(_formatCtx, &packet);
-       log_debug("av_read_frame returned %d", rc);
+       //log_debug("av_read_frame returned %d", rc);
        if ( rc < 0 )
        {
                log_error(_("MediaParserFfmpeg::parseNextChunk: Problems 
parsing next frame"));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]