From 6fd4cd493324d09d537791013b5d7b26f0dfe1b7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 4 Mar 2009 16:03:28 +0000 Subject: [PATCH] Removed boost reference and cleaned up debug output --- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp | 1 - src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp | 22 ++++---------------- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp | 2 -- src/osgPlugins/ffmpeg/FFmpegImageStream.cpp | 8 +++++++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp index 0ea87e5e3..3a4c9ba73 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp @@ -41,7 +41,6 @@ public: private: - //typedef boost::shared_ptr FramePtr; typedef osg::ref_ptr SinkPtr; typedef std::vector Buffer; diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp index 4daca11de..2f5af7c8b 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp @@ -32,6 +32,8 @@ FFmpegDecoderVideo::FFmpegDecoderVideo(PacketQueue & packets, FFmpegClocks & clo FFmpegDecoderVideo::~FFmpegDecoderVideo() { + osg::notify(osg::NOTICE)<<"Destructing FFmpegDecoderVideo..."<tick(); - // Assign appropriate parts of the buffer to image planes in m_frame_rgba avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB32, width(), height()); @@ -272,14 +274,6 @@ void FFmpegDecoderVideo::publishFrame(const double delay) else convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width(), height()); - - // Flip and swap buffer - // swapBuffers(); - - - osg::Timer_t endTick = osg::Timer::instance()->tick(); - osg::notify(osg::NOTICE)<<" time of swapBuffers = "<delta_m(startTick,endTick)<<"ms"<(delay * 1000000 + 0.5); @@ -303,14 +297,6 @@ void FFmpegDecoderVideo::publishFrame(const double delay) -void FFmpegDecoderVideo::swapBuffers() -{ - for (int h = 0; h < height(); ++h) - memcpy(&(m_buffer_rgba[1-m_writeBuffer])[(height() - h - 1) * width() * 4], &(m_buffer_rgba[m_writeBuffer])[h * width() * 4], width() * 4); -} - - - void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, const AVPicture * const src, int width, int height) { convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width, height); diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp index 14a3d2c2d..98f6b6988 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp @@ -8,7 +8,6 @@ #include "FFmpegClocks.hpp" #include "FFmpegPacket.hpp" -#include #include #include @@ -85,7 +84,6 @@ private: void decodeLoop(); void findAspectRatio(); void publishFrame(double delay); - void swapBuffers(); double synchronizeVideo(double pts); void yuva420pToRgba(AVPicture *dst, const AVPicture *src, int width, int height); diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp index ca1d4977c..a326865bf 100644 --- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp @@ -39,9 +39,17 @@ FFmpegImageStream::FFmpegImageStream(const FFmpegImageStream & image, const osg: FFmpegImageStream::~FFmpegImageStream() { + osg::notify(osg::NOTICE)<<"Destructing FFMpegImageStream..."<