From 59ec4d2f76edbea5cb7f8baf66e728a6fe6408ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 7 Jan 2010 01:14:20 +0000 Subject: [PATCH] * Disabled tracing. * Use the configured source color space when converting instead of hardcoding B_RGB32. (Resolved TODO) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34929 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp index 6a8024fa2b..eed5c06781 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp @@ -15,9 +15,11 @@ extern "C" { #include "rational.h" } +#include "gfx_util.h" + #undef TRACE -#define TRACE_AV_CODEC_ENCODER +//#define TRACE_AV_CODEC_ENCODER #ifdef TRACE_AV_CODEC_ENCODER # define TRACE printf # define TRACE_IO(a...) @@ -309,10 +311,10 @@ AVCodecEncoder::_Setup() fFrame->linesize[2] = fDstFrame.linesize[2]; fFrame->linesize[3] = fDstFrame.linesize[3]; - // TODO: Use actual pixel format from media_format! fSwsContext = sws_getContext(fContext->width, fContext->height, - PIX_FMT_RGB32, fContext->width, fContext->height, - fContext->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); + colorspace_to_pixfmt(fInputFormat.u.raw_video.display.format), + fContext->width, fContext->height, + fContext->pix_fmt, SWS_FAST_BILINEAR, NULL, NULL, NULL); } else if (fInputFormat.type == B_MEDIA_RAW_AUDIO) { TRACE(" B_MEDIA_RAW_AUDIO\n");