summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-30 23:24:46 +0200
committerwm4 <wm4@nowhere>2014-08-30 23:24:46 +0200
commit8599c959fe9334bc4d226faf813166ef8bc8efd5 (patch)
tree433530a09dd4b22173092b10452d7a35325de570 /video/mp_image.c
parentc80adac07772f5b3c7a6c31e3e05480252f84171 (diff)
downloadmpv-8599c959fe9334bc4d226faf813166ef8bc8efd5.tar.bz2
mpv-8599c959fe9334bc4d226faf813166ef8bc8efd5.tar.xz
video: initial Matroska 3D support
This inserts an automatic conversion filter if a Matroska file is marked as 3D (StereoMode element). The basic idea is similar to video rotation and colorspace handling: the 3D mode is added as a property to the video params. Depending on this property, a video filter can be inserted. As of this commit, extending mp_image_params is actually completely unnecessary - but the idea is that it will make it easier to integrate with VOs supporting stereo 3D mogrification. Although vo_opengl does support some stereo rendering, it didn't support the mode my sample file used, so I'll leave that part for later. Not that most mappings from Matroska mode to vf_stereo3d mode are probably wrong, and some are missing. Assuming that Matroska modes, and vf_stereo3d in modes, and out modes are all the same might be an oversimplification - we'll see. See issue #1045.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r--video/mp_image.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index d83a9ae3c1..7b430dfaf6 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -364,6 +364,8 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
dst->fields = src->fields;
dst->qscale_type = src->qscale_type;
dst->pts = src->pts;
+ dst->params.stereo_in = src->params.stereo_in;
+ dst->params.stereo_out = src->params.stereo_out;
if (dst->w == src->w && dst->h == src->h) {
dst->params.d_w = src->params.d_w;
dst->params.d_h = src->params.d_h;
@@ -489,7 +491,9 @@ bool mp_image_params_equal(const struct mp_image_params *p1,
p1->outputlevels == p2->outputlevels &&
p1->primaries == p2->primaries &&
p1->chroma_location == p2->chroma_location &&
- p1->rotate == p2->rotate;
+ p1->rotate == p2->rotate &&
+ p1->stereo_in == p2->stereo_in &&
+ p1->stereo_out == p2->stereo_out;
}
// Set most image parameters, but not image format or size.