[FFmpeg-devel] [PATCH 1/3] lavc/vaapi_encode: Add max slices number query.
Jun Zhao
mypopydev at gmail.com
Mon Jul 30 14:42:38 EEST 2018
From: Jun Zhao <jun.zhao at intel.com>
Add max slices number query.
Signed-off-by: Jun Zhao <jun.zhao at intel.com>
---
libavcodec/vaapi_encode.c | 4 ++++
libavcodec/vaapi_encode.h | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
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;
--
1.7.1
More information about the ffmpeg-devel
mailing list