| 1 | /* |
|---|
| 2 | * CodecIDs.h |
|---|
| 3 | * |
|---|
| 4 | * Copyright (c) 2006 David Conrad |
|---|
| 5 | * |
|---|
| 6 | * This program is free software; you can redistribute it and/or |
|---|
| 7 | * modify it under the terms of the GNU Lesser General Public |
|---|
| 8 | * License as published by the Free Software Foundation; |
|---|
| 9 | * version 2.1 of the License. |
|---|
| 10 | * |
|---|
| 11 | * This program is distributed in the hope that it will be useful, |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 14 | * Lesser General Public License for more details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU Lesser General Public |
|---|
| 17 | * License along with this program; if not, write to the Free Software |
|---|
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 19 | * |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #ifndef __CODECIDS_H__ |
|---|
| 23 | #define __CODECIDS_H__ |
|---|
| 24 | |
|---|
| 25 | enum { |
|---|
| 26 | // these are atoms/extension types defined by XiphQT for their codecs |
|---|
| 27 | kCookieTypeOggSerialNo = 'oCtN', |
|---|
| 28 | |
|---|
| 29 | kCookieTypeVorbisHeader = 'vCtH', |
|---|
| 30 | kCookieTypeVorbisComments = 'vCt#', |
|---|
| 31 | kCookieTypeVorbisCodebooks = 'vCtC', |
|---|
| 32 | kCookieTypeVorbisFirstPageNo = 'vCtN', |
|---|
| 33 | |
|---|
| 34 | kCookieTypeSpeexHeader = 'sCtH', |
|---|
| 35 | kCookieTypeSpeexComments = 'sCt#', |
|---|
| 36 | kCookieTypeSpeexExtraHeader = 'sCtX', |
|---|
| 37 | |
|---|
| 38 | kCookieTypeTheoraHeader = 'tCtH', |
|---|
| 39 | kCookieTypeTheoraComments = 'tCt#', |
|---|
| 40 | kCookieTypeTheoraCodebooks = 'tCtC', |
|---|
| 41 | |
|---|
| 42 | kCookieTypeFLACStreaminfo = 'fCtS', |
|---|
| 43 | kCookieTypeFLACMetadata = 'fCtM', |
|---|
| 44 | |
|---|
| 45 | kTheoraDescExtension = 'XdxT', |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | // contains same as MKV's codec private for real video |
|---|
| 49 | kRealVideoExtension = 'RVex', |
|---|
| 50 | |
|---|
| 51 | // contains the .idx file for vobsub (codec private in mkv) |
|---|
| 52 | kVobSubIdxExtension = '.IDX', |
|---|
| 53 | |
|---|
| 54 | // contains a single byte equal to the ContentCompAlgo element in matroska |
|---|
| 55 | kMKVCompressionExtension = 'MCmp', |
|---|
| 56 | }; |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | enum { |
|---|
| 60 | // XiphQT's codec IDs |
|---|
| 61 | kAudioFormatXiphVorbis = 'XiVs', |
|---|
| 62 | kAudioFormatXiphSpeex = 'XiSp', |
|---|
| 63 | kAudioFormatXiphFLAC = 'XiFL', |
|---|
| 64 | kVideoFormatXiphTheora = 'XiTh', |
|---|
| 65 | |
|---|
| 66 | // the samples for these codec IDs are OGG pages containing the actual codec data |
|---|
| 67 | kAudioFormatXiphOggFramedVorbis = 'XoVs', |
|---|
| 68 | kAudioFormatXiphOggFramedSpeex = 'XoSp', |
|---|
| 69 | kAudioFormatXiphOggFramedFLAC = 'XoFL', |
|---|
| 70 | |
|---|
| 71 | // these are 'ms' + the wav/avi twocc |
|---|
| 72 | kAudioFormatAC3MS = 0x6D732000, |
|---|
| 73 | kAudioFormatWMA1MS = 0x6D730160, |
|---|
| 74 | kAudioFormatWMA2MS = 0x6D730161, |
|---|
| 75 | |
|---|
| 76 | kVideoFormatMSMPEG4v3 = 'MP43', |
|---|
| 77 | kMPEG1VisualCodecType = 'MPEG', |
|---|
| 78 | kMPEG2VisualCodecType = 'MPG2', |
|---|
| 79 | kVideoFormatReal5 = 'RV10', |
|---|
| 80 | kVideoFormatRealG2 = 'RV20', |
|---|
| 81 | kVideoFormatReal8 = 'RV30', |
|---|
| 82 | kVideoFormatReal9 = 'RV40', |
|---|
| 83 | kVideoFormatSnow = 'SNOW', |
|---|
| 84 | kVideoFormatIndeo2 = 'RT21', |
|---|
| 85 | kVideoFormatIndeo3 = 'IV32', |
|---|
| 86 | |
|---|
| 87 | kAudioFormatFlashADPCM = 'FlAd', |
|---|
| 88 | kAudioFormatDTS = 'DTS ', |
|---|
| 89 | kAudioFormatTTA = 'TTA1', |
|---|
| 90 | kAudioFormatWavepack = 'WVPK', |
|---|
| 91 | kAudioFormatReal1 = '14_4', |
|---|
| 92 | kAudioFormatReal2 = '28_8', |
|---|
| 93 | kAudioFormatRealCook = 'COOK', |
|---|
| 94 | kAudioFormatRealSipro = 'SIPR', |
|---|
| 95 | kAudioFormatRealLossless = 'RALF', |
|---|
| 96 | kAudioFormatRealAtrac3 = 'ATRC', |
|---|
| 97 | kAudioFormatNellymoser = 'NELL', |
|---|
| 98 | |
|---|
| 99 | kSubFormatUTF8 = 'SRT ', |
|---|
| 100 | kSubFormatSSA = 'SSA ', |
|---|
| 101 | kSubFormatASS = 'ASS ', |
|---|
| 102 | kSubFormatUSF = 'USF ', |
|---|
| 103 | kSubFormatVobSub = 'SPU ', |
|---|
| 104 | }; |
|---|
| 105 | |
|---|
| 106 | #ifndef REZ |
|---|
| 107 | struct WaveFormatEx { |
|---|
| 108 | uint16_t wFormatTag; |
|---|
| 109 | uint16_t nChannels; |
|---|
| 110 | uint32_t nSamplesPerSec; |
|---|
| 111 | uint32_t nAvgBytesPerSec; |
|---|
| 112 | uint16_t nBlockAlign; |
|---|
| 113 | uint16_t wBitsPerSample; |
|---|
| 114 | uint16_t cbSize; |
|---|
| 115 | } __attribute__((packed)); |
|---|
| 116 | |
|---|
| 117 | typedef struct WaveFormatEx WaveFormatEx; |
|---|
| 118 | |
|---|
| 119 | int getCodecID(OSType componentType); |
|---|
| 120 | pascal ComponentResult getPerianCodecInfo(ComponentInstance self, OSType componentType, void *info); |
|---|
| 121 | #endif |
|---|
| 122 | |
|---|
| 123 | #endif |
|---|