]> git.sesse.net Git - ffmpeg/commitdiff
lavc: Add hwaccel_flags field to AVCodecContext
authorwm4 <nfxjfg@googlemail.com>
Sat, 4 Mar 2017 23:57:32 +0000 (23:57 +0000)
committerwm4 <nfxjfg@googlemail.com>
Thu, 23 Mar 2017 08:34:21 +0000 (09:34 +0100)
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.

Cherry-picked from Libav commit 16a163b5.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
doc/APIchanges
libavcodec/avcodec.h
libavcodec/pthread_frame.c
libavcodec/version.h

index eccfb708995c586d757283be776c608649f82fb5..a2dc60167d974ad4130e55126899d65f110f206c 100644 (file)
@@ -15,6 +15,10 @@ libavutil:     2015-08-28
 
 API changes, most recent first:
 
+2017-03-xx - xxxxxxx - lavc 57.85.100 - avcodec.h
+  Add AVCodecContext.hwaccel_flags field. This will control some hwaccels at
+  a later point.
+
 2017-03-21 - xxxxxxx - lavf 57.67.100 / 57.08.0 - avio.h
   Add AVIO_SEEKABLE_TIME flag.
 
index 3e3c37278a45f3268158874361df12883d45581a..b3479a72235f86ef807694231d130c07d80ca774 100644 (file)
@@ -3620,6 +3620,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;
 
 AVRational av_codec_get_pkt_timebase         (const AVCodecContext *avctx);
index a52160145e5934a5196315e29f81bfde1c6d462b..6768402ed887f13cc509501ca4cf7fcf17114e82 100644 (file)
@@ -275,6 +275,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     return AVERROR(ENOMEM);
             }
         }
+
+        dst->hwaccel_flags = src->hwaccel_flags;
     }
 
     if (for_user) {
index 8d9dda76753fa2cbed9b2838e7bc98bea4dc18ba..32746d0f8fd7611aaa22d113da6b510800326f37 100644 (file)
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR  83
-#define LIBAVCODEC_VERSION_MICRO 102
+#define LIBAVCODEC_VERSION_MINOR  85
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \