From 719c3f9c606ce7b1bff99aa8031bff9c3dd34a8c Mon Sep 17 00:00:00 2001 From: gbooker Date: Thu, 30 Jul 2009 17:18:09 +0000 Subject: [PATCH] Switched to another new codec list system. This should be siginificantly easier than past mechanisms git-svn-id: https://svn.perian.org/trunk@1119 621663c8-3916-0410-8f58-edc14a8543d5 --- CodecIDs.h | 4 + FFissionCodec/FFissionCodec.r | 105 ---------- FFusionCodec.c | 179 ++--------------- FFusionCodec.r | 335 ------------------------------- Perian.xcodeproj/project.pbxproj | 63 ++++-- PerianResourceIDs.h | 76 ------- PerianResourceIDs.h.m4 | 26 +++ TextSubCodec.r | 59 ------ VobSubCodec.r | 53 ----- codecID.c.m4 | 28 +++ codecList.m4 | 59 ++++++ codecResources.r.m4 | 33 +++ defines.m4 | 8 + scripts/generateCodecIDs.sh | 3 + 14 files changed, 220 insertions(+), 811 deletions(-) delete mode 100644 FFissionCodec/FFissionCodec.r delete mode 100644 FFusionCodec.r delete mode 100644 PerianResourceIDs.h create mode 100644 PerianResourceIDs.h.m4 delete mode 100755 TextSubCodec.r delete mode 100755 VobSubCodec.r create mode 100644 codecID.c.m4 create mode 100644 codecList.m4 create mode 100644 codecResources.r.m4 create mode 100644 defines.m4 create mode 100644 scripts/generateCodecIDs.sh diff --git a/CodecIDs.h b/CodecIDs.h index fdf8a64..e97e214 100644 --- a/CodecIDs.h +++ b/CodecIDs.h @@ -103,4 +103,8 @@ enum { kSubFormatVobSub = 'SPU ', }; +#ifndef REZ +int getCodecID(OSType componentType); +#endif + #endif diff --git a/FFissionCodec/FFissionCodec.r b/FFissionCodec/FFissionCodec.r deleted file mode 100644 index e532278..0000000 --- a/FFissionCodec/FFissionCodec.r +++ /dev/null @@ -1,105 +0,0 @@ -/* - * FFissionCodec.r - * - * This file is part of Perian. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define TARGET_REZ_CARBON_MACHO 1 -#define thng_RezTemplateVersion 1 // multiplatform 'thng' resource -#define cfrg_RezTemplateVersion 1 // extended version of 'cfrg' resource - -#include -#include - -#include "PerianResourceIDs.h" -#include "CodecIDs.h" - -#define AudioComponentType -#define decompressorComponentType 'adec' -#ifndef cmpThreadSafeOnMac - #define cmpThreadSafeOnMac 0x10000000 -#endif -#define kDecompressionFlags cmpThreadSafeOnMac - -#define kStartTHNGResID kWMA1MSCodecResourceID -#define kCodecManufacturer kFFissionCodecManufacturer -#define kCodecVersion kFFissionCodecVersion -#define kEntryPointID kWMA1MSCodecResourceID - -#define kCodecInfoResID kWMA1MSCodecResourceID -#define kCodecName "Windows Media Audio 1" -#define kCodecDescription "An AudioCodec that decodes WMA v1 into linear PCM" -#define kCodecSubType kAudioFormatWMA2MS -#include "PerianResources.r" - -#define kCodecInfoResID kFlashADPCMCodecResourceID -#define kCodecName "Flash ADPCM" -#define kCodecDescription "An AudioCodec that decodes Flash ADPCM into linear PCM" -#define kCodecSubType kAudioFormatFlashADPCM -#include "PerianResources.r" - -#define kEntryPointID kXiphVorbisCodecResourceID - -#define kCodecInfoResID kXiphVorbisCodecResourceID -#define kCodecName "Vorbis" -#define kCodecDescription "An AudioCodec that decodes Vorbis into linear PCM" -#define kCodecSubType kAudioFormatXiphVorbis -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG1L1CodecResourceID -#define kCodecName "MPEG-1 Layer 1" -#define kCodecDescription "An AudioCodec that decodes MPEG-1 layer 1 audio into linear PCM" -#define kCodecSubType '.mp1' -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG1L12CodecResourceID -#define kCodecName "MPEG-1 Layer 1/2" -#define kCodecDescription "An AudioCodec that decodes MPEG-1 layer 1 or 2 audio into linear PCM" -#define kCodecSubType 0x6d730050 -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG1L2CodecResourceID -#define kCodecName "MPEG-1 Layer 2" -#define kCodecDescription "An AudioCodec that decodes MPEG-1 layer 2 audio into linear PCM" -#define kCodecSubType '.mp2' -#include "PerianResources.r" - -#define kCodecInfoResID kTrueAudioCodecResourceID -#define kCodecName "True Audio" -#define kCodecDescription "An AudioCodec that decodes True Audio into linear PCM" -#define kCodecSubType kAudioFormatTTA -#include "PerianResources.r" - -#define kCodecInfoResID kDTSCodecResourceID -#define kCodecName "DTS Coherent Acoustics" -#define kCodecDescription "An AudioCodec that decodes DCA Audio into linear PCM" -#define kCodecSubType kAudioFormatDTS -#include "PerianResources.r" - -#define kCodecInfoResID kNellymoserCodecResourceID -#define kCodecName "Nellymoser ASAO" -#define kCodecDescription "An AudioCodec that decodes Nellymoser ASAO into linear PCM" -#define kCodecSubType kAudioFormatNellymoser -#include "PerianResources.r" - -resource 'dlle' (kWMA1MSCodecResourceID) { - "FFissionDecoderEntry" -}; - -resource 'dlle' (kXiphVorbisCodecResourceID) { - "FFissionVBRDecoderEntry" -}; \ No newline at end of file diff --git a/FFusionCodec.c b/FFusionCodec.c index 07719cc..4057717 100644 --- a/FFusionCodec.c +++ b/FFusionCodec.c @@ -42,6 +42,7 @@ #include "FrameBuffer.h" #include "CommonUtils.h" #include "pthread.h" +#include "CodecIDs.h" void inline swapFrame(AVFrame * *a, AVFrame * *b) { @@ -560,175 +561,23 @@ pascal ComponentResult FFusionCodecPreflight(FFusionGlobals glob, CodecDecompres if (!glob->avCodec) { - enum CodecID codecID = CODEC_ID_MPEG4; - init_FFmpeg(); initFFusionParsers(); - - switch (glob->componentType) - { - case 'MPG4': // MS-MPEG4 v1 - case 'mpg4': - case 'DIV1': - case 'div1': - codecID = CODEC_ID_MSMPEG4V1; - break; - - case 'MP42': // MS-MPEG4 v2 - case 'mp42': - case 'DIV2': - case 'div2': - codecID = CODEC_ID_MSMPEG4V2; - break; - - case 'div6': // DivX 3 - case 'DIV6': - case 'div5': - case 'DIV5': - case 'div4': - case 'DIV4': - case 'div3': - case 'DIV3': - case 'MP43': - case 'mp43': - case 'MPG3': - case 'mpg3': - case 'AP41': - case 'COL0': - case 'col0': - case 'COL1': - case 'col1': - case '3IVD': // 3ivx - case '3ivd': - codecID = CODEC_ID_MSMPEG4V3; - break; - - case 'mp4v': // MPEG4 part 2 in mov/mp4 - glob->packedType = PACKED_QUICKTIME_KNOWS_ORDER; - case 'divx': // DivX 4 - case 'DIVX': - case 'mp4s': - case 'MP4S': - case 'm4s2': - case 'M4S2': - case 0x04000000: - case 'UMP4': - case 'DX50': // DivX 5 - case 'XVID': // XVID - case 'xvid': - case 'XviD': - case 'XVIX': - case 'BLZ0': - case '3IV2': // 3ivx - case '3iv2': - case 'RMP4': // Miscellaneous - case 'SEDG': - case 'WV1F': - case 'FMP4': - case 'SMP4': - codecID = CODEC_ID_MPEG4; - break; - - case 'avc1': // H.264 in mov/mp4/mkv - glob->packedType = PACKED_QUICKTIME_KNOWS_ORDER; - case 'H264': // H.264 in AVI - case 'h264': - case 'X264': - case 'x264': - case 'AVC1': - case 'DAVC': - case 'VSSH': - codecID = CODEC_ID_H264; - break; - - case 'FLV1': - codecID = CODEC_ID_FLV1; - break; - - case 'FSV1': - codecID = CODEC_ID_FLASHSV; - break; - - case 'VP60': - case 'VP61': - case 'VP62': - codecID = CODEC_ID_VP6; - break; - - case 'VP6F': - case 'FLV4': - codecID = CODEC_ID_VP6F; - break; - case 'I263': - case 'i263': - codecID = CODEC_ID_H263I; - break; - - case 'VP30': - case 'VP31': - glob->shouldUseReturnedFrame = TRUE; - codecID = CODEC_ID_VP3; - break; - - case 'HFYU': - codecID = CODEC_ID_HUFFYUV; - break; - - case 'FFVH': - codecID = CODEC_ID_FFVHUFF; - break; - - case 'MPEG': - case 'mpg1': - case 'mp1v': - codecID = CODEC_ID_MPEG1VIDEO; - break; - - case 'MPG2': - case 'mpg2': - case 'mp2v': - codecID = CODEC_ID_MPEG2VIDEO; - break; - - case 'FPS1': - codecID = CODEC_ID_FRAPS; - break; - - case 'SNOW': - codecID = CODEC_ID_SNOW; - break; + OSType componentType = glob->componentType; + enum CodecID codecID = getCodecID(componentType); + + if(componentType == 'mp4v' || componentType == 'avc1') + glob->packedType = PACKED_QUICKTIME_KNOWS_ORDER; + + else if(componentType == 'VP30' || componentType == 'VP31') + glob->shouldUseReturnedFrame = TRUE; - case 'RJPG': - case 'NUV1': - codecID = CODEC_ID_NUV; - break; - case 'tscc': - codecID = CODEC_ID_TSCC; - break; - - case 'ZMBV': - codecID = CODEC_ID_ZMBV; - break; - - case 'VP6A': - codecID = CODEC_ID_VP6A; - break; - - case 'RT21': - codecID = CODEC_ID_INDEO2; - break; - - case 'IV31': - case 'IV32': - case 'iv31': - case 'iv32': - codecID = CODEC_ID_INDEO3; - break; - - default: - Codecprintf(glob->fileLog, "Warning! Unknown codec type! Using MPEG4 by default.\n"); - } + if(codecID == CODEC_ID_NONE) + { + Codecprintf(glob->fileLog, "Warning! Unknown codec type! Using MPEG4 by default.\n"); + codecID = CODEC_ID_MPEG4; + } glob->avCodec = avcodec_find_decoder(codecID); // if(glob->packedType != PACKED_QUICKTIME_KNOWS_ORDER) diff --git a/FFusionCodec.r b/FFusionCodec.r deleted file mode 100644 index b63d597..0000000 --- a/FFusionCodec.r +++ /dev/null @@ -1,335 +0,0 @@ -//--------------------------------------------------------------------------- -//FFusion -//Alternative DivX Codec for MacOS X -//version 2.2 (build 72) -//by Jerome Cornet -//Copyright 2002-2003 Jerome Cornet -//parts by Dan Christiansen -//Copyright 2003 Dan Christiansen -//from DivOSX by Jamby -//Copyright 2001-2002 Jamby -//uses libavcodec from ffmpeg 0.4.6 -// -//This library is free software; you can redistribute it and/or -//modify it under the terms of the GNU Lesser General Public -//License as published by the Free Software Foundation; either -//version 2.1 of the License, or (at your option) any later version. -// -//This library is distributed in the hope that it will be useful, -//but WITHOUT ANY WARRANTY; without even the implied warranty of -//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -//Lesser General Public License for more details. -// -//You should have received a copy of the GNU Lesser General Public -//License along with this library; if not, write to the Free Software -//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -// -//--------------------------------------------------------------------------- -//Source Code -//--------------------------------------------------------------------------- - -#define TARGET_REZ_CARBON_MACHO 1 -#define thng_RezTemplateVersion 1 // multiplatform 'thng' resource -#define cfrg_RezTemplateVersion 1 // extended version of 'cfrg' resource - -#include -#include - -// These flags specify information about the capabilities of the component -// Works with 1-bit, 8-bit, 16-bit and 32-bit Pixel Maps - -#define kDecompressionFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | codecInfoDoesTemporal | cmpThreadSafe ) - -// These flags specify the possible format of compressed data produced by the component -// and the format of compressed files that the component can handle during decompression -// The component can decompress from files at 1-bit, 8-bit, 16-bit and 32-bit depths - -#define kFormatFlags ( codecInfoDepth32 | codecInfoDepth24 | codecInfoDepth16 | codecInfoDepth8 | codecInfoDepth1 ) - -#include "PerianResourceIDs.h" - -#define kStartTHNGResID kDivX1CodecInfoResID -#define kCodecManufacturer kFFusionCodecManufacturer -#define kCodecVersion kFFusionCodecVersion -#define kEntryPointID kDivX1CodecInfoResID - -#define kCodecInfoResID kDivX1CodecInfoResID -#define kCodecName "MS-MPEG4 v1" -#define kCodecDescription "Decompresses video stored in MS-MPEG4 version 1 format." -#define kCodecSubType 'MPG4' -#include "PerianResources.r" -#define kCodecSubType 'mpg4' -#include "PerianResources.r" -#define kCodecSubType 'DIV1' -#include "PerianResources.r" -#define kCodecSubType 'div1' -#include "PerianResources.r" - -#define kCodecInfoResID kDivX2CodecInfoResID -#define kCodecName "MS-MPEG4 v2" -#define kCodecDescription "Decompresses video stored in MS-MPEG4 version 2 format." -#define kCodecSubType 'MP42' -#include "PerianResources.r" -#define kCodecSubType 'mp42' -#include "PerianResources.r" -#define kCodecSubType 'DIV2' -#include "PerianResources.r" -#define kCodecSubType 'div2' -#include "PerianResources.r" - -#define kCodecInfoResID kDivX3CodecInfoResID -#define kCodecName "DivX 3" -#define kCodecDescription "Decompresses video stored in DivX 3.11 alpha format." -#define kCodecSubType 'MPG3' -#include "PerianResources.r" -#define kCodecSubType 'mpg3' -#include "PerianResources.r" -#define kCodecSubType 'MP43' -#include "PerianResources.r" -#define kCodecSubType 'mp43' -#include "PerianResources.r" -#define kCodecSubType 'DIV3' -#include "PerianResources.r" -#define kCodecSubType 'div3' -#include "PerianResources.r" -#define kCodecSubType 'DIV4' -#include "PerianResources.r" -#define kCodecSubType 'div4' -#include "PerianResources.r" -#define kCodecSubType 'DIV5' -#include "PerianResources.r" -#define kCodecSubType 'div5' -#include "PerianResources.r" -#define kCodecSubType 'DIV6' -#include "PerianResources.r" -#define kCodecSubType 'div6' -#include "PerianResources.r" -#define kCodecSubType 'AP41' -#include "PerianResources.r" -#define kCodecSubType 'COL0' -#include "PerianResources.r" -#define kCodecSubType 'col0' -#include "PerianResources.r" -#define kCodecSubType 'COL1' -#include "PerianResources.r" -#define kCodecSubType 'col1' -#include "PerianResources.r" - -#define kCodecInfoResID kDivX4CodecInfoResID -#define kCodecName "DivX 4" -#define kCodecDescription "Decompresses video stored in OpenDivX format." -#define kCodecSubType 'DIVX' -#include "PerianResources.r" -#define kCodecSubType 'divx' -#include "PerianResources.r" -#define kCodecSubType 'mp4s' -#include "PerianResources.r" -#define kCodecSubType 'MP4S' -#include "PerianResources.r" -#define kCodecSubType 'M4S2' -#include "PerianResources.r" -#define kCodecSubType 'm4s2' -#include "PerianResources.r" -#define kCodecSubType 0x04000000 -#include "PerianResources.r" -#define kCodecSubType 'UMP4' -#include "PerianResources.r" - -#define kCodecInfoResID kDivX5CodecInfoResID -#define kCodecName "DivX 5" -#define kCodecDescription "Decompresses video stored in DivX 5 format." -#define kCodecSubType 'DX50' -#include "PerianResources.r" - -#define kCodecInfoResID k3ivxCodecInfoResID -#define kCodecName "3ivx" -#define kCodecDescription "Decompresses video stored in 3ivx format." -#define kCodecSubType '3IVD' -#include "PerianResources.r" -#define kCodecSubType '3ivd' -#include "PerianResources.r" -#define kCodecSubType '3IV2' -#include "PerianResources.r" -#define kCodecSubType '3iv2' -#include "PerianResources.r" - -#define kCodecInfoResID kXVIDCodecInfoResID -#define kCodecName "Xvid" -#define kCodecDescription "Decompresses video stored in Xvid format." -#define kCodecSubType 'XVID' -#include "PerianResources.r" -#define kCodecSubType 'xvid' -#include "PerianResources.r" -#define kCodecSubType 'XviD' -#include "PerianResources.r" -#define kCodecSubType 'XVIX' -#include "PerianResources.r" -#define kCodecSubType 'BLZ0' -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG4CodecInfoResID -#define kCodecName "MPEG-4" -#define kCodecDescription "Decompresses video stored in MPEG-4 format." -#define kCodecSubType 'RMP4' -#include "PerianResources.r" -#define kCodecSubType 'SEDG' -#include "PerianResources.r" -#define kCodecSubType 'WV1F' -#include "PerianResources.r" -#define kCodecSubType 'FMP4' -#include "PerianResources.r" -#define kCodecSubType 'SMP4' -#include "PerianResources.r" -// XXX: can we do this without claiming Apple's manufacturer (and thus unregistering their decoder)? -#define kCodecManufacturer 'appl' -#define kCodecSubType 'mp4v' -#include "PerianResources.r" -#define kCodecManufacturer kFFusionCodecManufacturer - -#define kCodecInfoResID kH264CodecInfoResID -#define kCodecName "H.264" -#define kCodecDescription "Decompresses video stored in H.264 format." -#define kCodecSubType 'H264' -#include "PerianResources.r" -#define kCodecSubType 'h264' -#include "PerianResources.r" -#define kCodecSubType 'X264' -#include "PerianResources.r" -#define kCodecSubType 'x264' -#include "PerianResources.r" -#define kCodecSubType 'DAVC' -#include "PerianResources.r" -#define kCodecSubType 'VSSH' -#include "PerianResources.r" -#define kCodecSubType 'AVC1' -#include "PerianResources.r" -#define kCodecSubType 'avc1' -#include "PerianResources.r" - -#define kCodecInfoResID kFLV1CodecInfoResID -#define kCodecName "Sorenson H.263" -#define kCodecDescription "Decompresses video stored in Sorenson H.263 format." -#define kCodecSubType 'FLV1' -#include "PerianResources.r" - -#define kCodecInfoResID kFlashSVCodecInfoResID -#define kCodecName "Flash Screen Video" -#define kCodecDescription "Decompresses video stored in Flash Screen Video format." -#define kCodecSubType 'FSV1' -#include "PerianResources.r" - -#define kCodecInfoResID kVP6CodecInfoResID -#define kCodecName "TrueMotion VP6" -#define kCodecDescription "Decompresses video stored in On2 VP6 format." -#define kCodecSubType 'VP60' -#include "PerianResources.r" -#define kCodecSubType 'VP61' -#include "PerianResources.r" -#define kCodecSubType 'VP62' -#include "PerianResources.r" -#define kCodecSubType 'VP6F' -#include "PerianResources.r" -#define kCodecSubType 'FLV4' -#include "PerianResources.r" - -#define kCodecInfoResID kI263CodecInfoResID -#define kCodecName "Intel H.263" -#define kCodecDescription "Decompresses video stored in Intel H.263 format." -#define kCodecSubType 'I263' -#include "PerianResources.r" -#define kCodecSubType 'i263' -#include "PerianResources.r" - -#define kCodecInfoResID kVP3CodecInfoResID -#define kCodecName "On2 VP3" -#define kCodecDescription "Decompresses video stored in On2 VP3 format." -#define kCodecSubType 'VP30' -#include "PerianResources.r" -#define kCodecSubType 'VP31' -#include "PerianResources.r" - -#define kCodecInfoResID kHuffYUVCodecInfoResID -#define kCodecName "HuffYUV" -#define kCodecDescription "Decompresses video stored in HuffYUV format." -#define kCodecSubType 'HFYU' -#include "PerianResources.r" -#define kCodecSubType 'FFVH' -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG1CodecInfoResID -#define kCodecName "MPEG-1" -#define kCodecDescription "Decompresses video stored in MPEG-1 format." -#define kCodecSubType 'MPEG' -#include "PerianResources.r" -#define kCodecSubType 'mpg1' -#include "PerianResources.r" -#define kCodecSubType 'mp1v' -#include "PerianResources.r" - -#define kCodecInfoResID kMPEG2CodecInfoResID -#define kCodecName "MPEG-2" -#define kCodecDescription "Decompresses video stored in MPEG-2 format." -#define kCodecSubType 'MPG2' -#include "PerianResources.r" -#define kCodecSubType 'mpg2' -#include "PerianResources.r" -#define kCodecSubType 'mp2v' -#include "PerianResources.r" - -#define kCodecInfoResID kFRAPSCodecInfoResID -#define kCodecName "Fraps" -#define kCodecDescription "Decompresses video stored in Fraps format." -#define kCodecSubType 'FPS1' -#include "PerianResources.r" - -#define kCodecInfoResID kSnowCodecInfoResID -#define kCodecName "Snow" -#define kCodecDescription "Decompresses video stored in Snow format." -#define kCodecSubType 'SNOW' - -#define kCodecInfoResID kNuvCodecInfoResID -#define kCodecName "NuppelVideo" -#define kCodecDescription "Decompresses video stored in NuppelVideo format." -#define kCodecSubType 'RJPG' -#include "PerianResources.r" -#define kCodecSubType 'NUV1' -#include "PerianResources.r" - -#define kCodecInfoResID kIndeo2CodecInfoResID -#define kCodecName "Indeo 2" -#define kCodecDescription "Decompresses video stored in Intel's Indeo 2 format." -#define kCodecSubType 'RT21' -#include "PerianResources.r" - -#define kCodecInfoResID kIndeo3CodecInfoResID -#define kCodecName "Indeo 3" -#define kCodecDescription "Decompresses video stored in Intel's Indeo 3 format." -#define kCodecSubType 'IV32' -#include "PerianResources.r" - -#define kCodecInfoResID kTSCCCodecInfoResID -#define kCodecName "Techsmith Screen Capture" -#define kCodecDescription "Decompresses video stored in Techsmith Screen Capture format." -#define kCodecSubType 'tscc' -#include "PerianResources.r" - -#define kCodecInfoResID kZMBVCodecInfoResID -#define kCodecName "DosBox Capture" -#define kCodecDescription "Decompresses video stored in DosBox Capture format." -#define kCodecSubType 'ZMBV' -#include "PerianResources.r" - -#define kCodecInfoResID kVP6ACodecInfoResID -#define kCodecName "On2 VP6A" -#define kCodecDescription "Decompresses video stored in On2 VP6A format." -#define kCodecSubType 'VP6A' -#include "PerianResources.r" - -//--------------------------------------------------------------------------- -// Code Entry Point for Mach-O -//--------------------------------------------------------------------------- - -resource 'dlle' (kDivX1CodecInfoResID) { - "FFusionCodecComponentDispatch" -}; - diff --git a/Perian.xcodeproj/project.pbxproj b/Perian.xcodeproj/project.pbxproj index cbe1b97..a30a78a 100644 --- a/Perian.xcodeproj/project.pbxproj +++ b/Perian.xcodeproj/project.pbxproj @@ -110,7 +110,6 @@ 11C85ED80A641E6400DF3D73 /* ff_dataref.c in Sources */ = {isa = PBXBuildFile; fileRef = 11C85ED30A641E6400DF3D73 /* ff_dataref.c */; }; 11C85EDA0A641E6400DF3D73 /* ff_private.c in Sources */ = {isa = PBXBuildFile; fileRef = 11C85ED60A641E6400DF3D73 /* ff_private.c */; }; 11C85FE50A64314400DF3D73 /* ff_MovieImport.c in Sources */ = {isa = PBXBuildFile; fileRef = 11C85ED40A641E6400DF3D73 /* ff_MovieImport.c */; }; - 11C85FE60A64314500DF3D73 /* FFusionCodec.r in Rez */ = {isa = PBXBuildFile; fileRef = F560DF0203D622D001ABA332 /* FFusionCodec.r */; }; 11F28DAD0B52EB75000AF78C /* SUUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 11F28DAC0B52EB75000AF78C /* SUUpdateAlert.m */; }; 3D0A03BD100692E20087E580 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11629EEA0B51E4F1006591C8 /* Cocoa.framework */; }; 3D0A03BE100692E30087E580 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11D4EEFC0A3CE7FA0066D45F /* Carbon.framework */; }; @@ -150,15 +149,12 @@ 6116E5530B43C27B0020F1CE /* ACSimpleCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E53E0B43C27B0020F1CE /* ACSimpleCodec.cpp */; }; 6116E5570B43C27B0020F1CE /* CAStreamBasicDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E5490B43C27B0020F1CE /* CAStreamBasicDescription.cpp */; }; 6116E5580B43C27B0020F1CE /* FFissionCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E54C0B43C27B0020F1CE /* FFissionCodec.cpp */; }; - 6116E5590B43C27B0020F1CE /* FFissionCodec.r in Rez */ = {isa = PBXBuildFile; fileRef = 6116E54E0B43C27B0020F1CE /* FFissionCodec.r */; }; 6116E55A0B43C27B0020F1CE /* FFissionDecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E54F0B43C27B0020F1CE /* FFissionDecoder.cpp */; }; 6116E61C0B44A5A70020F1CE /* GetCodecBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E5400B43C27B0020F1CE /* GetCodecBundle.cpp */; }; 6116E6200B44A5B30020F1CE /* CADebugMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E5460B43C27B0020F1CE /* CADebugMacros.cpp */; }; 6116E6220B44A5BC0020F1CE /* CABundleLocker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6116E5430B43C27B0020F1CE /* CABundleLocker.cpp */; }; 6123D6260AD0A3FF003EDE52 /* VobSubCodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 6123D6220AD0A3FE003EDE52 /* VobSubCodec.c */; }; - 6123D6270AD0A3FF003EDE52 /* VobSubCodec.r in Rez */ = {isa = PBXBuildFile; fileRef = 6123D6240AD0A3FE003EDE52 /* VobSubCodec.r */; }; 613CD51E0AD1FB650098A825 /* TextSubCodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 613CD51A0AD1FB650098A825 /* TextSubCodec.c */; }; - 613CD51F0AD1FB650098A825 /* TextSubCodec.r in Rez */ = {isa = PBXBuildFile; fileRef = 613CD51C0AD1FB650098A825 /* TextSubCodec.r */; }; 6156986F0BCDA87700E17ADE /* ringbuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6156986D0BCDA87700E17ADE /* ringbuffer.cpp */; }; 61CB11200ACDF3A2007994BD /* Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 61CB11070ACDF3A2007994BD /* Debug.h */; }; 61CB11210ACDF3A2007994BD /* EbmlBinary.h in Headers */ = {isa = PBXBuildFile; fileRef = 61CB11080ACDF3A2007994BD /* EbmlBinary.h */; }; @@ -272,6 +268,8 @@ 8F483B550A642644002CCA73 /* libavformat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F483B540A642644002CCA73 /* libavformat.a */; }; 8F483B5E0A6426C1002CCA73 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F483B5D0A6426C1002CCA73 /* AudioToolbox.framework */; }; 8F483B8C0A642886002CCA73 /* PerianAviImporter.r in Rez */ = {isa = PBXBuildFile; fileRef = 8F483B8B0A642886002CCA73 /* PerianAviImporter.r */; }; + F50E79F61014F62500D3E6FF /* codecID.c.m4 in Sources */ = {isa = PBXBuildFile; fileRef = F50E79F51014F61B00D3E6FF /* codecID.c.m4 */; }; + F50E79F71014F62D00D3E6FF /* codecResources.r.m4 in Rez */ = {isa = PBXBuildFile; fileRef = F50E79F41014F61B00D3E6FF /* codecResources.r.m4 */; }; F52286260B50625E00F8CF7D /* bitstream_info.c in Sources */ = {isa = PBXBuildFile; fileRef = F52286250B50625E00F8CF7D /* bitstream_info.c */; }; F539CD120B62BC82005A72C9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F539CD110B62BC82005A72C9 /* Foundation.framework */; }; F53E18E50B4F483C003A0471 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F53E18E40B4F483C003A0471 /* Security.framework */; }; @@ -307,6 +305,17 @@ ); script = "RAGEL=${PROJECT_DIR}/Binaries/ragel\nRLCODEGEN=${PROJECT_DIR}/Binaries/rlgen-cd\n[ ${INPUT_FILE_PATH} -nt ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ] || exit 0\n${RAGEL} ${INPUT_FILE_PATH} | ${RLCODEGEN} -T0 -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}\n"; }; + F50E79EE1014F53A00D3E6FF /* PBXBuildRule */ = { + isa = PBXBuildRule; + compilerSpec = com.apple.compilers.proxy.script; + filePatterns = "*.m4"; + fileType = pattern.proxy; + isEditable = 1; + outputFiles = ( + "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}", + ); + script = "[ ${INPUT_FILE_PATH} -nt ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ] || [ ${SOURCE_ROOT}/codecList.m4 -nt ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ] || [ ${SOURCE_ROOT}/defines.m4 -nt ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE} ] || exit 0\nm4 ${INPUT_FILE_PATH} > ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}"; + }; /* End PBXBuildRule section */ /* Begin PBXContainerItemProxy section */ @@ -588,15 +597,12 @@ 6116E54A0B43C27B0020F1CE /* CAStreamBasicDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CAStreamBasicDescription.h; sourceTree = ""; }; 6116E54C0B43C27B0020F1CE /* FFissionCodec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FFissionCodec.cpp; sourceTree = ""; }; 6116E54D0B43C27B0020F1CE /* FFissionCodec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FFissionCodec.h; sourceTree = ""; }; - 6116E54E0B43C27B0020F1CE /* FFissionCodec.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = FFissionCodec.r; path = FFissionCodec/FFissionCodec.r; sourceTree = ""; }; 6116E54F0B43C27B0020F1CE /* FFissionDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FFissionDecoder.cpp; sourceTree = ""; }; 6116E5500B43C27B0020F1CE /* FFissionDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FFissionDecoder.h; sourceTree = ""; }; 6116E74E0B4738CE0020F1CE /* CodecIDs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodecIDs.h; sourceTree = ""; }; 6123D6220AD0A3FE003EDE52 /* VobSubCodec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = VobSubCodec.c; sourceTree = ""; }; - 6123D6240AD0A3FE003EDE52 /* VobSubCodec.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = VobSubCodec.r; sourceTree = ""; }; 6123D6250AD0A3FF003EDE52 /* VobSubCodecDispatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VobSubCodecDispatch.h; sourceTree = ""; }; 613CD51A0AD1FB650098A825 /* TextSubCodec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = TextSubCodec.c; sourceTree = ""; }; - 613CD51C0AD1FB650098A825 /* TextSubCodec.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; path = TextSubCodec.r; sourceTree = ""; }; 613CD51D0AD1FB650098A825 /* TextSubCodecDispatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextSubCodecDispatch.h; sourceTree = ""; }; 6156986D0BCDA87700E17ADE /* ringbuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ringbuffer.cpp; sourceTree = ""; }; 6156986E0BCDA87700E17ADE /* ringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ringbuffer.h; sourceTree = ""; }; @@ -731,7 +737,8 @@ 8F483B8B0A642886002CCA73 /* PerianAviImporter.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; path = PerianAviImporter.r; sourceTree = ""; }; 8F483BBC0A642B3D002CCA73 /* ff_MovieImportDispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ff_MovieImportDispatch.h; sourceTree = ""; }; F50D440703EAD8DF01B1D299 /* FFusion.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = FFusion.icns; sourceTree = ""; }; - F50E7730101100D500D3E6FF /* PerianResourceIDs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerianResourceIDs.h; sourceTree = ""; }; + F50E79F41014F61B00D3E6FF /* codecResources.r.m4 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = codecResources.r.m4; sourceTree = ""; }; + F50E79F51014F61B00D3E6FF /* codecID.c.m4 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = codecID.c.m4; sourceTree = ""; }; F52286240B50625E00F8CF7D /* bitstream_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bitstream_info.h; sourceTree = ""; }; F52286250B50625E00F8CF7D /* bitstream_info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitstream_info.c; sourceTree = ""; }; F539CD110B62BC82005A72C9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; @@ -739,11 +746,13 @@ F560DECD03D61B6101ABA332 /* Components.k.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Components.k.h; sourceTree = ""; }; F560DEFE03D61C4601ABA332 /* FFusionCodecDispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFusionCodecDispatch.h; sourceTree = ""; }; F560DF0003D61D0101ABA332 /* FFusionCodec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FFusionCodec.c; sourceTree = ""; }; - F560DF0203D622D001ABA332 /* FFusionCodec.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; path = FFusionCodec.r; sourceTree = ""; }; F57676040BE1A18300B2434B /* FrameBuffer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = FrameBuffer.c; sourceTree = ""; }; F57676050BE1A18300B2434B /* FrameBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameBuffer.h; sourceTree = ""; }; F57755F40B51EB1800C7D833 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; F59B2AB81007A0D000FAAAD8 /* PerianResources.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; path = PerianResources.r; sourceTree = ""; }; + F5C89F8110220B2F0032D02A /* codecList.m4 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = codecList.m4; sourceTree = ""; }; + F5C89FC410220C800032D02A /* defines.m4 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = defines.m4; sourceTree = ""; }; + F5C89FC510220C800032D02A /* PerianResourceIDs.h.m4 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerianResourceIDs.h.m4; sourceTree = ""; }; F5CFD1B40B50009000616865 /* PerianPanePListGenerator */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PerianPanePListGenerator; sourceTree = BUILT_PRODUCTS_DIR; }; F5CFD1BD0B5000CE00616865 /* GBPerianPanePListGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBPerianPanePListGenerator.m; sourceTree = ""; }; F5CFD2C90B5012A100616865 /* A52Codec.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = A52Codec.xcodeproj; path = a52codec/A52Codec.xcodeproj; sourceTree = ""; }; @@ -885,23 +894,22 @@ 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( + F5C89FC410220C800032D02A /* defines.m4 */, + F5C89FC510220C800032D02A /* PerianResourceIDs.h.m4 */, + F5C89F8110220B2F0032D02A /* codecList.m4 */, + F50E79F41014F61B00D3E6FF /* codecResources.r.m4 */, 11207C720C2F4A4E002A0FF0 /* ComponentInfo.plist */, 11BEFB2C0C18E23E00BC9324 /* Read Me.rtf */, 3DAD0AC00FC1365E001E156F /* UpdateCheckerMainMenu.nib */, 83D1D6F40B4C85AB00E09EC9 /* Perian_icon.icns */, 3DAD0AAB0FC133E7001E156F /* PerianPrefPane.xib */, 83D1D6D00B4C7AD200E09EC9 /* Frameworks */, - 613CD51C0AD1FB650098A825 /* TextSubCodec.r */, - 6123D6240AD0A3FE003EDE52 /* VobSubCodec.r */, 61D691590AC8E382000EFC7D /* MatroskaImport.r */, 61D691540AC8E382000EFC7D /* MatroskaExport.r */, 8F483B8B0A642886002CCA73 /* PerianAviImporter.r */, 089C167EFE841241C02AAC07 /* InfoPlist.strings */, - F560DF0203D622D001ABA332 /* FFusionCodec.r */, - 6116E54E0B43C27B0020F1CE /* FFissionCodec.r */, F50D440903EAD8E701B1D299 /* Images */, F59B2AB81007A0D000FAAAD8 /* PerianResources.r */, - F50E7730101100D500D3E6FF /* PerianResourceIDs.h */, ); name = Resources; sourceTree = ""; @@ -916,6 +924,7 @@ 6123D61D0AD0A052003EDE52 /* Subtitles */, 6116E5360B43C27B0020F1CE /* ACPublic */, 6116E5420B43C27B0020F1CE /* CAPublicUtility */, + F50E79F51014F61B00D3E6FF /* codecID.c.m4 */, F560DECD03D61B6101ABA332 /* Components.k.h */, 113F58980A6B091600509987 /* Codecprintf.h */, 113F58990A6B091600509987 /* Codecprintf.c */, @@ -1381,12 +1390,14 @@ isa = PBXNativeTarget; buildConfigurationList = 11A70AC80A3D0111002058D4 /* Build configuration list for PBXNativeTarget "Perian" */; buildPhases = ( + F50E79E81014F42F00D3E6FF /* ShellScript */, 11A70ABD0A3D0105002058D4 /* Resources */, 11A70ABE0A3D0105002058D4 /* Sources */, 11A70ABF0A3D0105002058D4 /* Frameworks */, 11A70ADC0A3D0156002058D4 /* Rez */, ); buildRules = ( + F50E79EE1014F53A00D3E6FF /* PBXBuildRule */, 3D74F53C0B6DB50C0018BAC0 /* PBXBuildRule */, ); dependencies = ( @@ -1639,12 +1650,9 @@ isa = PBXRezBuildPhase; buildActionMask = 2147483647; files = ( + F50E79F71014F62D00D3E6FF /* codecResources.r.m4 in Rez */, 8F483B8C0A642886002CCA73 /* PerianAviImporter.r in Rez */, - 11C85FE60A64314500DF3D73 /* FFusionCodec.r in Rez */, 61CB12260ACE1074007994BD /* MatroskaImport.r in Rez */, - 6123D6270AD0A3FF003EDE52 /* VobSubCodec.r in Rez */, - 613CD51F0AD1FB650098A825 /* TextSubCodec.r in Rez */, - 6116E5590B43C27B0020F1CE /* FFissionCodec.r in Rez */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1664,6 +1672,24 @@ shellPath = /bin/sh; shellScript = "source $SRCROOT/createStaticLibs.sh"; }; + F50E79E81014F42F00D3E6FF /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/PerianResourceIDs.h.m4", + "$(SRCROOT)/defines.m4", + "$(SRCROOT)/codecList.m4", + "$(SRCROOT)/scripts/generateCodecIDs.sh", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/PerianResourceIDs.h", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# shell script goes here\nsource \"${SCRIPT_INPUT_FILE_3}\""; + }; F5121EB60EB3A54A0048EF67 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1742,6 +1768,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F50E79F61014F62500D3E6FF /* codecID.c.m4 in Sources */, 3D211A300B6B1AD80051299D /* SubParsing.m.rl in Sources */, 11C85ED80A641E6400DF3D73 /* ff_dataref.c in Sources */, 11C85EDA0A641E6400DF3D73 /* ff_private.c in Sources */, diff --git a/PerianResourceIDs.h b/PerianResourceIDs.h deleted file mode 100644 index 6e4be25..0000000 --- a/PerianResourceIDs.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * PerianResourceIDs.h - * Created by Graham Booker on 7/17/09. - * - * This file is part of Perian. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#import "CodecIDs.h" - -#define kPerianManufacturer 'Peri' - -#define kFFusionCodecManufacturer kPerianManufacturer -#define kTextCodecManufacturer kPerianManufacturer -#define kVobSubCodecManufacturer kPerianManufacturer -#define kFFissionCodecManufacturer kPerianManufacturer - -#define kFFusionCodecVersion (0x00030005) -#define kTextSubCodecVersion (0x00020003) -#define kVobSubCodecVersion (0x00020003) -#define kFFissionCodecVersion kFFusionCodecVersion - -enum { - kWMA1MSCodecResourceID = 128, - kWMA2MSCodecResourceID, - kFlashADPCMCodecResourceID, - kXiphVorbisCodecResourceID, - kMPEG1L1CodecResourceID, - kMPEG1L12CodecResourceID, - kMPEG1L2CodecResourceID, - kTrueAudioCodecResourceID, - kDTSCodecResourceID, - kNellymoserCodecResourceID, - kSSASubCodecResourceID = 256, - kTextSubCodecResourceID, - kVobSubCodecResourceID, - kDivX1CodecInfoResID, - kDivX2CodecInfoResID, - kDivX3CodecInfoResID, - kDivX4CodecInfoResID, - kDivX5CodecInfoResID, - k3ivxCodecInfoResID, - kXVIDCodecInfoResID, - kMPEG4CodecInfoResID, - kH264CodecInfoResID, - kFLV1CodecInfoResID, - kFlashSVCodecInfoResID, - kVP6CodecInfoResID, - kI263CodecInfoResID, - kVP3CodecInfoResID, - kHuffYUVCodecInfoResID, - kMPEG1CodecInfoResID, - kMPEG2CodecInfoResID, - kFRAPSCodecInfoResID, - kSnowCodecInfoResID, - kNuvCodecInfoResID, - kIndeo2CodecInfoResID, - kIndeo3CodecInfoResID, - kTSCCCodecInfoResID, - kZMBVCodecInfoResID, - kVP6ACodecInfoResID, -}; - diff --git a/PerianResourceIDs.h.m4 b/PerianResourceIDs.h.m4 new file mode 100644 index 0000000..21f905d --- /dev/null +++ b/PerianResourceIDs.h.m4 @@ -0,0 +1,26 @@ +include(`defines.m4') + +define(, , $1) ifdef(, )dnl!>, )!>)!>)dnl +dnl +define(, )dnl +define(, )dnl +define(, )dnl + +#import "CodecIDs.h" + +#define kPerianManufacturer 'Peri' + +#define kFFusionCodecManufacturer kPerianManufacturer +#define kTextCodecManufacturer kPerianManufacturer +#define kVobSubCodecManufacturer kPerianManufacturer +#define kFFissionCodecManufacturer kPerianManufacturer + +#define kFFusionCodecVersion (0x00030005) +#define kTextSubCodecVersion (0x00020003) +#define kVobSubCodecVersion (0x00020003) +#define kFFissionCodecVersion kFFusionCodecVersion + +enum{ +include() +}; diff --git a/TextSubCodec.r b/TextSubCodec.r deleted file mode 100755 index c859b40..0000000 --- a/TextSubCodec.r +++ /dev/null @@ -1,59 +0,0 @@ -/* - * TextSubCodec.r - * - * This file is part of Perian. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define TARGET_REZ_CARBON_MACHO 1 -#define thng_RezTemplateVersion 1 // multiplatform 'thng' resource -#define cfrg_RezTemplateVersion 1 // extended version of 'cfrg' resource - -#include -#include - -// These flags specify information about the capabilities of the component -// Works with 1-bit, 8-bit, 16-bit and 32-bit Pixel Maps -#define kDecompressionFlags ( codecInfoDoes32 | cmpThreadSafe | codecInfoDoesStretch | codecInfoDoesShrink ) - -// These flags specify the possible format of compressed data produced by the component -// and the format of compressed files that the component can handle during decompression -// The component can decompress from files at 1-bit, 8-bit, 16-bit, 24-bit and 32-bit depths -#define kFormatFlags ( codecInfoDepth32 ) - -#include "PerianResourceIDs.h" - -#define kStartTHNGResID kSSASubCodecResourceID -#define kCodecManufacturer kTextCodecManufacturer -#define kCodecVersion kTextSubCodecVersion -#define kEntryPointID kTextSubCodecResourceID - -#define kCodecInfoResID kSSASubCodecResourceID -#define kCodecName "SSA Text Subtitle" -#define kCodecDescription "Renders subtitles stored in SubStation Alpha format." -#define kCodecSubType kSubFormatSSA -#include "PerianResources.r" - -#define kCodecInfoResID kTextSubCodecResourceID -#define kCodecName "Text Subtitle" -#define kCodecDescription "Renders subtitles stored as text." -#define kCodecSubType kSubFormatUTF8 -#include "PerianResources.r" - -// Code Entry Point for Mach-O and Windows -resource 'dlle' (kTextSubCodecResourceID) { - "TextSubCodecComponentDispatch" -}; diff --git a/VobSubCodec.r b/VobSubCodec.r deleted file mode 100755 index 95e4233..0000000 --- a/VobSubCodec.r +++ /dev/null @@ -1,53 +0,0 @@ -/* - * VobSubCodec.r - * - * This file is part of Perian. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define TARGET_REZ_CARBON_MACHO 1 -#define thng_RezTemplateVersion 1 // multiplatform 'thng' resource -#define cfrg_RezTemplateVersion 1 // extended version of 'cfrg' resource - -#include -#include - -// These flags specify information about the capabilities of the component -// Works with 1-bit, 8-bit, 16-bit and 32-bit Pixel Maps -#define kDecompressionFlags ( codecInfoDoes32 | codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1 | cmpThreadSafe ) - -// These flags specify the possible format of compressed data produced by the component -// and the format of compressed files that the component can handle during decompression -// The component can decompress from files at 1-bit, 8-bit, 16-bit, 24-bit and 32-bit depths -#define kFormatFlags ( codecInfoDepth32 | codecInfoDepth24 | codecInfoDepth16 | codecInfoDepth8 | codecInfoDepth1 ) - -#include "PerianResourceIDs.h" - -#define kStartTHNGResID kVobSubCodecResourceID -#define kCodecManufacturer kVobSubCodecManufacturer -#define kCodecVersion kVobSubCodecVersion -#define kEntryPointID kVobSubCodecResourceID - -#define kCodecInfoResID kVobSubCodecResourceID -#define kCodecName "VobSub" -#define kCodecDescription "Decompresses subtitles stored in the VobSub format." -#define kCodecSubType kSubFormatVobSub -#include "PerianResources.r" - -// Code Entry Point for Mach-O and Windows -resource 'dlle' (kVobSubCodecResourceID) { - "VobSubCodecComponentDispatch" -}; diff --git a/codecID.c.m4 b/codecID.c.m4 new file mode 100644 index 0000000..e50f886 --- /dev/null +++ b/codecID.c.m4 @@ -0,0 +1,28 @@ +include(`defines.m4') + +define(, , )!>) +define(, )!>)dnl +define(, , , , shift($@))!>)!>)dnl +define(, )dnl +dnl +define(, )dnl +define(, )dnl +#include "avcodec.h" +#include "CodecIDs.h" + +int getCodecID(OSType componentType) +{ + enum CodecID codecID = CODEC_ID_NONE; + switch(componentType) + { +include() + codecID = lastCase; + break; + default: + break; + } + return codecID; +} diff --git a/codecList.m4 b/codecList.m4 new file mode 100644 index 0000000..a88b652 --- /dev/null +++ b/codecList.m4 @@ -0,0 +1,59 @@ +EntryPoint(kFFusionCodecManufacturer, kFFusionCodecVersion, kDivX1CodecInfoResID, "FFusionCodecComponentDispatch", , ) +Codec(kDivX1CodecInfoResID, CODEC_ID_MSMPEG4V1, "MS-MPEG4 v1", "Decompresses video stored in MS-MPEG4 version 1 format.", 'MPG4', 'mpg4', 'DIV1', 'div1') +Codec(kDivX2CodecInfoResID, CODEC_ID_MSMPEG4V2, "MS-MPEG4 v2", "Decompresses video stored in MS-MPEG4 version 2 format.", 'MP42', 'mp42', 'DIV2', 'div2') +Codec(kDivX3CodecInfoResID, CODEC_ID_MSMPEG4V3, "DivX 3", "Decompresses video stored in DivX 3.11 alpha format.", 'MPG3', 'mpg3', 'MP43', 'mp43', 'DIV3', 'div3', 'DIV4', 'div4', 'DIV5', 'div5', 'DIV6', 'div6', 'AP41', 'COL0', 'col0', 'COL1', 'col1') +Codec(kDivX4CodecInfoResID, CODEC_ID_MPEG4, "DivX 4", "Decompresses video stored in OpenDivX format.", 'DIVX', 'divx', 'mp4s', 'MP4S', 'M4S2', 'm4s2', 0x04000000, 'UMP4') +Codec(kDivX5CodecInfoResID, CODEC_ID_MPEG4, "DivX 5", "Decompresses video stored in DivX 5 format.", 'DX50') +Codec(k3ivxCodecInfoResID, CODEC_ID_MPEG4, "3ivx", "Decompresses video stored in 3ivx format.", '3IVD', '3ivd', '3IV2', '3iv2') +Codec(kXVIDCodecInfoResID, CODEC_ID_MPEG4, "Xvid", "Decompresses video stored in Xvid format.", 'XVID', 'xvid', 'XviD', 'XVIX', 'BLZ0') +Codec(kMPEG4CodecInfoResID, CODEC_ID_MPEG4, "MPEG-4", "Decompresses video stored in MPEG-4 format.", 'RMP4', 'SEDG', 'WV1F', 'FMP4', 'SMP4') +ResourceOnly() +ResourceOnly() +ResourceOnly() +ResourceOnly() +ResourceOnly() +Codec(kH264CodecInfoResID, CODEC_ID_H264, "H.264", "Decompresses video stored in H.264 format.", 'H264', 'h264', 'X264', 'x264', 'DAVC', 'VSSH', 'AVC1', 'avc1') +Codec(kFLV1CodecInfoResID, CODEC_ID_FLV1, "Sorenson H.263", "Decompresses video stored in Sorenson H.263 format.", 'FLV1') +Codec(kFlashSVCodecInfoResID, CODEC_ID_FLASHSV, "Flash Screen Video", "Decompresses video stored in Flash Screen Video format.", 'FSV1') +Codec(kVP6CodecInfoResID, CODEC_ID_VP6, "TrueMotion VP6", "Decompresses video stored in On2 VP6 format.", 'VP60', 'VP61', 'VP62') +Codec(kVP6CodecInfoResID, CODEC_ID_VP6F, "TrueMotion VP6", "Decompresses video stored in On2 VP6 format.", 'VP6F', 'FLV4') +Codec(kI263CodecInfoResID, CODEC_ID_H263I, "Intel H.263", "Decompresses video stored in Intel H.263 format.", 'I263', 'i263') +Codec(kVP3CodecInfoResID, CODEC_ID_VP3, "On2 VP3", "Decompresses video stored in On2 VP3 format.", 'VP30', 'VP31') +Codec(kHuffYUVCodecInfoResID, CODEC_ID_HUFFYUV, "HuffYUV", "Decompresses video stored in HuffYUV format.", 'HFYU') +Codec(kHuffYUVCodecInfoResID, CODEC_ID_FFVHUFF, "HuffYUV", "Decompresses video stored in HuffYUV format.", 'FFVH') +Codec(kMPEG1CodecInfoResID, CODEC_ID_MPEG1VIDEO, "MPEG-1", "Decompresses video stored in MPEG-1 format.", 'MPEG', 'mpg1', 'mp1v') +Codec(kMPEG2CodecInfoResID, CODEC_ID_MPEG2VIDEO, "MPEG-2", "Decompresses video stored in MPEG-2 format.", 'MPG2', 'mpg2', 'mp2v') +Codec(kFRAPSCodecInfoResID, CODEC_ID_FRAPS, "Fraps", "Decompresses video stored in Fraps format.", 'FPS1') +Codec(kSnowCodecInfoResID, CODEC_ID_SNOW, "Snow", "Decompresses video stored in Snow format.", 'SNOW') +Codec(kNuvCodecInfoResID, CODEC_ID_NUV, "NuppelVideo", "Decompresses video stored in NuppelVideo format.", 'RJPG', 'NUV1') +Codec(kIndeo2CodecInfoResID, CODEC_ID_INDEO2, "Indeo 2", "Decompresses video stored in Intel's Indeo 2 format.", 'RT21') +Codec(kIndeo3CodecInfoResID, CODEC_ID_INDEO3, "Indeo 3", "Decompresses video stored in Intel's Indeo 3 format.", 'IV32', 'iv32', 'IV31', 'iv31') +Codec(kTSCCCodecInfoResID, CODEC_ID_TSCC, "Techsmith Screen Capture", "Decompresses video stored in Techsmith Screen Capture format.", 'tscc') +Codec(kZMBVCodecInfoResID, CODEC_ID_ZMBV, "DosBox Capture", "Decompresses video stored in DosBox Capture format.", 'ZMBV') +Codec(kVP6ACodecInfoResID, CODEC_ID_VP6A, "On2 VP6A", "Decompresses video stored in On2 VP6A format.", 'VP6A') + +EntryPoint(kVobSubCodecManufacturer, kVobSubCodecVersion, kVobSubCodecResourceID, "VobSubCodecComponentDispatch", , ) +Codec(kVobSubCodecResourceID, CODEC_ID_DVD_SUBTITLE,"VobSub", "Decompresses subtitles stored in the VobSub format.", kSubFormatVobSub) + +EntryPoint(kTextCodecManufacturer, kTextSubCodecVersion, kTextSubCodecResourceID, "TextSubCodecComponentDispatch", , ) +Codec(kSSASubCodecResourceID, , "SSA Text Subtitle", "Renders subtitles stored in SubStation Alpha format.", kSubFormatSSA) +Codec(kTextSubCodecResourceID, , "Text Subtitle", "Renders subtitles stored as text.", kSubFormatUTF8) + +ResourceOnly() +ResourceOnly() +ResourceOnly() +ResourceOnly() +ResourceOnly() + +EntryPoint(kFFissionCodecManufacturer, kFFissionCodecVersion, kWMA1MSCodecResourceID, "FFissionDecoderEntry", cmpThreadSafeOnMac, ) +Codec(kWMA1MSCodecResourceID, CODEC_ID_WMAV1, "Windows Media Audio 1", "An AudioCodec that decodes WMA v1 into linear PCM", kAudioFormatWMA2MS) +Codec(kFlashADPCMCodecResourceID, CODEC_ID_ADPCM_SWF, "Flash ADPCM", "An AudioCodec that decodes Flash ADPCM into linear PCM", kAudioFormatFlashADPCM) + +EntryPoint(kFFissionCodecManufacturer, kFFissionCodecVersion, kXiphVorbisCodecResourceID, "FFissionVBRDecoderEntry", cmpThreadSafeOnMac, ) +Codec(kXiphVorbisCodecResourceID, CODEC_ID_VORBIS, "Vorbis", "An AudioCodec that decodes Vorbis into linear PCM", kAudioFormatXiphVorbis) +Codec(kMPEG1L1CodecResourceID, CODEC_ID_MP2, "MPEG-1 Layer 1", "An AudioCodec that decodes MPEG-1 layer 1 audio into linear PCM", '.mp1') +Codec(kMPEG1L12CodecResourceID, CODEC_ID_MP2, "MPEG-1 Layer 1/2", "An AudioCodec that decodes MPEG-1 layer 1 or 2 audio into linear PCM", 0x6d730050) +Codec(kMPEG1L2CodecResourceID, CODEC_ID_MP2, "MPEG-1 Layer 2", "An AudioCodec that decodes MPEG-1 layer 2 audio into linear PCM", '.mp2') +Codec(kTrueAudioCodecResourceID, CODEC_ID_TTA, "True Audio", "An AudioCodec that decodes True Audio into linear PCM", kAudioFormatTTA) +Codec(kDTSCodecResourceID, CODEC_ID_DTS, "DTS Coherent Acoustics", "An AudioCodec that decodes DCA Audio into linear PCM", kAudioFormatDTS) +Codec(kNellymoserCodecResourceID, CODEC_ID_NELLYMOSER, "Nellymoser ASAO", "An AudioCodec that decodes Nellymoser ASAO into linear PCM", kAudioFormatNellymoser) \ No newline at end of file diff --git a/codecResources.r.m4 b/codecResources.r.m4 new file mode 100644 index 0000000..83d7b59 --- /dev/null +++ b/codecResources.r.m4 @@ -0,0 +1,33 @@ +include(`defines.m4') +define(, , define kCodecSubType X +!>, $@)!> +)dnl +dnl +define(, +ifelse(lastCodecID, $1, , ) +define(, $1) +dnl +printTypes(shift(shift(shift(shift($@)))))!>dnl +)dnl +dnl +define(, +define(, )dnl + + + + + + +)dnl + + + + +!> +!> + + +include() \ No newline at end of file diff --git a/defines.m4 b/defines.m4 new file mode 100644 index 0000000..55f2ec5 --- /dev/null +++ b/defines.m4 @@ -0,0 +1,8 @@ +changequote()dnl +define(,!>,,$2)$4popdef()$0(,incr($2),$3,)!>)!>)!>)dnl +dnl +define(,2),1, + ,)$2popdef()dnl + ifelse(eval($#>3),1,,,shift(shift(shift($@))))!>)!>)!>)dnl +dnl \ No newline at end of file diff --git a/scripts/generateCodecIDs.sh b/scripts/generateCodecIDs.sh new file mode 100644 index 0000000..f9b1e2a --- /dev/null +++ b/scripts/generateCodecIDs.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +m4 "${SCRIPT_INPUT_FILE_0}" > "${SCRIPT_OUTPUT_FILE_0}" \ No newline at end of file