From: wm4 <[email protected]>
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 a919ffb2b..3bf392465 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-xx-xx - xxxxxxx - lavc 57.34.0 - avcodec.h
Add AVCodecContext.hw_device_ctx.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 489a618cb..da4eb4081 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3163,6 +3163,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 f3a74c0bd..65a04d8e9 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
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel