gnash-commit
[Top][All Lists]
Advanced

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

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


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libmedia/ffmpeg/ffmpegNetStream...
Date: Wed, 21 May 2008 17:00:25 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/21 17:00:24

Modified files:
        .              : ChangeLog 
        libmedia/ffmpeg: ffmpegNetStreamUtil.h 
        server/asobj   : NetStreamFfmpeg.cpp 

Log message:
                * libmedia/ffmpeg/ffmpegNetStreamUtil.h,
                  server/asobj/NetStreamFfmpeg.cpp:
                  Change ElementsOwningQueue::pop to return
                  the element and transfer ownership. Make
                  things clearer to me.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6669&r2=1.6670
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/ffmpegNetStreamUtil.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.128&r2=1.129

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6669
retrieving revision 1.6670
diff -u -b -r1.6669 -r1.6670
--- ChangeLog   21 May 2008 16:48:14 -0000      1.6669
+++ ChangeLog   21 May 2008 17:00:22 -0000      1.6670
@@ -1,5 +1,13 @@
 2008-05-21 Sandro Santilli <address@hidden>
 
+       * libmedia/ffmpeg/ffmpegNetStreamUtil.h,
+         server/asobj/NetStreamFfmpeg.cpp:
+         Change ElementsOwningQueue::pop to return 
+         the element and transfer ownership. Make 
+         things clearer to me.
+
+2008-05-21 Sandro Santilli <address@hidden>
+
        * server/asobj/NetStream.{cpp,h}: drop m_pause and m_go.
        * server/asobj/NetStreamFfmpeg.{cpp,h}: drop m_pause and m_go,
          use separate variables for playback and decoding status.

Index: libmedia/ffmpeg/ffmpegNetStreamUtil.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/ffmpegNetStreamUtil.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- libmedia/ffmpeg/ffmpegNetStreamUtil.h       12 May 2008 11:16:14 -0000      
1.6
+++ libmedia/ffmpeg/ffmpegNetStreamUtil.h       21 May 2008 17:00:24 -0000      
1.7
@@ -149,6 +149,7 @@
        /// If no elements are available this function returns NULL.
        ///
        /// @return a pointer to the first element on the queue, NULL if queue 
is empty.
+       ///         Ownership is retained by this class. See pop()
        ///
        T front()
        {
@@ -156,14 +157,17 @@
                return _queue.front();
        }
 
-       /// Pops the first element from the queue. 
+       /// Pops the first element from the queue, transferring ownership to 
caller
        //
        /// If no elements are available this function is
        /// a noop. 
        ///
-       void pop()
+       T pop()
        {
-               if ( ! _queue.empty() ) _queue.pop_front();
+               if ( _queue.empty() ) return 0;
+               T ret = _queue.front();
+               _queue.pop_front();
+               return ret;
        }
 
 private:

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- server/asobj/NetStreamFfmpeg.cpp    21 May 2008 16:48:15 -0000      1.128
+++ server/asobj/NetStreamFfmpeg.cpp    21 May 2008 17:00:24 -0000      1.129
@@ -765,7 +765,7 @@
                log_debug("qMutex: lock obtained in audio_streamer");
 #endif
 
-               media::raw_mediadata_t* samples = ns->m_qaudio.front();
+               std::auto_ptr<media::raw_mediadata_t> samples ( 
ns->m_qaudio.pop() );
 
                int n = std::min<int>(samples->m_size, len);
                memcpy(stream, samples->m_ptr, n);
@@ -778,9 +778,6 @@
 
                if (samples->m_size == 0)
                {
-                       ns->m_qaudio.pop();
-                       delete samples;
-
                        // wake up filler (TODO: do only if decoder is running)
                        ns->_qFillerResume.notify_all();
                }
@@ -1267,11 +1264,11 @@
        {
                // Get video frame from queue, will have the lowest timestamp
                // will return NULL if empty(). See multithread_queue::front
-               media::raw_mediadata_t* video = m_qvideo.front();
+               std::auto_ptr<media::raw_mediadata_t> video ( m_qvideo.pop() );
 
                // If the queue is empty either we're waiting for more data
                // to be decoded or we're out of data
-               if (!video)
+               if (!video.get())
                {
                        log_debug("refreshVideoFrame:: No more video frames in 
queue");
 
@@ -1325,13 +1322,9 @@
                        {
                                if ( ! m_imageframe ) m_imageframe  = new 
image::rgb(m_VCodecCtx->width, m_VCodecCtx->height);
                                image::rgb* imgframe = 
static_cast<image::rgb*>(m_imageframe);
-                               rgbcopy(imgframe, video, m_VCodecCtx->width * 
3);
+                               rgbcopy(imgframe, video.get(), 
m_VCodecCtx->width * 3);
                        }
 
-                       // Delete the frame from the queue
-                       m_qvideo.pop();
-                       delete video;
-
                        // wake up filler (TODO: do only if decoder is running)
                        // TODO2: resume only at end of loop ?
                        _qFillerResume.notify_all();




reply via email to

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