1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 06:14:32 +00:00
mpv/video/vdpau_mixer.h
wm4 03cf150ff3 video: redo video equalizer option handling
I really wouldn't care much about this, but some parts of the core code
are under HAVE_GPL, so there's some need to get rid of it. Simply turn
the video equalizer from its current fine-grained handling with vf/vo
fallbacks into global options. This makes updating them much simpler.

This removes any possibility of applying video equalizers in filters,
which affects vf_scale, and the previously removed vf_eq. Not a big
loss, since the preferred VOs have this builtin.

Remove video equalizer handling from vo_direct3d, vo_sdl, vo_vaapi, and
vo_xv. I'm not going to waste my time on these legacy VOs.

vo.eq_opts_cache exists _only_ to send a VOCTRL_SET_EQUALIZER, which
exists _only_ to trigger a redraw. This seems silly, but for now I feel
like this is less of a pain. The rest of the equalizer using code is
self-updating.

See commit 96b906a51d for how some video equalizer code was GPL only.
Some command line option names and ranges can probably be traced back to
a GPL only committer, but we don't consider these copyrightable.
2017-08-22 17:01:35 +02:00

62 lines
1.5 KiB
C

#ifndef MP_VDPAU_MIXER_H_
#define MP_VDPAU_MIXER_H_
#include <stdbool.h>
#include "csputils.h"
#include "mp_image.h"
#include "vdpau.h"
struct mp_vdpau_mixer_opts {
int deint;
int chroma_deint;
int pullup;
float denoise;
float sharpen;
int hqscaling;
};
#define MP_VDP_HISTORY_FRAMES 2
struct mp_vdpau_mixer_frame {
// settings
struct mp_vdpau_mixer_opts opts;
// video data
VdpVideoMixerPictureStructure field;
VdpVideoSurface past[MP_VDP_HISTORY_FRAMES];
VdpVideoSurface current;
VdpVideoSurface future[MP_VDP_HISTORY_FRAMES];
};
struct mp_vdpau_mixer {
struct mp_log *log;
struct mp_vdpau_ctx *ctx;
uint64_t preemption_counter;
bool initialized;
struct mp_image_params image_params;
struct mp_vdpau_mixer_opts opts;
VdpChromaType current_chroma_type;
int current_w, current_h;
struct mp_csp_equalizer_state *video_eq;
VdpVideoMixer video_mixer;
};
struct mp_image *mp_vdpau_mixed_frame_create(struct mp_image *base);
struct mp_vdpau_mixer_frame *mp_vdpau_mixed_frame_get(struct mp_image *mpi);
struct mp_vdpau_mixer *mp_vdpau_mixer_create(struct mp_vdpau_ctx *vdp_ctx,
struct mp_log *log);
void mp_vdpau_mixer_destroy(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,
struct mp_image *video, VdpRect *video_rect);
#endif