1/****************************************************************************
2** libmatroska : parse Matroska files, see http://www.matroska.org/
3**
4** <file/class description>
5**
6** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
7**
8** This file is part of libmatroska.
9**
10** This library is free software; you can redistribute it and/or
11** modify it under the terms of the GNU Lesser General Public
12** License as published by the Free Software Foundation; either
13** version 2.1 of the License, or (at your option) any later version.
14**
15** This library is distributed in the hope that it will be useful,
16** but WITHOUT ANY WARRANTY; without even the implied warranty of
17** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18** Lesser General Public License for more details.
19**
20** You should have received a copy of the GNU Lesser General Public
21** License along with this library; if not, write to the Free Software
22** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23**
24** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
25** Contact license@matroska.org if any conditions of this licensing are
26** not clear to you.
27**
28**********************************************************************/
29
30/*!
31	\file
32	\version \$Id: KaxTrackVideo.cpp 738 2004-08-30 09:21:46Z robux4 $
33	\author Steve Lhomme     <robux4 @ users.sf.net>
34*/
35#include "matroska/KaxTrackVideo.h"
36
37// sub elements
38#include "matroska/KaxContexts.h"
39
40START_LIBMATROSKA_NAMESPACE
41
42#if MATROSKA_VERSION == 1
43const EbmlSemantic KaxTrackVideo_ContextList[10] =
44#else // MATROSKA_VERSION
45const EbmlSemantic KaxTrackVideo_ContextList[15] =
46#endif // MATROSKA_VERSION
47{
48	EbmlSemantic(true , true, KaxVideoPixelWidth::ClassInfos),
49	EbmlSemantic(true , true, KaxVideoPixelHeight::ClassInfos),
50	EbmlSemantic(false, true, KaxVideoPixelCropBottom::ClassInfos),
51	EbmlSemantic(false, true, KaxVideoPixelCropTop::ClassInfos),
52	EbmlSemantic(false, true, KaxVideoPixelCropLeft::ClassInfos),
53	EbmlSemantic(false, true, KaxVideoPixelCropRight::ClassInfos),
54	EbmlSemantic(false, true, KaxVideoDisplayWidth::ClassInfos),
55	EbmlSemantic(false, true, KaxVideoDisplayHeight::ClassInfos),
56	EbmlSemantic(false, true, KaxVideoColourSpace::ClassInfos),
57	EbmlSemantic(false, true, KaxVideoFrameRate::ClassInfos),
58#if MATROSKA_VERSION >= 2
59	EbmlSemantic(true , true, KaxVideoFlagInterlaced::ClassInfos),
60	EbmlSemantic(false, true, KaxVideoStereoMode::ClassInfos),
61	EbmlSemantic(false, true, KaxVideoDisplayUnit::ClassInfos),
62	EbmlSemantic(false, true, KaxVideoAspectRatio::ClassInfos),
63	EbmlSemantic(false, true, KaxVideoGamma::ClassInfos),
64#endif // MATROSKA_VERSION
65};
66
67const EbmlSemanticContext KaxTrackVideo_Context = EbmlSemanticContext(countof(KaxTrackVideo_ContextList), KaxTrackVideo_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &KaxTrackVideo::ClassInfos);
68const EbmlSemanticContext KaxVideoPixelWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelWidth::ClassInfos);
69const EbmlSemanticContext KaxVideoPixelHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelHeight::ClassInfos);
70const EbmlSemanticContext KaxVideoPixelCropBottom_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropBottom::ClassInfos);
71const EbmlSemanticContext KaxVideoPixelCropTop_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropTop::ClassInfos);
72const EbmlSemanticContext KaxVideoPixelCropRight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropLeft::ClassInfos);
73const EbmlSemanticContext KaxVideoPixelCropLeft_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropRight::ClassInfos);
74const EbmlSemanticContext KaxVideoDisplayWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayWidth::ClassInfos);
75const EbmlSemanticContext KaxVideoDisplayHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayHeight::ClassInfos);
76const EbmlSemanticContext KaxVideoColourSpace_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoColourSpace::ClassInfos);
77const EbmlSemanticContext KaxVideoFrameRate_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoFrameRate::ClassInfos);
78#if MATROSKA_VERSION >= 2
79const EbmlSemanticContext KaxVideoFlagInterlaced_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoFlagInterlaced::ClassInfos);
80const EbmlSemanticContext KaxVideoStereoMode_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoStereoMode::ClassInfos);
81const EbmlSemanticContext KaxVideoDisplayUnit_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayUnit::ClassInfos);
82const EbmlSemanticContext KaxVideoAspectRatio_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoAspectRatio::ClassInfos);
83const EbmlSemanticContext KaxVideoGamma_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoGamma::ClassInfos);
84#endif // MATROSKA_VERSION
85
86EbmlId KaxTrackVideo_TheId          (0xE0, 1);
87EbmlId KaxVideoPixelWidth_TheId     (0xB0, 1);
88EbmlId KaxVideoPixelHeight_TheId    (0xBA, 1);
89EbmlId KaxVideoPixelCropBottom_TheId(0x54AA, 2);
90EbmlId KaxVideoPixelCropTop_TheId   (0x54BB, 2);
91EbmlId KaxVideoPixelCropLeft_TheId  (0x54CC, 2);
92EbmlId KaxVideoPixelCropRight_TheId (0x54DD, 2);
93EbmlId KaxVideoDisplayWidth_TheId   (0x54B0, 2);
94EbmlId KaxVideoDisplayHeight_TheId  (0x54BA, 2);
95EbmlId KaxVideoColourSpace_TheId    (0x2EB524, 3);
96EbmlId KaxVideoFrameRate_TheId      (0x2383E3, 3);
97#if MATROSKA_VERSION >= 2
98EbmlId KaxVideoFlagInterlaced_TheId (0x9A, 1);
99EbmlId KaxVideoStereoMode_TheId     (0x53B9, 2);
100EbmlId KaxVideoDisplayUnit_TheId    (0x54B2, 2);
101EbmlId KaxVideoAspectRatio_TheId    (0x54B3, 1);
102EbmlId KaxVideoGamma_TheId          (0x2FB523, 3);
103#endif // MATROSKA_VERSION
104
105const EbmlCallbacks KaxTrackVideo::ClassInfos(KaxTrackVideo::Create, KaxTrackVideo_TheId, "TrackAudio", KaxTrackVideo_Context);
106const EbmlCallbacks KaxVideoPixelWidth::ClassInfos(KaxVideoPixelWidth::Create, KaxVideoPixelWidth_TheId, "VideoPixelWidth", KaxVideoPixelWidth_Context);
107const EbmlCallbacks KaxVideoPixelHeight::ClassInfos(KaxVideoPixelHeight::Create, KaxVideoPixelHeight_TheId, "VideoPixelHeight", KaxVideoPixelHeight_Context);
108const EbmlCallbacks KaxVideoPixelCropBottom::ClassInfos(KaxVideoPixelCropBottom::Create, KaxVideoPixelCropBottom_TheId, "VideoPixelCropBottom", KaxVideoPixelCropBottom_Context);
109const EbmlCallbacks KaxVideoPixelCropTop::ClassInfos(KaxVideoPixelCropTop::Create, KaxVideoPixelCropTop_TheId, "VideoPixelCropTop", KaxVideoPixelCropTop_Context);
110const EbmlCallbacks KaxVideoPixelCropLeft::ClassInfos(KaxVideoPixelCropLeft::Create, KaxVideoPixelCropLeft_TheId, "VideoPixelCropLeft", KaxVideoPixelCropLeft_Context);
111const EbmlCallbacks KaxVideoPixelCropRight::ClassInfos(KaxVideoPixelCropRight::Create, KaxVideoPixelCropRight_TheId, "VideoPixelCropRight", KaxVideoPixelCropRight_Context);
112const EbmlCallbacks KaxVideoDisplayWidth::ClassInfos(KaxVideoDisplayWidth::Create, KaxVideoDisplayWidth_TheId, "VideoDisplayWidth", KaxVideoDisplayWidth_Context);
113const EbmlCallbacks KaxVideoDisplayHeight::ClassInfos(KaxVideoDisplayHeight::Create, KaxVideoDisplayHeight_TheId, "VideoDisplayHeight", KaxVideoDisplayHeight_Context);
114const EbmlCallbacks KaxVideoColourSpace::ClassInfos(KaxVideoColourSpace::Create, KaxVideoColourSpace_TheId, "VideoColourSpace", KaxVideoColourSpace_Context);
115const EbmlCallbacks KaxVideoFrameRate::ClassInfos(KaxVideoFrameRate::Create, KaxVideoFrameRate_TheId, "VideoFrameRate", KaxVideoFrameRate_Context);
116#if MATROSKA_VERSION >= 2
117const EbmlCallbacks KaxVideoFlagInterlaced::ClassInfos(KaxVideoFlagInterlaced::Create, KaxVideoFlagInterlaced_TheId, "VideoFlagInterlaced", KaxVideoFlagInterlaced_Context);
118const EbmlCallbacks KaxVideoStereoMode::ClassInfos(KaxVideoStereoMode::Create, KaxVideoStereoMode_TheId, "VideoStereoMode", KaxVideoStereoMode_Context);
119const EbmlCallbacks KaxVideoDisplayUnit::ClassInfos(KaxVideoDisplayUnit::Create, KaxVideoDisplayUnit_TheId, "VideoDisplayUnit", KaxVideoDisplayUnit_Context);
120const EbmlCallbacks KaxVideoAspectRatio::ClassInfos(KaxVideoAspectRatio::Create, KaxVideoAspectRatio_TheId, "VideoAspectRatio", KaxVideoAspectRatio_Context);
121const EbmlCallbacks KaxVideoGamma::ClassInfos(KaxVideoGamma::Create, KaxVideoGamma_TheId, "VideoGamma", KaxVideoGamma_Context);
122#endif // MATROSKA_VERSION
123
124KaxTrackVideo::KaxTrackVideo()
125	:EbmlMaster(KaxTrackVideo_Context)
126{}
127
128uint32 KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault)
129{
130	assert(false); // no you are not allowed to use this element !
131	return 0;
132}
133
134END_LIBMATROSKA_NAMESPACE
135