From d59c6a3aebc20cc64cb7a46401cb55f02f4cbe09 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Sat, 4 Mar 2017 23:57:40 +0000 Subject: hwcontext: Improve allocation in derived contexts Use the flags argument of av_hwframe_ctx_create_derived() to pass the mapping flags which will be used on allocation. Also, set the format and hardware context on the allocated frame automatically - the user should not be required to do this themselves. (cherry picked from commit c5714b51aad41fef56dddac1d542e7fc6b984627) --- libavutil/hwcontext.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavutil/hwcontext.h') diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h index 37e8831f6b..edf12cc631 100644 --- a/libavutil/hwcontext.h +++ b/libavutil/hwcontext.h @@ -566,7 +566,9 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags); * AVHWFramesContext on. * @param source_frame_ctx A reference to an existing AVHWFramesContext * which will be mapped to the derived context. - * @param flags Currently unused; should be set to zero. + * @param flags Some combination of AV_HWFRAME_MAP_* flags, defining the + * mapping parameters to apply to frames which are allocated + * in the derived device. * @return Zero on success, negative AVERROR code on failure. */ int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx, -- cgit v1.2.3