From 60ab82df322bd91fd1c999dfaa3dd1784617734b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 Oct 2019 22:49:26 +0200 Subject: video, demux: rip out unused spherical metadata code This was preparation into something that never happened. Spherical video is a shit idea anyway. --- video/filter/vf_format.c | 14 -------------- video/mp_image.c | 29 +---------------------------- video/mp_image.h | 15 --------------- 3 files changed, 1 insertion(+), 57 deletions(-) (limited to 'video') diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index 3e44e379e2..1700f002ab 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -53,8 +53,6 @@ struct vf_format_opts { int rotate; int dw, dh; double dar; - int spherical; - float spherical_ref_angles[3]; }; static void vf_format_process(struct mp_filter *f) @@ -121,13 +119,6 @@ static void vf_format_process(struct mp_filter *f) dsize = av_d2q(p->dar, INT_MAX); mp_image_params_set_dsize(out, dsize.num, dsize.den); - if (p->spherical) - out->spherical.type = p->spherical; - for (int n = 0; n < 3; n++) { - if (isfinite(p->spherical_ref_angles[n])) - out->spherical.ref_angles[n] = p->spherical_ref_angles[n]; - } - // Make sure the user-overrides are consistent (no RGB csp for YUV, etc.). mp_image_params_guess_csp(out); @@ -184,10 +175,6 @@ static const m_option_t vf_opts_fields[] = { OPT_INT("dw", dw, 0), OPT_INT("dh", dh, 0), OPT_DOUBLE("dar", dar, 0), - OPT_CHOICE_C("spherical", spherical, 0, mp_spherical_names), - OPT_FLOAT("spherical-yaw", spherical_ref_angles[0], 0), - OPT_FLOAT("spherical-pitch", spherical_ref_angles[1], 0), - OPT_FLOAT("spherical-roll", spherical_ref_angles[2], 0), OPT_REMOVED("outputlevels", "use the --video-output-levels global option"), OPT_REMOVED("peak", "use sig-peak instead (changed value scale!)"), {0} @@ -200,7 +187,6 @@ const struct mp_user_filter_entry vf_format = { .priv_size = sizeof(OPT_BASE_STRUCT), .priv_defaults = &(const OPT_BASE_STRUCT){ .rotate = -1, - .spherical_ref_angles = {NAN, NAN, NAN}, }, .options = vf_opts_fields, }, diff --git a/video/mp_image.c b/video/mp_image.c index 3ef2b3b6f6..c15c6b55fc 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -40,14 +40,6 @@ #include "sws_utils.h" #include "fmt-conversion.h" -const struct m_opt_choice_alternatives mp_spherical_names[] = { - {"auto", MP_SPHERICAL_AUTO}, - {"none", MP_SPHERICAL_NONE}, - {"unknown", MP_SPHERICAL_UNKNOWN}, - {"equirect", MP_SPHERICAL_EQUIRECTANGULAR}, - {0} -}; - // Determine strides, plane sizes, and total required size for an image // allocation. Returns total size on success, <0 on error. Unused planes // have out_stride/out_plane_size to 0, and out_plane_offset set to -1 up @@ -522,7 +514,6 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src) dst->params.p_h = src->params.p_h; dst->params.color = src->params.color; dst->params.chroma_location = src->params.chroma_location; - dst->params.spherical = src->params.spherical; dst->nominal_fps = src->nominal_fps; // ensure colorspace consistency if (mp_image_params_get_forced_csp(&dst->params) != @@ -659,12 +650,6 @@ char *mp_image_params_to_str_buf(char *b, size_t bs, 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; - mp_snprintf_cat(b, bs, " (%s %f/%f/%f)", - m_opt_choice_str(mp_spherical_names, p->spherical.type), - a[0], a[1], a[2]); - } } else { snprintf(b, bs, "???"); } @@ -699,16 +684,6 @@ bool mp_image_params_valid(const struct mp_image_params *p) return true; } -static bool mp_spherical_equal(const struct mp_spherical_params *p1, - const struct mp_spherical_params *p2) -{ - for (int n = 0; n < 3; n++) { - if (p1->ref_angles[n] != p2->ref_angles[n]) - return false; - } - return p1->type == p2->type; -} - bool mp_image_params_equal(const struct mp_image_params *p1, const struct mp_image_params *p2) { @@ -719,8 +694,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->stereo3d == p2->stereo3d && - mp_spherical_equal(&p1->spherical, &p2->spherical); + p1->stereo3d == p2->stereo3d; } // Set most image parameters, but not image format or size. @@ -894,7 +868,6 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) struct mp_image_params *p = (void *)src->opaque_ref->data; dst->params.rotate = p->rotate; 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 1dda20849e..16bae6e7d9 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -38,20 +38,6 @@ #define MP_IMGFIELD_REPEAT_FIRST 0x04 #define MP_IMGFIELD_INTERLACED 0x20 -enum mp_spherical_type { - MP_SPHERICAL_AUTO = 0, - MP_SPHERICAL_NONE, // normal video - MP_SPHERICAL_UNKNOWN, // unknown projection - MP_SPHERICAL_EQUIRECTANGULAR, // (untiled) -}; - -extern const struct m_opt_choice_alternatives mp_spherical_names[]; - -struct mp_spherical_params { - enum mp_spherical_type type; - float ref_angles[3]; // yaw/pitch/roll, refer to AVSphericalMapping -}; - // Describes image parameters that usually stay constant. // New fields can be added in the future. Code changing the parameters should // usually copy the whole struct, so that fields added later will be preserved. @@ -65,7 +51,6 @@ struct mp_image_params { // The image should be rotated clockwise (0-359 degrees). int rotate; enum mp_stereo3d_mode stereo3d; // image is encoded with this mode - struct mp_spherical_params spherical; }; /* Memory management: -- cgit v1.2.3