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