[FFmpeg-devel] [PATCH V4 2/4] lavc/vaapi_encode: Add max slices number query.
Jun Zhao
mypopydev at gmail.com
Wed Aug 23 13:34:20 EEST 2017
-------------- next part --------------
From 4cac77cf990e91fececaf3dc5bffe606fcdae17c 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 V4 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 | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index f49e0e3b91..011aedd9d9 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 },
};
@@ -1101,6 +1102,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 364b5b8028..dafbbf5045 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 mutil-slices query)
+ int max_slices;
+
// Per-sequence parameter structure (VAEncSequenceParameterBuffer*).
void *codec_sequence_params;
--
2.11.0
More information about the ffmpeg-devel
mailing list