Module: libav
Branch: master
Commit: 16a163b55a6558ed05702b91cc0777987295ef21

Author:    wm4 <[email protected]>
Committer: Mark Thompson <[email protected]>
Date:      Sat Mar  4 23:57:32 2017 +0000

lavc: Add hwaccel_flags field to AVCodecContext

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 ++
 libavcodec/version.h       | 2 +-
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 70b3391..c6a5d82 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil:     2015-08-28
 
 API changes, most recent first:
 
+2017-03-xx - xxxxxxx - lavc 57.37.0 - avcodec.h
+  Add AVCodecContext.hwaccel_flags field. This will control some hwaccels at
+  a later point.
+
 2017-03-xx - xxxxxxx - lavu 55.35.0 - hwcontext.h
   Add AV_HWDEVICE_TYPE_NONE, av_hwdevice_find_type_by_name(),
   av_hwdevice_get_type_name() and av_hwdevice_iterate_types().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 62a4fab..1e2b13e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3186,6 +3186,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 f3a74c0..65a04d8 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) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 443cc82..349b2e9 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 36
+#define LIBAVCODEC_VERSION_MINOR 37
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to