summaryrefslogtreecommitdiff
path: root/libavcodec/dxva2_h264.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-10-19 16:38:20 +0200
committerAnton Khirnov <anton@khirnov.net>2017-10-19 17:10:59 +0200
commitb46a77f19ddc4b2b5fa3187835ceb602a5244e24 (patch)
tree7ed4627e4115b6c3e588527779e459dd24623ffb /libavcodec/dxva2_h264.c
parentec0f4fa17ce29cf01d4def21041b0b87f7e3105d (diff)
downloadffmpeg-b46a77f19ddc4b2b5fa3187835ceb602a5244e24.tar.gz
lavc: external hardware frame pool initialization
This adds a new API, which allows the API user to query the required AVHWFramesContext parameters. This also reduces code duplication across the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses the new API function. It takes care of initializing the hw_frames_ctx if needed, and does additional error handling and API usage checking. Support for VDA and Cuvid missing. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/dxva2_h264.c')
-rw-r--r--libavcodec/dxva2_h264.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index de0885058a..8ce8c358c5 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -523,6 +523,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
.start_frame = dxva2_h264_start_frame,
.decode_slice = dxva2_h264_decode_slice,
.end_frame = dxva2_h264_end_frame,
+ .frame_params = ff_dxva2_common_frame_params,
.frame_priv_data_size = sizeof(struct dxva2_picture_context),
.priv_data_size = sizeof(FFDXVASharedContext),
};
@@ -539,6 +540,7 @@ AVHWAccel ff_h264_d3d11va_hwaccel = {
.start_frame = dxva2_h264_start_frame,
.decode_slice = dxva2_h264_decode_slice,
.end_frame = dxva2_h264_end_frame,
+ .frame_params = ff_dxva2_common_frame_params,
.frame_priv_data_size = sizeof(struct dxva2_picture_context),
.priv_data_size = sizeof(FFDXVASharedContext),
};
@@ -555,6 +557,7 @@ AVHWAccel ff_h264_d3d11va2_hwaccel = {
.start_frame = dxva2_h264_start_frame,
.decode_slice = dxva2_h264_decode_slice,
.end_frame = dxva2_h264_end_frame,
+ .frame_params = ff_dxva2_common_frame_params,
.frame_priv_data_size = sizeof(struct dxva2_picture_context),
.priv_data_size = sizeof(FFDXVASharedContext),
};