path: root/player/video.c
diff options
authorwm4 <wm4@nowhere>2014-08-30 23:24:46 +0200
committerwm4 <wm4@nowhere>2014-08-30 23:24:46 +0200
commit8599c959fe9334bc4d226faf813166ef8bc8efd5 (patch)
tree433530a09dd4b22173092b10452d7a35325de570 /player/video.c
parentc80adac07772f5b3c7a6c31e3e05480252f84171 (diff)
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 'player/video.c')
1 files changed, 12 insertions, 0 deletions
diff --git a/player/video.c b/player/video.c
index 7aaef07f4f..f36a41b8f7 100644
--- a/player/video.c
+++ b/player/video.c
@@ -157,6 +157,18 @@ static void filter_reconfig(struct MPContext *mpctx,
+ if (params.stereo_in != params.stereo_out &&
+ params.stereo_in > 0 && params.stereo_out >= 0)
+ {
+ char *from = MP_STEREO3D_NAME(params.stereo_in);
+ char *to = MP_STEREO3D_NAME(params.stereo_out);
+ if (from && to) {
+ char *args[] = {"in", from, "out", to, NULL, NULL};
+ if (try_filter(mpctx, params, "stereo3d", "stereo3d", args) < 0)
+ MP_ERR(mpctx, "Can't insert 3D conversion filter.\n");
+ }
+ }
static void recreate_video_filters(struct MPContext *mpctx)