diff options
Diffstat (limited to 'video/hwdec.c')
-rw-r--r-- | video/hwdec.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/video/hwdec.c b/video/hwdec.c index 46ddff516c..1b15c95c64 100644 --- a/video/hwdec.c +++ b/video/hwdec.c @@ -35,34 +35,22 @@ void hwdec_devices_destroy(struct mp_hwdec_devices *devs) talloc_free(devs); } -struct mp_hwdec_ctx *hwdec_devices_get_by_lavc(struct mp_hwdec_devices *devs, - int av_hwdevice_type) +struct mp_hwdec_ctx *hwdec_devices_get_by_imgfmt(struct mp_hwdec_devices *devs, + int hw_imgfmt) { struct mp_hwdec_ctx *res = NULL; pthread_mutex_lock(&devs->lock); for (int n = 0; n < devs->num_hwctxs; n++) { struct mp_hwdec_ctx *dev = devs->hwctxs[n]; - if (dev->av_device_ref) { - AVHWDeviceContext *hwctx = (void *)dev->av_device_ref->data; - if (hwctx->type == av_hwdevice_type) { - res = dev; - break; - } + if (dev->hw_imgfmt == hw_imgfmt) { + res = dev; + break; } } pthread_mutex_unlock(&devs->lock); return res; } -struct AVBufferRef *hwdec_devices_get_lavc(struct mp_hwdec_devices *devs, - int av_hwdevice_type) -{ - struct mp_hwdec_ctx *ctx = hwdec_devices_get_by_lavc(devs, av_hwdevice_type); - if (!ctx) - return NULL; - return av_buffer_ref(ctx->av_device_ref); -} - struct mp_hwdec_ctx *hwdec_devices_get_first(struct mp_hwdec_devices *devs) { return hwdec_devices_get_n(devs, 0); |