[Top][All Lists]
[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:04:06 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/05/21 17:04:06
Modified files:
. : ChangeLog
libmedia/ffmpeg: ffmpegNetStreamUtil.h
server/asobj : NetStreamFfmpeg.cpp
Log message:
* libmedia/ffmpeg/ffmpegNetStreamUtil.h,
server/asobj/NetStreamFfmpeg.cpp:
Sorry, reverted previous patch, it consumed
more frames from "the buffer" then required
(really consumes only based timestamp)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6670&r2=1.6671
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/ffmpeg/ffmpegNetStreamUtil.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.129&r2=1.130
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6670
retrieving revision 1.6671
diff -u -b -r1.6670 -r1.6671
--- ChangeLog 21 May 2008 17:00:22 -0000 1.6670
+++ ChangeLog 21 May 2008 17:04:05 -0000 1.6671
@@ -2,6 +2,14 @@
* libmedia/ffmpeg/ffmpegNetStreamUtil.h,
server/asobj/NetStreamFfmpeg.cpp:
+ Sorry, reverted previous patch, it consumed
+ more frames from "the buffer" then required
+ (really consumes only based timestamp)
+
+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.
Index: libmedia/ffmpeg/ffmpegNetStreamUtil.h
===================================================================
RCS file: /sources/gnash/gnash/libmedia/ffmpeg/ffmpegNetStreamUtil.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libmedia/ffmpeg/ffmpegNetStreamUtil.h 21 May 2008 17:00:24 -0000
1.7
+++ libmedia/ffmpeg/ffmpegNetStreamUtil.h 21 May 2008 17:04:06 -0000
1.8
@@ -149,7 +149,6 @@
/// 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()
{
@@ -157,17 +156,14 @@
return _queue.front();
}
- /// Pops the first element from the queue, transferring ownership to
caller
+ /// Pops the first element from the queue.
//
/// If no elements are available this function is
/// a noop.
///
- T pop()
+ void pop()
{
- if ( _queue.empty() ) return 0;
- T ret = _queue.front();
- _queue.pop_front();
- return ret;
+ if ( ! _queue.empty() ) _queue.pop_front();
}
private:
Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -b -r1.129 -r1.130
--- server/asobj/NetStreamFfmpeg.cpp 21 May 2008 17:00:24 -0000 1.129
+++ server/asobj/NetStreamFfmpeg.cpp 21 May 2008 17:04:06 -0000 1.130
@@ -765,7 +765,7 @@
log_debug("qMutex: lock obtained in audio_streamer");
#endif
- std::auto_ptr<media::raw_mediadata_t> samples (
ns->m_qaudio.pop() );
+ media::raw_mediadata_t* samples = ns->m_qaudio.front();
int n = std::min<int>(samples->m_size, len);
memcpy(stream, samples->m_ptr, n);
@@ -778,6 +778,9 @@
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();
}
@@ -1264,11 +1267,11 @@
{
// Get video frame from queue, will have the lowest timestamp
// will return NULL if empty(). See multithread_queue::front
- std::auto_ptr<media::raw_mediadata_t> video ( m_qvideo.pop() );
+ media::raw_mediadata_t* video = m_qvideo.front();
// If the queue is empty either we're waiting for more data
// to be decoded or we're out of data
- if (!video.get())
+ if (!video)
{
log_debug("refreshVideoFrame:: No more video frames in
queue");
@@ -1322,9 +1325,13 @@
{
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.get(),
m_VCodecCtx->width * 3);
+ rgbcopy(imgframe, video, 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();