kodi
dvd_types.h
1 /*
2  * Copyright (C) 2000, 2001 Björn Englund, Håkan Hjort
3  *
4  * This file is part of libdvdnav, a DVD navigation library. It is a modified
5  * file originally part of the Ogle DVD player project.
6  *
7  * libdvdnav is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * libdvdnav is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with libdvdnav; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 /*
23  * Various useful structs and enums for DVDs.
24  */
25 
26 #pragma once
27 
28 #include <stdint.h>
29 
30 /*
31  * DVD Menu ID
32  * (see dvdnav_menu_call())
33  */
34 typedef enum {
35  /* When used in VTS domain, DVD_MENU_Escape behaves like DVD_MENU_Root,
36  * but from within a menu domain, DVD_MENU_Escape resumes playback. */
37  DVD_MENU_Escape = 0,
38  DVD_MENU_Title = 2,
39  DVD_MENU_Root = 3,
40  DVD_MENU_Subpicture = 4,
41  DVD_MENU_Audio = 5,
42  DVD_MENU_Angle = 6,
43  DVD_MENU_Part = 7
44 } DVDMenuID_t;
45 
46 /*
47  * Stream Types
48  * (see dvdnav_get_number_of_streams())
49  */
50 typedef enum
51 {
52  DVD_SUBTITLE_STREAM = 0,
53  DVD_AUDIO_STREAM = 1
54 } dvdnav_stream_type_t;
55 
56 /* Domain */
57 typedef enum
58 {
59  DVD_DOMAIN_FirstPlay = 1, /* First Play Domain */
60  DVD_DOMAIN_VTSTitle = 2, /* Video Title Set Domain */
61  DVD_DOMAIN_VMGM = 4, /* Video Manager Domain */
62  DVD_DOMAIN_VTSMenu = 8 /* Video Title Set Menu Domain */
63 } DVDDomain_t;
64 
65 /*
66  * Structure containing info on highlight areas
67  * (see dvdnav_get_highlight_area())
68  */
69 typedef struct {
70  uint32_t palette; /* The CLUT entries for the highlight palette
71  (4-bits per entry -> 4 entries) */
72  uint16_t sx,sy,ex,ey; /* The start/end x,y positions */
73  uint32_t pts; /* Highlight PTS to match with SPU */
74 
75  /* button number for the SPU decoder/overlaying engine */
76  uint32_t buttonN;
78 
79 /* The audio format */
80 typedef enum
81 {
82  DVD_AUDIO_FORMAT_AC3 = 0,
83  DVD_AUDIO_FORMAT_UNKNOWN_1 = 1,
84  DVD_AUDIO_FORMAT_MPEG = 2,
85  DVD_AUDIO_FORMAT_MPEG2_EXT = 3,
86  DVD_AUDIO_FORMAT_LPCM = 4,
87  DVD_AUDIO_FORMAT_UNKNOWN_5 = 5,
88  DVD_AUDIO_FORMAT_DTS = 6,
89  DVD_AUDIO_FORMAT_SDDS = 7
90 } DVDAudioFormat_t;
91 
92 /* the following types are currently unused */
93 
94 #if 0
95 
96 /* User operation permissions */
97 typedef enum {
98  UOP_FLAG_TitleOrTimePlay = 0x00000001,
99  UOP_FLAG_ChapterSearchOrPlay = 0x00000002,
100  UOP_FLAG_TitlePlay = 0x00000004,
101  UOP_FLAG_Stop = 0x00000008,
102  UOP_FLAG_GoUp = 0x00000010,
103  UOP_FLAG_TimeOrChapterSearch = 0x00000020,
104  UOP_FLAG_PrevOrTopPGSearch = 0x00000040,
105  UOP_FLAG_NextPGSearch = 0x00000080,
106  UOP_FLAG_ForwardScan = 0x00000100,
107  UOP_FLAG_BackwardScan = 0x00000200,
108  UOP_FLAG_TitleMenuCall = 0x00000400,
109  UOP_FLAG_RootMenuCall = 0x00000800,
110  UOP_FLAG_SubPicMenuCall = 0x00001000,
111  UOP_FLAG_AudioMenuCall = 0x00002000,
112  UOP_FLAG_AngleMenuCall = 0x00004000,
113  UOP_FLAG_ChapterMenuCall = 0x00008000,
114  UOP_FLAG_Resume = 0x00010000,
115  UOP_FLAG_ButtonSelectOrActivate = 0x00020000,
116  UOP_FLAG_StillOff = 0x00040000,
117  UOP_FLAG_PauseOn = 0x00080000,
118  UOP_FLAG_AudioStreamChange = 0x00100000,
119  UOP_FLAG_SubPicStreamChange = 0x00200000,
120  UOP_FLAG_AngleChange = 0x00400000,
121  UOP_FLAG_KaraokeAudioPresModeChange = 0x00800000,
122  UOP_FLAG_VideoPresModeChange = 0x01000000
123 } DVDUOP_t;
124 
125 /* Parental Level */
126 typedef enum {
127  DVD_PARENTAL_LEVEL_1 = 1,
128  DVD_PARENTAL_LEVEL_2 = 2,
129  DVD_PARENTAL_LEVEL_3 = 3,
130  DVD_PARENTAL_LEVEL_4 = 4,
131  DVD_PARENTAL_LEVEL_5 = 5,
132  DVD_PARENTAL_LEVEL_6 = 6,
133  DVD_PARENTAL_LEVEL_7 = 7,
134  DVD_PARENTAL_LEVEL_8 = 8,
135  DVD_PARENTAL_LEVEL_None = 15
136 } DVDParentalLevel_t;
137 
138 /* Language ID (ISO-639 language code) */
139 typedef uint16_t DVDLangID_t;
140 
141 /* Country ID (ISO-3166 country code) */
142 typedef uint16_t DVDCountryID_t;
143 
144 /* Register */
145 typedef uint16_t DVDRegister_t;
146 typedef enum {
147  DVDFalse = 0,
148  DVDTrue = 1
149 } DVDBool_t;
150 typedef DVDRegister_t DVDGPRMArray_t[16];
151 typedef DVDRegister_t DVDSPRMArray_t[24];
152 
153 /* Navigation */
154 typedef int DVDStream_t;
155 typedef int DVDPTT_t;
156 typedef int DVDTitle_t;
157 
158 /* Angle number (1-9 or default?) */
159 typedef int DVDAngle_t;
160 
161 /* Timecode */
162 typedef struct {
163  uint8_t Hours;
164  uint8_t Minutes;
165  uint8_t Seconds;
166  uint8_t Frames;
167 } DVDTimecode_t;
168 
169 /* Subpicture stream number (0-31,62,63) */
170 typedef int DVDSubpictureStream_t;
171 
172 /* Audio stream number (0-7, 15(none)) */
173 typedef int DVDAudioStream_t;
174 
175 /* The audio application mode */
176 typedef enum {
177  DVD_AUDIO_APP_MODE_None = 0,
178  DVD_AUDIO_APP_MODE_Karaoke = 1,
179  DVD_AUDIO_APP_MODE_Surround = 2,
180  DVD_AUDIO_APP_MODE_Other = 3
181 } DVDAudioAppMode_t;
182 
183 /* Audio language extension */
184 typedef enum {
185  DVD_AUDIO_LANG_EXT_NotSpecified = 0,
186  DVD_AUDIO_LANG_EXT_NormalCaptions = 1,
187  DVD_AUDIO_LANG_EXT_VisuallyImpaired = 2,
188  DVD_AUDIO_LANG_EXT_DirectorsComments1 = 3,
189  DVD_AUDIO_LANG_EXT_DirectorsComments2 = 4
190 } DVDAudioLangExt_t;
191 
192 /* Subpicture language extension */
193 typedef enum {
194  DVD_SUBPICTURE_LANG_EXT_NotSpecified = 0,
195  DVD_SUBPICTURE_LANG_EXT_NormalCaptions = 1,
196  DVD_SUBPICTURE_LANG_EXT_BigCaptions = 2,
197  DVD_SUBPICTURE_LANG_EXT_ChildrensCaptions = 3,
198  DVD_SUBPICTURE_LANG_EXT_NormalCC = 5,
199  DVD_SUBPICTURE_LANG_EXT_BigCC = 6,
200  DVD_SUBPICTURE_LANG_EXT_ChildrensCC = 7,
201  DVD_SUBPICTURE_LANG_EXT_Forced = 9,
202  DVD_SUBPICTURE_LANG_EXT_NormalDirectorsComments = 13,
203  DVD_SUBPICTURE_LANG_EXT_BigDirectorsComments = 14,
204  DVD_SUBPICTURE_LANG_EXT_ChildrensDirectorsComments = 15,
205 } DVDSubpictureLangExt_t;
206 
207 /* Karaoke Downmix mode */
208 typedef enum {
209  DVD_KARAOKE_DOWNMIX_0to0 = 0x0001,
210  DVD_KARAOKE_DOWNMIX_1to0 = 0x0002,
211  DVD_KARAOKE_DOWNMIX_2to0 = 0x0004,
212  DVD_KARAOKE_DOWNMIX_3to0 = 0x0008,
213  DVD_KARAOKE_DOWNMIX_4to0 = 0x0010,
214  DVD_KARAOKE_DOWNMIX_Lto0 = 0x0020,
215  DVD_KARAOKE_DOWNMIX_Rto0 = 0x0040,
216  DVD_KARAOKE_DOWNMIX_0to1 = 0x0100,
217  DVD_KARAOKE_DOWNMIX_1to1 = 0x0200,
218  DVD_KARAOKE_DOWNMIX_2to1 = 0x0400,
219  DVD_KARAOKE_DOWNMIX_3to1 = 0x0800,
220  DVD_KARAOKE_DOWNMIX_4to1 = 0x1000,
221  DVD_KARAOKE_DOWNMIX_Lto1 = 0x2000,
222  DVD_KARAOKE_DOWNMIX_Rto1 = 0x4000
223 } DVDKaraokeDownmix_t;
224 typedef int DVDKaraokeDownmixMask_t;
225 
226 /* Display mode */
227 typedef enum {
228  DVD_DISPLAY_MODE_ContentDefault = 0,
229  DVD_DISPLAY_MODE_16x9 = 1,
230  DVD_DISPLAY_MODE_4x3PanScan = 2,
231  DVD_DISPLAY_MODE_4x3Letterboxed = 3
232 } DVDDisplayMode_t;
233 
234 /* Audio attributes */
235 typedef struct {
236  DVDAudioAppMode_t AppMode;
237  DVDAudioFormat_t AudioFormat;
238  DVDLangID_t Language;
239  DVDAudioLangExt_t LanguageExtension;
240  DVDBool_t HasMultichannelInfo;
241  DVDAudioSampleFreq_t SampleFrequency;
242  DVDAudioSampleQuant_t SampleQuantization;
243  DVDChannelNumber_t NumberOfChannels;
244 } DVDAudioAttributes_t;
245 typedef int DVDAudioSampleFreq_t;
246 typedef int DVDAudioSampleQuant_t;
247 typedef int DVDChannelNumber_t;
248 
249 /* Subpicture attributes */
250 typedef enum {
251  DVD_SUBPICTURE_TYPE_NotSpecified = 0,
252  DVD_SUBPICTURE_TYPE_Language = 1,
253  DVD_SUBPICTURE_TYPE_Other = 2
254 } DVDSubpictureType_t;
255 typedef enum {
256  DVD_SUBPICTURE_CODING_RunLength = 0,
257  DVD_SUBPICTURE_CODING_Extended = 1,
258  DVD_SUBPICTURE_CODING_Other = 2
259 } DVDSubpictureCoding_t;
260 typedef struct {
261  DVDSubpictureType_t Type;
262  DVDSubpictureCoding_t CodingMode;
263  DVDLangID_t Language;
264  DVDSubpictureLangExt_t LanguageExtension;
265 } DVDSubpictureAttributes_t;
266 
267 /* Video attributes */
268 typedef struct {
269  DVDBool_t PanscanPermitted;
270  DVDBool_t LetterboxPermitted;
271  int AspectX;
272  int AspectY;
273  int FrameRate;
274  int FrameHeight;
275  DVDVideoCompression_t Compression;
276  DVDBool_t Line21Field1InGop;
277  DVDBool_t Line21Field2InGop;
278  int more_to_come;
279 } DVDVideoAttributes_t;
280 typedef int DVDVideoCompression_t;
281 
282 #endif
Definition: dvd_types.h:69