diff options
Diffstat (limited to 'video/out/vo_gpu.c')
-rw-r--r-- | video/out/vo_gpu.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/video/out/vo_gpu.c b/video/out/vo_gpu.c index 404b7e77d7..d49a6ba8a2 100644 --- a/video/out/vo_gpu.c +++ b/video/out/vo_gpu.c @@ -26,8 +26,6 @@ #include <libavutil/common.h> -#include "config.h" - #include "mpv_talloc.h" #include "common/common.h" #include "misc/bstr.h" @@ -82,11 +80,16 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) if (!sw->fns->start_frame(sw, &fbo)) return; - gl_video_render_frame(p->renderer, frame, fbo, RENDER_FRAME_DEF); + gl_video_render_frame(p->renderer, frame, &fbo, RENDER_FRAME_DEF); if (!sw->fns->submit_frame(sw, frame)) { MP_ERR(vo, "Failed presenting frame!\n"); return; } + + struct mp_image_params *params = gl_video_get_target_params_ptr(p->renderer); + mp_mutex_lock(&vo->params_mutex); + vo->target_params = params; + mp_mutex_unlock(&vo->params_mutex); } static void flip_page(struct vo *vo) @@ -171,13 +174,14 @@ static void get_and_update_ambient_lighting(struct gpu_priv *p) } } -static void update_ra_ctx_options(struct vo *vo) +static void update_ra_ctx_options(struct vo *vo, struct ra_ctx_opts *ctx_opts) { struct gpu_priv *p = vo->priv; - - /* Only the alpha option has any runtime toggle ability. */ struct gl_video_opts *gl_opts = mp_get_config_group(p->ctx, vo->global, &gl_video_conf); - p->ctx->opts.want_alpha = gl_opts->alpha_mode == 1; + ctx_opts->want_alpha = (gl_opts->background == BACKGROUND_COLOR && + gl_opts->background_color.a != 255) || + gl_opts->background == BACKGROUND_NONE; + talloc_free(gl_opts); } static int control(struct vo *vo, uint32_t request, void *data) @@ -188,9 +192,6 @@ static int control(struct vo *vo, uint32_t request, void *data) case VOCTRL_SET_PANSCAN: resize(vo); return VO_TRUE; - case VOCTRL_SET_EQUALIZER: - vo->want_redraw = true; - return VO_TRUE; case VOCTRL_SCREENSHOT: { struct vo_frame *frame = vo_get_current_vo_frame(vo); if (frame) @@ -202,12 +203,14 @@ static int control(struct vo *vo, uint32_t request, void *data) request_hwdec_api(vo, data); return true; case VOCTRL_UPDATE_RENDER_OPTS: { - update_ra_ctx_options(vo); + struct ra_ctx_opts *ctx_opts = mp_get_config_group(vo, vo->global, &ra_ctx_conf); + update_ra_ctx_options(vo, ctx_opts); gl_video_configure_queue(p->renderer, vo); get_and_update_icc_profile(p); if (p->ctx->fns->update_render_opts) p->ctx->fns->update_render_opts(p->ctx); vo->want_redraw = true; + talloc_free(ctx_opts); return true; } case VOCTRL_RESET: @@ -254,22 +257,22 @@ static void wakeup(struct vo *vo) p->ctx->fns->wakeup(p->ctx); } -static void wait_events(struct vo *vo, int64_t until_time_us) +static void wait_events(struct vo *vo, int64_t until_time_ns) { struct gpu_priv *p = vo->priv; if (p->ctx && p->ctx->fns->wait_events) { - p->ctx->fns->wait_events(p->ctx, until_time_us); + p->ctx->fns->wait_events(p->ctx, until_time_ns); } else { - vo_wait_default(vo, until_time_us); + vo_wait_default(vo, until_time_ns); } } static struct mp_image *get_image(struct vo *vo, int imgfmt, int w, int h, - int stride_align) + int stride_align, int flags) { struct gpu_priv *p = vo->priv; - return gl_video_get_image(p->renderer, imgfmt, w, h, stride_align); + return gl_video_get_image(p->renderer, imgfmt, w, h, stride_align, flags); } static void uninit(struct vo *vo) @@ -290,12 +293,9 @@ static int preinit(struct vo *vo) p->log = vo->log; struct ra_ctx_opts *ctx_opts = mp_get_config_group(vo, vo->global, &ra_ctx_conf); - struct gl_video_opts *gl_opts = mp_get_config_group(vo, vo->global, &gl_video_conf); - struct ra_ctx_opts opts = *ctx_opts; - opts.want_alpha = gl_opts->alpha_mode == 1; - p->ctx = ra_ctx_create(vo, opts); + update_ra_ctx_options(vo, ctx_opts); + p->ctx = ra_ctx_create(vo, *ctx_opts); talloc_free(ctx_opts); - talloc_free(gl_opts); if (!p->ctx) goto err_out; assert(p->ctx->ra); @@ -310,7 +310,7 @@ static int preinit(struct vo *vo) vo->hwdec_devs = hwdec_devices_create(); hwdec_devices_set_loader(vo->hwdec_devs, call_request_hwdec_api, vo); - gl_video_init_hwdecs(p->renderer, vo->hwdec_devs, false); + gl_video_init_hwdecs(p->renderer, p->ctx, vo->hwdec_devs, false); return 0; |