summaryrefslogtreecommitdiffstats
path: root/video/decode
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/decode
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/decode')
-rw-r--r--video/decode/vd_lavc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 1d33742bc5..45ae9fce94 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -485,6 +485,7 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame,
.chroma_location =
avchroma_location_to_mp(ctx->avctx->chroma_sample_location),
.rotate = vd->header->video->rotate,
+ .stereo_in = vd->header->video->stereo_mode,
};
if (opts->video_rotate < 0) {
@@ -492,6 +493,7 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame,
} else {
out_params->rotate = (out_params->rotate + opts->video_rotate) % 360;
}
+ out_params->stereo_out = opts->video_stereo_mode;
}
static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx,