diff options
author | Vignesh Venkatasubramanian <vigneshv@google.com> | 2013-02-04 15:17:52 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-14 21:34:47 +0100 |
commit | ce6a8e5947cabf90720fe0763301e1657252dbec (patch) | |
tree | 8b10dc6b46dcecb4fa70b5945a849c748d2f1b6c /libavformat/matroskadec.c | |
parent | 2f3bc5122822687dc388f7352c92cf6db456cf7c (diff) | |
download | ffmpeg-ce6a8e5947cabf90720fe0763301e1657252dbec.tar.gz |
Adding AlphaMode element to Matroska Parser
Adding support for parsing AlphaMode element in the Track header
and export that information as a metadata tag. This flag indicates
presence of alpha channel data in BlockAdditional element.
Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 3519a136ce..d2e5329932 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -116,6 +116,7 @@ typedef struct { uint64_t pixel_height; EbmlBin color_space; uint64_t stereo_mode; + uint64_t alpha_mode; } MatroskaTrackVideo; typedef struct { @@ -320,6 +321,7 @@ static EbmlSyntax matroska_track_video[] = { { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_height) }, { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo,color_space) }, { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo,stereo_mode) }, + { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo,alpha_mode) }, { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, @@ -1786,6 +1788,10 @@ static int matroska_read_header(AVFormatContext *s) if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT) av_dict_set(&st->metadata, "stereo_mode", ff_matroska_video_stereo_mode[track->video.stereo_mode], 0); + /* export alpha mode flag as metadata tag */ + if (track->video.alpha_mode) + av_dict_set(&st->metadata, "alpha_mode", "1", 0); + /* if we have virtual track, mark the real tracks */ for (j=0; j < track->operation.combine_planes.nb_elem; j++) { char buf[32]; |