From Wang Rui, "Attached is a very small fix for the ffmpeg plugin, to build it without compiling errors on MSVC. The ffmpeg win32 pre-built tarball is downloaded at http://ffmpeg.arrozcru.org/builds/. Tested on Windows XP SP3 and Visual Studio 9, but don't know if it still workable for Unix and Mac users. :)
Please look at the .diff files for details. I have already enjoyed the latest Chinese *big* movie "Red Cliff" with the fixed ffmpeg plugin and osgmovie. :D"
This commit is contained in:
parent
1f251b4df5
commit
9727321afe
@ -233,7 +233,7 @@ void FFmpegDecoderVideo::findAspectRatio()
|
||||
m_pixel_aspect_ratio = ratio;
|
||||
}
|
||||
|
||||
int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src,
|
||||
int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, AVPicture *src,
|
||||
int src_pix_fmt, int src_width, int src_height)
|
||||
{
|
||||
osg::Timer_t startTick = osg::Timer::instance()->tick();
|
||||
@ -247,9 +247,9 @@ int FFmpegDecoderVideo::convert(AVPicture *dst, int dst_pix_fmt, const AVPicture
|
||||
|
||||
|
||||
osg::notify(osg::INFO)<<"Using sws_scale ";
|
||||
|
||||
|
||||
int result = sws_scale(m_swscale_ctx,
|
||||
(const uint8_t**)(src->data), (src->linesize), 0, src_height,
|
||||
(src->data), (src->linesize), 0, src_height,
|
||||
(dst->data), (dst->linesize));
|
||||
#else
|
||||
|
||||
@ -276,7 +276,7 @@ void FFmpegDecoderVideo::publishFrame(const double delay)
|
||||
if (delay < -0.010)
|
||||
return;
|
||||
|
||||
const AVPicture * const src = (const AVPicture *) m_frame.get();
|
||||
AVPicture * const src = (AVPicture *) m_frame.get();
|
||||
AVPicture * const dst = (AVPicture *) m_frame_rgba.get();
|
||||
|
||||
// Assign appropriate parts of the buffer to image planes in m_frame_rgba
|
||||
@ -312,7 +312,7 @@ void FFmpegDecoderVideo::publishFrame(const double delay)
|
||||
|
||||
|
||||
|
||||
void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, const AVPicture * const src, int width, int height)
|
||||
void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
|
||||
{
|
||||
convert(dst, PIX_FMT_RGB32, src, m_context->pix_fmt, width, height);
|
||||
|
||||
|
@ -87,9 +87,9 @@ private:
|
||||
void findAspectRatio();
|
||||
void publishFrame(double delay);
|
||||
double synchronizeVideo(double pts);
|
||||
void yuva420pToRgba(AVPicture *dst, const AVPicture *src, int width, int height);
|
||||
void yuva420pToRgba(AVPicture *dst, AVPicture *src, int width, int height);
|
||||
|
||||
int convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src,
|
||||
int convert(AVPicture *dst, int dst_pix_fmt, AVPicture *src,
|
||||
int src_pix_fmt, int src_width, int src_height);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user