diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 17 | ||||
-rw-r--r-- | player/core.h | 2 | ||||
-rw-r--r-- | player/screenshot.c | 5 | ||||
-rw-r--r-- | player/video.c | 6 |
4 files changed, 17 insertions, 13 deletions
diff --git a/player/command.c b/player/command.c index 8ff2914c66..c8394c403c 100644 --- a/player/command.c +++ b/player/command.c @@ -2198,14 +2198,14 @@ static int mp_property_hwdec_interop(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - if (!mpctx->video_out) + if (!mpctx->video_out || !mpctx->video_out->hwdec_devs) return M_PROPERTY_UNAVAILABLE; - struct mp_hwdec_info *hwdec_info = NULL; - vo_control(mpctx->video_out, VOCTRL_GET_HWDEC_INFO, &hwdec_info); - struct mp_hwdec_ctx *hwctx = hwdec_info ? hwdec_info->hwctx : NULL; + struct mp_hwdec_ctx *hwctx = + hwdec_devices_get_first(mpctx->video_out->hwdec_devs); + const char *name = hwctx ? hwctx->driver_name : NULL; - if (!name && hwctx && hwctx->type != HWDEC_NONE && hwctx->type != HWDEC_AUTO) + if (!name && hwctx) name = m_opt_choice_str(mp_hwdec_names, hwctx->type); return m_property_strdup_ro(action, arg, name); @@ -2244,8 +2244,11 @@ static int mp_property_detected_hwdec(void *ctx, struct m_property *prop, if (vd) video_vd_control(vd, VDCTRL_GET_HWDEC, ¤t); - if (current <= 0 && vd && vd->hwdec_info && vd->hwdec_info->hwctx) - current = vd->hwdec_info->hwctx->type; + if (current <= 0 && vd && vd->hwdec_devs) { + struct mp_hwdec_ctx *hwctx = hwdec_devices_get_first(vd->hwdec_devs); + if (hwctx) + current = hwctx->type; + } // In case of the "-copy" ones, which are "detected" every time the // decoder is opened, return "no" if no decoding is active. diff --git a/player/core.h b/player/core.h index 489d1f8d3f..3a5689b9f3 100644 --- a/player/core.h +++ b/player/core.h @@ -153,7 +153,7 @@ struct track { struct vo_chain { struct mp_log *log; - struct mp_hwdec_info *hwdec_info; + struct mp_hwdec_devices *hwdec_devs; double container_fps; struct vf_chain *vf; diff --git a/player/screenshot.c b/player/screenshot.c index 33b972bb25..13532ec1a3 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -346,8 +346,9 @@ static struct mp_image *screenshot_get(struct MPContext *mpctx, int mode) } } - if (image && mpctx->vo_chain && mpctx->vo_chain->hwdec_info) { - struct mp_hwdec_ctx *ctx = mpctx->vo_chain->hwdec_info->hwctx; + if (image && mpctx->vo_chain && mpctx->vo_chain->hwdec_devs) { + struct mp_hwdec_ctx *ctx = + hwdec_devices_get_first(mpctx->vo_chain->hwdec_devs); struct mp_image *nimage = NULL; if (ctx && ctx->download_image && (image->fmt.flags & MP_IMGFLAG_HWACCEL)) nimage = ctx->download_image(ctx, image, NULL); diff --git a/player/video.c b/player/video.c index de3eb963fa..1d2dc29fc6 100644 --- a/player/video.c +++ b/player/video.c @@ -204,7 +204,7 @@ static void recreate_video_filters(struct MPContext *mpctx) vf_destroy(vo_c->vf); vo_c->vf = vf_new(mpctx->global); - vo_c->vf->hwdec = vo_c->hwdec_info; + vo_c->vf->hwdec_devs = vo_c->hwdec_devs; vo_c->vf->wakeup_callback = wakeup_playloop; vo_c->vf->wakeup_callback_ctx = mpctx; vo_c->vf->container_fps = vo_c->container_fps; @@ -334,7 +334,7 @@ int init_video_decoder(struct MPContext *mpctx, struct track *track) d_video->codec = track->stream->codec; d_video->fps = d_video->header->codec->fps; if (mpctx->vo_chain) - d_video->hwdec_info = mpctx->vo_chain->hwdec_info; + d_video->hwdec_devs = mpctx->vo_chain->hwdec_devs; MP_VERBOSE(d_video, "Container reported FPS: %f\n", d_video->fps); @@ -404,7 +404,7 @@ int reinit_video_chain_src(struct MPContext *mpctx, struct lavfi_pad *src) vo_c->vo = mpctx->video_out; vo_c->vf = vf_new(mpctx->global); - vo_control(vo_c->vo, VOCTRL_GET_HWDEC_INFO, &vo_c->hwdec_info); + vo_c->hwdec_devs = vo_c->vo->hwdec_devs; vo_c->filter_src = src; if (!vo_c->filter_src) { |