From c6b92884658f37f7ea9b55a595ddd252c57202c0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Apr 2018 13:31:00 +0200 Subject: video: remove internal stereo_out flag Also rename stereo3d to stereo_in. The only real change is that the vo_gpu OSD code now uses the actual stereo 3D mode, instead of the --video-steroe-mode value. (Why does this vo_gpu code even exist?) --- video/filter/vf_format.c | 6 +----- video/mp_image.c | 16 ++++++---------- video/mp_image.h | 3 +-- video/out/gpu/video.c | 4 ++-- 4 files changed, 10 insertions(+), 19 deletions(-) (limited to 'video') diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index 48eb51a795..3e44e379e2 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -50,7 +50,6 @@ struct vf_format_opts { int light; int chroma_location; int stereo_in; - int stereo_out; int rotate; int dw, dh; double dar; @@ -108,9 +107,7 @@ static void vf_format_process(struct mp_filter *f) if (p->chroma_location) out->chroma_location = p->chroma_location; if (p->stereo_in) - out->stereo_in = p->stereo_in; - if (p->stereo_out) - out->stereo_out = p->stereo_out; + out->stereo3d = p->stereo_in; if (p->rotate >= 0) out->rotate = p->rotate; @@ -183,7 +180,6 @@ static const m_option_t vf_opts_fields[] = { OPT_CHOICE_C("light", light, 0, mp_csp_light_names), OPT_CHOICE_C("chroma-location", chroma_location, 0, mp_chroma_names), OPT_CHOICE_C("stereo-in", stereo_in, 0, mp_stereo3d_names), - OPT_CHOICE_C("stereo-out", stereo_out, 0, mp_stereo3d_names), OPT_INTRANGE("rotate", rotate, 0, -1, 359), OPT_INT("dw", dw, 0), OPT_INT("dh", dh, 0), diff --git a/video/mp_image.c b/video/mp_image.c index a1efe7d405..eadff83e5b 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -501,8 +501,7 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src) dst->dts = src->dts; dst->pkt_duration = src->pkt_duration; dst->params.rotate = src->params.rotate; - dst->params.stereo_in = src->params.stereo_in; - dst->params.stereo_out = src->params.stereo_out; + dst->params.stereo3d = src->params.stereo3d; dst->params.p_w = src->params.p_w; dst->params.p_h = src->params.p_h; dst->params.color = src->params.color; @@ -642,10 +641,9 @@ char *mp_image_params_to_str_buf(char *b, size_t bs, m_opt_choice_str(mp_chroma_names, p->chroma_location)); if (p->rotate) mp_snprintf_cat(b, bs, " rot=%d", p->rotate); - if (p->stereo_in > 0 || p->stereo_out > 0) { - mp_snprintf_cat(b, bs, " stereo=%s/%s", - MP_STEREO3D_NAME_DEF(p->stereo_in, "?"), - MP_STEREO3D_NAME_DEF(p->stereo_out, "?")); + if (p->stereo3d > 0) { + mp_snprintf_cat(b, bs, " stereo=%s", + MP_STEREO3D_NAME_DEF(p->stereo3d, "?")); } if (p->spherical.type != MP_SPHERICAL_NONE) { const float *a = p->spherical.ref_angles; @@ -708,8 +706,7 @@ bool mp_image_params_equal(const struct mp_image_params *p1, mp_colorspace_equal(p1->color, p2->color) && p1->chroma_location == p2->chroma_location && p1->rotate == p2->rotate && - p1->stereo_in == p2->stereo_in && - p1->stereo_out == p2->stereo_out && + p1->stereo3d == p2->stereo3d && mp_spherical_equal(&p1->spherical, &p2->spherical); } @@ -877,8 +874,7 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) if (src->opaque_ref) { struct mp_image_params *p = (void *)src->opaque_ref->data; dst->params.rotate = p->rotate; - dst->params.stereo_in = p->stereo_in; - dst->params.stereo_out = p->stereo_out; + dst->params.stereo3d = p->stereo3d; dst->params.spherical = p->spherical; // Might be incorrect if colorspace changes. dst->params.color.light = p->color.light; diff --git a/video/mp_image.h b/video/mp_image.h index 70e9b9e138..d321a27285 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -64,8 +64,7 @@ struct mp_image_params { enum mp_chroma_location chroma_location; // The image should be rotated clockwise (0-359 degrees). int rotate; - enum mp_stereo3d_mode stereo_in; // image is encoded with this mode - enum mp_stereo3d_mode stereo_out; // should be displayed with this mode + enum mp_stereo3d_mode stereo3d; // image is encoded with this mode struct mp_spherical_params spherical; }; diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index aeaff7a3b1..619e5a83ab 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2628,7 +2628,7 @@ static void pass_draw_osd(struct gl_video *p, int draw_flags, double pts, if ((draw_flags & OSD_DRAW_SUB_ONLY) && (draw_flags & OSD_DRAW_OSD_ONLY)) return; - mpgl_osd_generate(p->osd, rect, pts, p->image_params.stereo_out, draw_flags); + mpgl_osd_generate(p->osd, rect, pts, p->image_params.stereo3d, draw_flags); timer_pool_start(p->osd_timer); for (int n = 0; n < MAX_OSD_PARTS; n++) { @@ -3294,7 +3294,7 @@ void gl_video_resize(struct gl_video *p, gl_video_reset_surfaces(p); if (p->osd) - mpgl_osd_resize(p->osd, p->osd_rect, p->image_params.stereo_out); + mpgl_osd_resize(p->osd, p->osd_rect, p->image_params.stereo3d); } static void frame_perf_data(struct pass_info pass[], struct mp_frame_perf *out) -- cgit v1.2.3