This "reuses" the flags introduced for the av_vdpau_bind_context() API function, and makes them available to all hwaccels. This does not affect the current vdpau API, as av_vdpau_bind_context() should obviously override the AVCodecContext.hwaccel_flags flags for the sake of compatibility. --- doc/APIchanges | 4 ++++ libavcodec/avcodec.h | 9 +++++++++ libavcodec/pthread_frame.c | 2 ++ 3 files changed, 15 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges index c161618d92..067b6ad75f 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,10 @@ libavutil: 2015-08-28 API changes, most recent first: +2017-02-xx - xxxxxxx - lavc - avcodec.h + Add AVCodecContext.hwaccel_flags field. This will control some hwaccels at + a later point. + 2017-02-01 - xxxxxxx - lavc - avcodec.h Deprecate AVCodecContext.refcounted_frames. This was useful for deprecated API only (avcodec_decode_video2/avcodec_decode_audio4). The new decode APIs diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index b7bf85a041..aa19dcb679 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3162,6 +3162,15 @@ typedef struct AVCodecContext { * contexts used must be created on the same device. */ AVBufferRef *hw_device_ctx; + + /** + * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated + * decoding (if active). + * - encoding: unused + * - decoding: Set by user (either before avcodec_open2(), or in the + * AVCodecContext.get_format callback) + */ + int hwaccel_flags; } AVCodecContext; /** diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index f3a74c0bd8..65a04d8e90 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -270,6 +270,8 @@ FF_ENABLE_DEPRECATION_WARNINGS return AVERROR(ENOMEM); } } + + dst->hwaccel_flags = src->hwaccel_flags; } if (for_user) { -- 2.11.0 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel