From 8a67606c20958fa21db0b5ba9a17f379bc01786c Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 Apr 2016 18:26:58 +0200 Subject: vd_lavc: let hardware decoder request delaying frames explicitly Until now, the presence of the process_image() callback was used to set a delay queue with a hardcoded size. Change this to a vd_lavc_hwdec field instead, so the decoder can explicitly set this if it's really needed. Do this so process_image() can be used in the VideoToolbox glue code for something entirely unrelated. --- video/decode/lavc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/decode/lavc.h') diff --git a/video/decode/lavc.h b/video/decode/lavc.h index 44c5c27a0f..826edbff83 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -49,6 +49,11 @@ struct vd_lavc_hwdec { // If not-0: the IMGFMT_ format that should be accepted in the libavcodec // get_format callback. int image_format; + // Setting this will queue the given number of frames before calling + // process_image() or returning them to the renderer. This can increase + // efficiency by not blocking on the hardware pipeline by reading back + // immediately after decoding. + int delay_queue; int (*probe)(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info, const char *codec); int (*init)(struct lavc_ctx *ctx); -- cgit v1.2.3