[FFmpeg-devel] [PATCH V2 2/4] lavc/vaapi_encode: Add max slices number query.

Jun Zhao mypopydev at gmail.com
Wed Aug 2 08:55:04 EEST 2017


From 2a0bd4795fcf7d889c3c93b03e8698015a519260 Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao at intel.com>
Date: Tue, 1 Aug 2017 04:16:30 -0400
Subject: [PATCH V2 2/4] lavc/vaapi_encode: Add max slices number query.

Add max slices number query.

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

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 11d9803b5d..9fc70bdd55 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -972,6 +972,7 @@ static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
         { VAConfigAttribRTFormat         },
         { VAConfigAttribRateControl      },
         { VAConfigAttribEncMaxRefFrames  },
+        { VAConfigAttribEncMaxSlices     },
         { VAConfigAttribEncPackedHeaders },
     };
 
@@ -1102,6 +1103,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 b542772aed..fd55aa6cdc 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -103,6 +103,9 @@ typedef struct VAAPIEncodeContext {
     // Supported packed headers (initially the desired set, modified
     // later to what is actually supported).
     unsigned int    va_packed_headers;
+    // Supported max-slices number per frame. (0 means driver cannot
+    // support max mutil-slices query)
+    int             max_slices;
 
     // The required size of surfaces.  This is probably the input
     // size (AVCodecContext.width|height) aligned up to whatever
-- 
2.11.0



More information about the ffmpeg-devel mailing list