summaryrefslogtreecommitdiffstats
path: root/video/mp_image.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-21 14:56:07 +0200
committerwm4 <wm4@nowhere>2017-08-21 14:56:07 +0200
commit028faacff56d7f90f6b119b0b0ac686fd614825f (patch)
tree33d77aa61946f3bebfdb28fa8670065fdb79aed8 /video/mp_image.h
parent82d9419f62c90cecc13c492e3b68feebe0229daa (diff)
downloadmpv-028faacff56d7f90f6b119b0b0ac686fd614825f.tar.bz2
mpv-028faacff56d7f90f6b119b0b0ac686fd614825f.tar.xz
video: add metadata handling for spherical video
This adds handling of spherical video metadata: retrieving it from demux_lavf and demux_mkv, passing it through filters, and adjusting it with vf_format. This does not include support for rendering this type of video. We don't expect we need/want to support the other projection types like cube maps, so we don't include that for now. They can be added later as needed. Also raise the maximum sizes of stringified image params, since they can get really long.
Diffstat (limited to 'video/mp_image.h')
-rw-r--r--video/mp_image.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/video/mp_image.h b/video/mp_image.h
index 640e2709e9..53b25c5999 100644
--- a/video/mp_image.h
+++ b/video/mp_image.h
@@ -36,6 +36,20 @@
#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.
@@ -50,6 +64,7 @@ struct mp_image_params {
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
+ struct mp_spherical_params spherical;
};
/* Memory management:
@@ -144,7 +159,7 @@ void mp_image_params_guess_csp(struct mp_image_params *params);
char *mp_image_params_to_str_buf(char *b, size_t bs,
const struct mp_image_params *p);
-#define mp_image_params_to_str(p) mp_image_params_to_str_buf((char[99]){0}, 99, p)
+#define mp_image_params_to_str(p) mp_image_params_to_str_buf((char[256]){0}, 256, p)
bool mp_image_params_valid(const struct mp_image_params *p);
bool mp_image_params_equal(const struct mp_image_params *p1,