[PATCH] Move colorspace setting details from sws_getContext() to sws_init_context().
Stefano Sabatini
stefano.sabatini-lala
Thu Sep 30 00:42:54 CEST 2010
This is useful for simplifying the use of the sws_init_context() API,
as the default settings are thus done by sws_init_context().
The user can override the colorspace settings in each moment by
re-invoking sws_setColorspaceDetails(), *after* the context has been
already inited with sws_init_context().
---
utils.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/utils.c b/utils.c
index 83883b7..7d483f5 100644
--- a/utils.c
+++ b/utils.c
@@ -766,6 +766,8 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
enum PixelFormat srcFormat= c->srcFormat;
enum PixelFormat dstFormat= c->dstFormat;
+ sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, c->dstRange, 0, 1<<16, 1<<16);
+
flags= c->flags = update_flags_cpu(c->flags);
#if ARCH_X86
if (flags & SWS_CPU_CAPS_MMX)
@@ -1157,7 +1159,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
c->param[0] = param[0];
c->param[1] = param[1];
}
- sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, c->dstRange, 0, 1<<16, 1<<16);
if(sws_init_context(c, srcFilter, dstFilter) < 0){
sws_freeContext(c);
--
1.7.1
--k1lZvvs/B4yU6o8G--
More information about the ffmpeg-devel
mailing list