Changeset 218
- Timestamp:
- 12/30/06 18:32:53 (2 years ago)
- Files:
-
- trunk/CodecIDs.h (added)
- trunk/MatroskaCodecIDs.cpp (modified) (1 diff)
- trunk/MatroskaCodecIDs.h (modified) (3 diffs)
- trunk/MkvMovieSetup.cpp (modified) (2 diffs)
- trunk/SubImport.h (modified) (1 diff)
- trunk/TextSubCodec.h (modified) (1 diff)
- trunk/TextSubCodec.r (modified) (1 diff)
- trunk/VobSubCodec.c (modified) (1 diff)
- trunk/VobSubCodec.h (modified) (1 diff)
- trunk/VobSubCodec.r (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaCodecIDs.cpp
r163 r218 438 438 return noErr; 439 439 } 440 441 ComponentResult MkvFinishSampleDescription(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir) 442 { 443 switch ((*desc)->dataFormat) { 444 case kH264CodecType: 445 return DescExt_H264(tr_entry, desc, dir); 446 447 case kAudioFormatXiphVorbis: 448 return DescExt_XiphVorbis(tr_entry, desc, dir); 449 450 case kAudioFormatXiphFLAC: 451 return DescExt_XiphFLAC(tr_entry, desc, dir); 452 453 case kSubFormatVobSub: 454 return DescExt_VobSub(tr_entry, desc, dir); 455 456 case kVideoFormatReal5: 457 case kVideoFormatRealG2: 458 case kVideoFormatReal8: 459 case kVideoFormatReal9: 460 return DescExt_Real(tr_entry, desc, dir); 461 462 case kMPEG4VisualCodecType: 463 return DescExt_mp4v(tr_entry, desc, dir); 464 } 465 return noErr; 466 } 467 468 ComponentResult MkvFinishASBD(KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd) 469 { 470 switch (asbd->mFormatID) { 471 case kAudioFormatMPEG4AAC: 472 return ASBDExt_AAC(tr_entry, asbd); 473 474 case kAudioFormatAC3: 475 return ASBDExt_AC3(tr_entry, asbd); 476 477 case kAudioFormatLinearPCM: 478 return ASBDExt_LPCM(tr_entry, asbd); 479 } 480 return noErr; 481 } 482 440 483 441 484 short GetTrackLanguage(KaxTrackEntry *tr_entry) { trunk/MatroskaCodecIDs.h
r163 r218 30 30 #include <matroska/KaxTracks.h> 31 31 #include <matroska/KaxTrackEntryData.h> 32 #include "CodecIDs.h" 33 32 34 using namespace libmatroska; 33 34 35 // Description Extensions36 enum {37 kCookieTypeOggSerialNo = 'oCtN'38 };39 40 // format specific cookie types41 enum {42 kCookieTypeVorbisHeader = 'vCtH',43 kCookieTypeVorbisComments = 'vCt#',44 kCookieTypeVorbisCodebooks = 'vCtC',45 kCookieTypeVorbisFirstPageNo = 'vCtN'46 };47 48 enum {49 kCookieTypeSpeexHeader = 'sCtH',50 kCookieTypeSpeexComments = 'sCt#',51 kCookieTypeSpeexExtraHeader = 'sCtX'52 };53 54 enum {55 kCookieTypeTheoraHeader = 'tCtH',56 kCookieTypeTheoraComments = 'tCt#',57 kCookieTypeTheoraCodebooks = 'tCtC'58 };59 60 enum {61 kCookieTypeFLACStreaminfo = 'fCtS',62 kCookieTypeFLACMetadata = 'fCtM'63 };64 65 enum {66 kSampleDescriptionExtensionTheora = 'XdxT',67 kSampleDescriptionExtensionVobSubIdx = '.IDX',68 kSampleDescriptionExtensionReal = 'RVex',69 };70 71 72 enum {73 // unofficial QuickTime FourCCs74 kAudioFormatXiphVorbis = 'XiVs',75 kAudioFormatXiphSpeex = 'XiSp',76 kAudioFormatXiphFLAC = 'XiFL',77 kVideoFormatXiphTheora = 'XiTh',78 kAudioFormatAC3MS = 0x6D732000,79 kVideoFormatMSMPEG4v3 = 'MP43',80 81 kSubFormatUTF8 = 'SRT ',82 kSubFormatSSA = 'SSA ',83 kSubFormatASS = 'ASS ',84 kSubFormatUSF = 'USF ',85 kSubFormatVobSub = 'SPU ',86 87 // the following 4CCs don't have decoder support yet88 kMPEG1VisualCodecType = 'mp1v',89 kMPEG2VisualCodecType = 'mp2v',90 kAudioFormatDTS = 'DTS ',91 kAudioFormatTTA = 'TTA1',92 kAudioFormatWavepack = 'WVPK',93 kVideoFormatReal5 = 'RV10',94 kVideoFormatRealG2 = 'RV20',95 kVideoFormatReal8 = 'RV30',96 kVideoFormatReal9 = 'RV40',97 kAudioFormatReal1 = '14_4',98 kAudioFormatReal2 = '28_8',99 kAudioFormatRealCook = 'COOK',100 kAudioFormatRealSipro = 'SIPR',101 kAudioFormatRealLossless = 'RALF',102 kAudioFormatRealAtrac3 = 'ATRC'103 };104 105 35 106 36 … … 115 45 116 46 117 // these functions modify the AudioStreamBasicDescription properly for the audio format118 ComponentResult ASBDExt_AC3(KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd);119 ComponentResult ASBDExt_LPCM(KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd);120 ComponentResult ASBDExt_AAC(KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd);121 122 123 struct ASBDExtensionFunc {124 OSType cType;125 ComponentResult (*finishASBD) (KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd);126 };127 128 const struct ASBDExtensionFunc kMatroskaASBDExtensionFuncs[] = {129 { kAudioFormatMPEG4AAC, ASBDExt_AAC },130 { kAudioFormatAC3, ASBDExt_AC3 },131 { kAudioFormatLinearPCM, ASBDExt_LPCM }132 };133 134 135 47 typedef enum { 136 48 kToKaxTrackEntry, … … 138 50 } DescExtDirection; 139 51 140 // these functions set/read extensions to the ImageDescription/SoundDescription 141 ComponentResult DescExt_H264(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 142 ComponentResult DescExt_XiphVorbis(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 143 ComponentResult DescExt_XiphFLAC(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 144 ComponentResult DescExt_VobSub(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 145 ComponentResult DescExt_Real(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 146 ComponentResult DescExt_mp4v(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 147 148 149 struct CodecDescExtFunc { 150 OSType cType; 151 ComponentResult (*descExtension) (KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 152 }; 153 154 const struct CodecDescExtFunc kMatroskaSampleDescExtFuncs[] = { 155 { kH264CodecType, DescExt_H264 }, 156 { kAudioFormatXiphVorbis, DescExt_XiphVorbis }, 157 { kAudioFormatXiphFLAC, DescExt_XiphFLAC }, 158 { kSubFormatVobSub, DescExt_VobSub }, 159 { kVideoFormatReal5, DescExt_Real }, 160 { kVideoFormatRealG2, DescExt_Real }, 161 { kVideoFormatReal8, DescExt_Real }, 162 { kVideoFormatReal9, DescExt_Real }, 163 { kMPEG4VisualCodecType, DescExt_mp4v }, 164 }; 165 166 52 ComponentResult MkvFinishSampleDescription(KaxTrackEntry *tr_entry, SampleDescriptionHandle desc, DescExtDirection dir); 53 ComponentResult MkvFinishASBD(KaxTrackEntry *tr_entry, AudioStreamBasicDescription *asbd); 167 54 short GetTrackLanguage(KaxTrackEntry *tr_entry); 168 55 FourCharCode GetFourCC(KaxTrackEntry *tr_entry); trunk/MkvMovieSetup.cpp
r217 r218 501 501 asbd.mChannelsPerFrame = uint32(*numChannels); 502 502 503 for (int i = 0; i < sizeof(kMatroskaASBDExtensionFuncs) / sizeof(struct ASBDExtensionFunc); i++) { 504 if (asbd.mFormatID == kMatroskaASBDExtensionFuncs[i].cType) { 505 kMatroskaASBDExtensionFuncs[i].finishASBD(tr_entry, &asbd); 506 break; 507 } 508 } 503 MkvFinishASBD(tr_entry, &asbd); 509 504 510 505 // get more info about the codec … … 817 812 #endif 818 813 } else { 819 for (int i = 0; i < sizeof(kMatroskaSampleDescExtFuncs) / sizeof(struct CodecDescExtFunc); i++) { 820 if ((*desc)->dataFormat == kMatroskaSampleDescExtFuncs[i].cType) { 821 kMatroskaSampleDescExtFuncs[i].descExtension(tr_entry, desc, kToSampleDescription); 822 break; 823 } 824 } 825 } 826 } 814 MkvFinishSampleDescription(tr_entry, desc, kToSampleDescription); 815 } 816 } trunk/SubImport.h
r158 r218 12 12 13 13 #include <QuickTime/QuickTime.h> 14 15 #define kSubFormatUTF8 'SRT ' 14 #include "CodecIDs.h" 16 15 17 16 #ifdef __cplusplus trunk/TextSubCodec.h
r143 r218 7 7 * 8 8 */ 9 10 11 #define kPlainTextSub 'SRT ' 9 #include "CodecIDs.h" 12 10 13 11 #define kTextSubCodecFormatName "Text Subtitle" trunk/TextSubCodec.r
r143 r218 90 90 resource 'thng' (kTextSubCodecResource) { 91 91 decompressorComponentType, // Type 92 k PlainTextSub, // SubType92 kSubFormatUTF8, // SubType 93 93 kManufacturer, // Manufacturer 94 94 // - use componentHasMultiplePlatforms trunk/VobSubCodec.c
r166 r218 418 418 Handle descExtension = NewHandle(0); 419 419 420 err = GetImageDescriptionExtension(imageDescription, &descExtension, k IDXExtension, 1);420 err = GetImageDescriptionExtension(imageDescription, &descExtension, kSampleDescriptionExtensionVobSubIdx, 1); 421 421 422 422 char *string = (char *) *descExtension; trunk/VobSubCodec.h
r141 r218 7 7 * 8 8 */ 9 #include "CodecIDs.h" 9 10 10 11 // The high word is the codecInterfaceVersion 11 12 #define kVobSubCodecVersion (0x00020001) 12 13 #define kVobSubCodec 'SPU '14 #define kIDXExtension '.IDX'15 13 16 14 #define kVobSubCodecFormatName "VobSub" trunk/VobSubCodec.r
r141 r218 91 91 resource 'thng' (kVobSubCodecResource) { 92 92 decompressorComponentType, // Type 93 k VobSubCodec, // SubType93 kSubFormatVobSub, // SubType 94 94 kManufacturer, // Manufacturer 95 95 // - use componentHasMultiplePlatforms
