[FFmpeg-devel,1/3] lavc/vaapi_encode: Add max slices number query.

Submitted by Jun Zhao on July 30, 2018, 11:42 a.m.

Details

Message ID 1532950960-7640-2-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao July 30, 2018, 11:42 a.m.
From: Jun Zhao <jun.zhao@intel.com>

Add max slices number query.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
---
 libavcodec/vaapi_encode.c |    4 ++++
 libavcodec/vaapi_encode.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 910fd1b..53d6424 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -971,6 +971,7 @@  static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
         { VAConfigAttribRTFormat         },
         { VAConfigAttribRateControl      },
         { VAConfigAttribEncMaxRefFrames  },
+        { VAConfigAttribEncMaxSlices     },
         { VAConfigAttribEncPackedHeaders },
     };
 
@@ -1103,6 +1104,9 @@  static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
             }
         }
         break;
+        case VAConfigAttribEncMaxSlices:
+            ctx->max_slices = attr[i].value;
+            break;
         case VAConfigAttribEncPackedHeaders:
             if (ctx->va_packed_headers & ~attr[i].value) {
                 // This isn't fatal, but packed headers are always
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index bcb9d57..6fcc83d 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -164,6 +164,10 @@  typedef struct VAAPIEncodeContext {
     } quality_params;
 #endif
 
+    // Supported max-slices number per frame. (0 means driver cannot
+    // support max multi-slices query)
+    int             max_slices;
+
     // Per-sequence parameter structure (VAEncSequenceParameterBuffer*).
     void           *codec_sequence_params;