1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

video/out: pass along global context

Will be needed for other parts (especially in gl_lcms.c).
This commit is contained in:
wm4 2013-12-21 17:51:20 +01:00
parent 2eefa31c88
commit c8268701d9
5 changed files with 10 additions and 4 deletions

View File

@ -103,7 +103,8 @@ static struct bstr load_file(void *talloc_ctx, const char *filename)
#define LUT3D_CACHE_HEADER "mpv 3dlut cache 1.0\n"
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log)
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,
struct mpv_global *global)
{
int s_r, s_g, s_b;
if (!parse_3dlut_size(opts->size_str, &s_r, &s_g, &s_b))
@ -223,7 +224,8 @@ const struct m_sub_options mp_icc_conf = {
.defaults = &(const struct mp_icc_opts) {0},
};
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log)
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,
struct mpv_global *global)
{
mp_msg_log(log, MSGL_FATAL, "LCMS2 support not compiled.\n");
return NULL;

View File

@ -12,6 +12,8 @@ struct mp_icc_opts {
struct lut3d;
struct mp_log;
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log);
struct mpv_global;
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,
struct mpv_global *global);
#endif

View File

@ -160,6 +160,7 @@ static struct vo *vo_create(struct mpv_global *global,
.log = mp_log_new(vo, log, name),
.driver = desc.p,
.opts = &global->opts->vo,
.global = global,
.encode_lavc_ctx = encode_lavc_ctx,
.input_ctx = input_ctx,
.event_fd = -1,

View File

@ -247,6 +247,7 @@ struct vo {
const struct vo_driver *driver;
void *priv;
struct mp_vo_opts *opts;
struct mpv_global *global;
struct vo_x11_state *x11;
struct vo_w32_state *w32;
struct vo_cocoa_state *cocoa;

View File

@ -397,7 +397,7 @@ static int preinit(struct vo *vo)
gl_video_set_options(p->renderer, p->renderer_opts);
if (p->icc_opts->profile) {
struct lut3d *lut3d = mp_load_icc(p->icc_opts, vo->log);
struct lut3d *lut3d = mp_load_icc(p->icc_opts, vo->log, vo->global);
if (!lut3d)
goto err_out;
gl_video_set_lut3d(p->renderer, lut3d);