diff options
Diffstat (limited to 'filters/filter.c')
-rw-r--r-- | filters/filter.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/filters/filter.c b/filters/filter.c index d4a0dd6a0b..2522209b49 100644 --- a/filters/filter.c +++ b/filters/filter.c @@ -685,32 +685,19 @@ struct mp_stream_info *mp_filter_find_stream_info(struct mp_filter *f) return NULL; } -struct AVBufferRef *mp_filter_load_hwdec_device(struct mp_filter *f, int avtype) +struct AVBufferRef *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt) { struct mp_stream_info *info = mp_filter_find_stream_info(f); if (!info || !info->hwdec_devs) return NULL; - int imgfmt = IMGFMT_NONE; - switch (avtype) { - case AV_HWDEVICE_TYPE_VAAPI: - imgfmt = IMGFMT_VAAPI; - break; - case AV_HWDEVICE_TYPE_VDPAU: - imgfmt = IMGFMT_VDPAU; - break; - default: - MP_WARN(f, - "Unrecognised HW Device type requested. Loading all devices\n"); - } - struct hwdec_imgfmt_request params = { .imgfmt = imgfmt, .probing = false, }; hwdec_devices_request_for_img_fmt(info->hwdec_devs, ¶ms); - return hwdec_devices_get_lavc(info->hwdec_devs, avtype); + return hwdec_devices_get_imgfmt(info->hwdec_devs, imgfmt); } static void filter_wakeup(struct mp_filter *f, bool mark_only) |