summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_h264.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-12-20 20:39:56 +0000
committerMark Thompson <sw@jkqxz.net>2019-01-23 23:04:11 +0000
commit5fdcf85bbffe7451c227478fda62da5c0938f27d (patch)
treee780fe3a5b8289e4c0cd8fe9700583452e8a06c0 /libavcodec/vaapi_encode_h264.c
parent26ce3a43a35fe3a43c895945252aa22c6b46ffb7 (diff)
downloadffmpeg-5fdcf85bbffe7451c227478fda62da5c0938f27d.tar.gz
vaapi_encode: Convert to send/receive API
This attaches the logic of picking the mode of for the next picture to the output, which simplifies some choices by removing the concept of the picture for which input is not yet available. At the same time, we allow more complex reference structures and track more reference metadata (particularly the contents of the DPB) for use in the codec-specific code. It also adds flags to explicitly track the available features of the different codecs. The new structure also allows open-GOP support, so that is now available for codecs which can do it.
Diffstat (limited to 'libavcodec/vaapi_encode_h264.c')
-rw-r--r--libavcodec/vaapi_encode_h264.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index f9402992b8..684c8ed96f 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -902,7 +902,9 @@ static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = {
static const VAAPIEncodeType vaapi_encode_type_h264 = {
.profiles = vaapi_encode_h264_profiles,
- .flags = FLAG_SLICE_CONTROL,
+ .flags = FLAG_SLICE_CONTROL |
+ FLAG_B_PICTURES |
+ FLAG_NON_IDR_KEY_PICTURES,
.configure = &vaapi_encode_h264_configure,
@@ -1095,7 +1097,8 @@ AVCodec ff_h264_vaapi_encoder = {
.id = AV_CODEC_ID_H264,
.priv_data_size = sizeof(VAAPIEncodeH264Context),
.init = &vaapi_encode_h264_init,
- .encode2 = &ff_vaapi_encode2,
+ .send_frame = &ff_vaapi_encode_send_frame,
+ .receive_packet = &ff_vaapi_encode_receive_packet,
.close = &vaapi_encode_h264_close,
.priv_class = &vaapi_encode_h264_class,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,