From patchwork Tue May 1 19:39:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [FFmpeg-devel, 02/24] avfilter/avfilter: add color_range to AVFilterLink struct From: Paul B Mahol X-Patchwork-Id: 8718 Message-Id: <20180501194013.9552-2-onemda@gmail.com> To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 May 2018 21:39:51 +0200 Signed-off-by: Paul B Mahol --- libavfilter/avfilter.c | 2 ++ libavfilter/avfilter.h | 2 ++ libavfilter/video.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index ed8161136c..3f0dc14d01 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -338,6 +338,8 @@ int avfilter_config_links(AVFilterContext *filter) link->w = inlink->w; if (!link->h) link->h = inlink->h; + if (!link->color_range) + link->color_range = inlink->color_range; } else if (!link->w || !link->h) { av_log(link->src, AV_LOG_ERROR, "Video source filters must set their output link's " diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 9d70e7118b..11cd586bae 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -600,6 +600,8 @@ struct AVFilterLink { */ AVBufferRef *hw_frames_ctx; + enum AVColorRange color_range; ///< color range type, video only + #ifndef FF_INTERNAL_FIELDS /** diff --git a/libavfilter/video.c b/libavfilter/video.c index 7a8e587798..64d8c3b3aa 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -90,8 +90,8 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) frame = ff_frame_pool_get(link->frame_pool); if (!frame) return NULL; - frame->sample_aspect_ratio = link->sample_aspect_ratio; + frame->color_range = link->color_range; return frame; }