[FFmpeg-cvslog] avcodec: Add flag for experimental HWAccels and use it for VDPAU/HEVC

Philip Langdale git at videolan.org
Sat Jun 27 04:08:08 CEST 2015


ffmpeg | branch: master | Philip Langdale <philipl at overt.org> | Fri Jun 26 08:43:41 2015 -0700| [b69bea3ab8f83b4cac7091d648d27c3be3efbc28] | committer: Philip Langdale

avcodec: Add flag for experimental HWAccels and use it for VDPAU/HEVC

This HWAccel isn't really usable right now due to an nvidia driver bug,
so we don't want it selected by default.

HWAccels have a capabilities field and there's a comment about flags,
but no flags exist today, so let's add one for experimental hwaccels.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b69bea3ab8f83b4cac7091d648d27c3be3efbc28
---

 libavcodec/avcodec.h    |    8 +++++++-
 libavcodec/utils.c      |    7 +++++++
 libavcodec/vdpau_hevc.c |    1 +
 libavcodec/version.h    |    2 +-
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 761d3c1..ddbf0a3 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -894,6 +894,12 @@ typedef struct RcOverride{
  */
 #define CODEC_CAP_LOSSLESS         0x80000000
 
+/**
+ * HWAccel is experimental and is thus avoided in favor of non experimental
+ * codecs
+ */
+#define HWACCEL_CODEC_CAP_EXPERIMENTAL     0x0200
+
 #if FF_API_MB_TYPE
 //The following defines may change, don't expect compatibility if you use them.
 #define MB_TYPE_INTRA4x4   0x0001
@@ -3336,7 +3342,7 @@ typedef struct AVHWAccel {
 
     /**
      * Hardware accelerated codec capabilities.
-     * see FF_HWACCEL_CODEC_CAP_*
+     * see HWACCEL_CODEC_CAP_*
      */
     int capabilities;
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 7696582..40ea544 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1176,6 +1176,13 @@ static int setup_hwaccel(AVCodecContext *avctx,
         return AVERROR(ENOENT);
     }
 
+    if (hwa->capabilities & HWACCEL_CODEC_CAP_EXPERIMENTAL &&
+        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
+        av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n",
+               hwa->name);
+        return AVERROR(ENOTSUP);
+    }
+
     if (hwa->priv_data_size) {
         avctx->internal->hwaccel_priv_data = av_mallocz(hwa->priv_data_size);
         if (!avctx->internal->hwaccel_priv_data)
diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c
index ccf6764..0987b63 100644
--- a/libavcodec/vdpau_hevc.c
+++ b/libavcodec/vdpau_hevc.c
@@ -427,6 +427,7 @@ AVHWAccel ff_hevc_vdpau_hwaccel = {
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_HEVC,
     .pix_fmt        = AV_PIX_FMT_VDPAU,
+    .capabilities   = HWACCEL_CODEC_CAP_EXPERIMENTAL,
     .start_frame    = vdpau_hevc_start_frame,
     .end_frame      = vdpau_hevc_end_frame,
     .decode_slice   = vdpau_hevc_decode_slice,
diff --git a/libavcodec/version.h b/libavcodec/version.h
index eff8820..6e95c86 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 56
 #define LIBAVCODEC_VERSION_MINOR  45
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list