From de22d2b1bafd2644b2ce6008f102427337796fd8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 22 Nov 2013 18:04:59 +0100 Subject: vf_vavpp: make it work with vo_opengl and software decoding vo_opengl always loads the hwdec backend lazily, so hwdec_request_api() has to be called to possibly load it. This makes vf_vavpp work with software decoding. (Hardware decoding loads the backend before the filter is initialized, so this case is different.) Also, the VFCTRL_GET_HWDEC_INFO call doesn't need to be checked. If it fails, the info will be left blank. --- video/decode/dec_video.h | 2 ++ video/decode/lavc.h | 2 -- video/filter/vf_vavpp.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'video') diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 03b72907ef..959d50caaf 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -54,4 +54,6 @@ struct mp_hwdec_info { void *load_api_ctx; }; +void hwdec_request_api(struct mp_hwdec_info *info, const char *api_name); + #endif /* MPLAYER_DEC_VIDEO_H */ diff --git a/video/decode/lavc.h b/video/decode/lavc.h index af206bc82a..9e2533cbd5 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -86,8 +86,6 @@ bool hwdec_check_codec_support(const char *decoder, const struct hwdec_profile_entry *table); int hwdec_get_max_refs(struct lavc_ctx *ctx); -void hwdec_request_api(struct mp_hwdec_info *info, const char *api_name); - // lavc_dr1.c int mp_codec_get_buffer(AVCodecContext *s, AVFrame *frame); void mp_codec_release_buffer(AVCodecContext *s, AVFrame *frame); diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c index f9f77a1b64..49bef77e50 100644 --- a/video/filter/vf_vavpp.c +++ b/video/filter/vf_vavpp.c @@ -372,9 +372,9 @@ static int vf_open(vf_instance_t *vf, char *args) vf->control = control; struct vf_priv_s *p = vf->priv; - struct mp_hwdec_info hwdec; - if (vf_control(vf->next, VFCTRL_GET_HWDEC_INFO, &hwdec) <= 0) - return false; + struct mp_hwdec_info hwdec = {0}; + vf_control(vf->next, VFCTRL_GET_HWDEC_INFO, &hwdec); + hwdec_request_api(&hwdec, "vaapi"); p->va = hwdec.vaapi_ctx; if (!p->va || !p->va->display) return false; -- cgit v1.2.3