diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-07-14 19:13:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-17 01:15:31 +0200 |
commit | a80e622924c89df69fb1c225ba432fe12fe6648e (patch) | |
tree | d2d8f5a4cc4792bc0f6bb8dfd772091a5ed7a192 /libavcodec/utils.c | |
parent | 0092bcdf06f240deed890c0d29a95b86f82fe2ee (diff) | |
download | ffmpeg-a80e622924c89df69fb1c225ba432fe12fe6648e.tar.gz |
avcodec/avutil: Add AVColorSpace and AVColorRange to AVFrames
This also moves AVColorSpace and AVColorRange from avcodec to avutil
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d77b5ec661..ff26c5810c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -643,6 +643,10 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) frame->format = avctx->pix_fmt; if (!frame->sample_aspect_ratio.num) frame->sample_aspect_ratio = avctx->sample_aspect_ratio; + if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED) + av_frame_set_colorspace(frame, avctx->colorspace); + if (av_frame_get_color_range(frame) == AVCOL_RANGE_UNSPECIFIED) + av_frame_set_color_range(frame, avctx->color_range); break; case AVMEDIA_TYPE_AUDIO: if (!frame->sample_rate) @@ -964,6 +968,7 @@ void avcodec_get_frame_defaults(AVFrame *frame) frame->sample_aspect_ratio = (AVRational) {0, 1 }; frame->format = -1; /* unknown */ frame->extended_data = frame->data; + av_frame_set_colorspace(frame, AVCOL_SPC_UNSPECIFIED); } AVFrame *avcodec_alloc_frame(void) |