mirror of https://github.com/mpv-player/mpv
vdpau_mixer: allow overriding frame opts
So a caller can override the filter options dictated by vf_vdpaupp.
This commit is contained in:
parent
ec28a281b9
commit
fd63f2f037
|
@ -191,7 +191,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
|
||||||
if (!p->vdpgl_surface)
|
if (!p->vdpgl_surface)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
mp_vdpau_mixer_render(p->mixer, p->vdp_surface, NULL, hw_image, NULL);
|
mp_vdpau_mixer_render(p->mixer, NULL, p->vdp_surface, NULL, hw_image, NULL);
|
||||||
|
|
||||||
gl->VDPAUMapSurfacesNV(1, &p->vdpgl_surface);
|
gl->VDPAUMapSurfacesNV(1, &p->vdpgl_surface);
|
||||||
out_textures[0] = p->gl_texture;
|
out_textures[0] = p->gl_texture;
|
||||||
|
|
|
@ -204,7 +204,7 @@ static int render_video_to_output_surface(struct vo *vo,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mp_vdpau_mixer_render(vc->video_mixer, output_surface, output_rect,
|
mp_vdpau_mixer_render(vc->video_mixer, NULL, output_surface, output_rect,
|
||||||
bv[dp].mpi, video_rect);
|
bv[dp].mpi, video_rect);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,9 @@ static int create_vdp_mixer(struct mp_vdpau_mixer *mixer)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If opts is NULL, use the opts as implied by the video image.
|
||||||
int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
|
int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
|
||||||
|
struct mp_vdpau_mixer_opts *opts,
|
||||||
VdpOutputSurface output, VdpRect *output_rect,
|
VdpOutputSurface output, VdpRect *output_rect,
|
||||||
struct mp_image *video, VdpRect *video_rect)
|
struct mp_image *video, VdpRect *video_rect)
|
||||||
{
|
{
|
||||||
|
@ -223,13 +225,16 @@ int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
|
||||||
frame->field = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
|
frame->field = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!opts)
|
||||||
|
opts = &frame->opts;
|
||||||
|
|
||||||
if (mixer->video_mixer == VDP_INVALID_HANDLE)
|
if (mixer->video_mixer == VDP_INVALID_HANDLE)
|
||||||
mixer->initialized = false;
|
mixer->initialized = false;
|
||||||
|
|
||||||
if (!mixer->initialized || !opts_equal(&frame->opts, &mixer->opts) ||
|
if (!mixer->initialized || !opts_equal(opts, &mixer->opts) ||
|
||||||
!mp_image_params_equals(&video->params, &mixer->image_params))
|
!mp_image_params_equals(&video->params, &mixer->image_params))
|
||||||
{
|
{
|
||||||
mixer->opts = frame->opts;
|
mixer->opts = *opts;
|
||||||
mixer->image_params = video->params;
|
mixer->image_params = video->params;
|
||||||
if (mixer->video_mixer != VDP_INVALID_HANDLE) {
|
if (mixer->video_mixer != VDP_INVALID_HANDLE) {
|
||||||
vdp_st = vdp->video_mixer_destroy(mixer->video_mixer);
|
vdp_st = vdp->video_mixer_destroy(mixer->video_mixer);
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct mp_vdpau_mixer *mp_vdpau_mixer_create(struct mp_vdpau_ctx *vdp_ctx,
|
||||||
void mp_vdpau_mixer_destroy(struct mp_vdpau_mixer *mixer);
|
void mp_vdpau_mixer_destroy(struct mp_vdpau_mixer *mixer);
|
||||||
|
|
||||||
int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
|
int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer,
|
||||||
|
struct mp_vdpau_mixer_opts *opts,
|
||||||
VdpOutputSurface output, VdpRect *output_rect,
|
VdpOutputSurface output, VdpRect *output_rect,
|
||||||
struct mp_image *video, VdpRect *video_rect);
|
struct mp_image *video, VdpRect *video_rect);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue