Changeset 65 for trunk/ACPublic

Show
Ignore:
Timestamp:
05/26/09 15:24:30 (16 months ago)
Author:
gbooker
Message:

Upgraded Core Audio interface to later version (been meaning to commit this for quite a while)

Location:
trunk/ACPublic
Files:
3 added
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/ACPublic/ACBaseCodec.cpp

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright ᅵ 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACBaseCodec.cpp 
    40  
    41 =============================================================================*/ 
    42  
    4341//============================================================================= 
    4442//      Includes 
    4543//============================================================================= 
    46  
     44#include <algorithm> 
    4745#include "ACBaseCodec.h" 
    48 #include <algorithm> 
     46 
     47#include "ACCompatibility.h" 
     48 
     49#include "CABundleLocker.h" 
     50 
     51#if TARGET_OS_WIN32 
     52        #include "CAWin32StringResources.h" 
     53#endif 
    4954 
    5055//============================================================================= 
     
    5257//============================================================================= 
    5358 
    54 ACBaseCodec::ACBaseCodec() 
     59ACBaseCodec::ACBaseCodec( OSType theSubType ) 
    5560: 
    5661        ACCodec(), 
     
    6166        mOutputFormat() 
    6267{ 
     68        mCodecSubType = theSubType; 
    6369} 
    6470 
     
    6773} 
    6874 
    69 void    ACBaseCodec::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, bool& outWritable) 
     75void    ACBaseCodec::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable) 
    7076{ 
    7177        switch(inPropertyID) 
     
    7581                        outWritable = false; 
    7682                        break; 
     83                         
    7784                case kAudioCodecPropertyManufacturerCFString: 
    7885                        outPropertyDataSize = sizeof(CFStringRef); 
    7986                        outWritable = false; 
    8087                        break; 
     88                         
     89                case kAudioCodecPropertyFormatCFString: 
     90                        outPropertyDataSize = sizeof(CFStringRef); 
     91                        outWritable = false; 
     92                        break; 
     93                         
     94                case kAudioCodecPropertyRequiresPacketDescription: 
     95                        outPropertyDataSize = sizeof(UInt32); 
     96                        outWritable = false; 
     97                        break; 
     98                         
    8199                case kAudioCodecPropertyMinimumNumberInputPackets : 
    82100                        outPropertyDataSize = sizeof(UInt32); 
    83101                        outWritable = false; 
    84102                        break; 
     103                         
    85104                case kAudioCodecPropertyMinimumNumberOutputPackets : 
    86105                        outPropertyDataSize = sizeof(UInt32); 
    87106                        outWritable = false; 
    88                         break; 
    89                 case kAudioCodecPropertyInputChannelLayout : 
    90                 case kAudioCodecPropertyOutputChannelLayout : 
    91                         // by default a codec doesn't support channel layouts. 
    92                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    93                         break; 
    94                 case kAudioCodecPropertyAvailableInputChannelLayouts : 
    95                 case kAudioCodecPropertyAvailableOutputChannelLayouts : 
    96                         // by default a codec doesn't support channel layouts. 
    97                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    98107                        break; 
    99108 
    100109                case kAudioCodecPropertyCurrentInputFormat: 
    101110                        outPropertyDataSize = sizeof(AudioStreamBasicDescription); 
    102                         outWritable = !mIsInitialized; 
     111                        outWritable = true; 
    103112                        break; 
    104113                         
    105114                case kAudioCodecPropertySupportedInputFormats: 
     115                case kAudioCodecPropertyInputFormatsForOutputFormat: 
    106116                        outPropertyDataSize = GetNumberSupportedInputFormats() * sizeof(AudioStreamBasicDescription); 
    107117                        outWritable = false; 
     
    110120                case kAudioCodecPropertyCurrentOutputFormat: 
    111121                        outPropertyDataSize = sizeof(AudioStreamBasicDescription); 
    112                         outWritable = !mIsInitialized; 
     122                        outWritable = true; 
    113123                        break; 
    114124                         
    115125                case kAudioCodecPropertySupportedOutputFormats: 
     126                case kAudioCodecPropertyOutputFormatsForInputFormat: 
    116127                        outPropertyDataSize = GetNumberSupportedOutputFormats() * sizeof(AudioStreamBasicDescription); 
    117128                        outWritable = false; 
     
    120131                case kAudioCodecPropertyMagicCookie: 
    121132                        outPropertyDataSize = GetMagicCookieByteSize(); 
    122                         outWritable = !mIsInitialized; 
     133                        outWritable = true; 
    123134                        break; 
    124135                         
    125136                case kAudioCodecPropertyInputBufferSize: 
    126137                        outPropertyDataSize = sizeof(UInt32); 
    127                         outWritable = true; 
     138                        outWritable = false; 
    128139                        break; 
    129140                         
     
    152163                        outWritable = false; 
    153164                        break; 
    154                          
     165 
     166                case kAudioCodecPropertyDoesSampleRateConversion: 
     167                        outPropertyDataSize = sizeof(UInt32); 
     168                        outWritable = false; 
     169                        break; 
     170 
    155171                default: 
    156172                        CODEC_THROW(kAudioCodecUnknownPropertyError); 
     
    170186                        if (ioPropertyDataSize != sizeof(CFStringRef)) CODEC_THROW(kAudioCodecBadPropertySizeError); 
    171187                         
     188                        CABundleLocker lock; 
    172189                        CFStringRef name = CFCopyLocalizedStringFromTableInBundle(CFSTR("unknown codec"), CFSTR("CodecNames"), GetCodecBundle(), CFSTR("")); 
    173190                        *(CFStringRef*)outPropertyData = name; 
    174191                        break;  
    175192                } 
     193                 
    176194                case kAudioCodecPropertyManufacturerCFString: 
    177195                { 
    178196                        if (ioPropertyDataSize != sizeof(CFStringRef)) CODEC_THROW(kAudioCodecBadPropertySizeError); 
    179197                         
    180                         CFStringRef name = CFCopyLocalizedStringFromTableInBundle(CFSTR("Apple Computer, Inc."), CFSTR("CodecNames"), GetCodecBundle(), CFSTR("")); 
     198                        CABundleLocker lock; 
     199                        CFStringRef name = CFCopyLocalizedStringFromTableInBundle(CFSTR("Apple, Inc."), CFSTR("CodecNames"), GetCodecBundle(), CFSTR("")); 
    181200                        *(CFStringRef*)outPropertyData = name; 
    182201                        break;  
    183202                } 
     203        case kAudioCodecPropertyRequiresPacketDescription: 
     204                        if(ioPropertyDataSize == sizeof(UInt32)) 
     205                        { 
     206                *reinterpret_cast<UInt32*>(outPropertyData) = 0;  
     207            } 
     208                        else 
     209                        { 
     210                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
     211                        } 
     212            break; 
     213                         
    184214                case kAudioCodecPropertyMinimumNumberInputPackets : 
    185215                        if(ioPropertyDataSize != sizeof(UInt32)) CODEC_THROW(kAudioCodecBadPropertySizeError); 
    186216                        *(UInt32*)outPropertyData = 1; 
    187217                        break; 
     218                         
    188219                case kAudioCodecPropertyMinimumNumberOutputPackets : 
    189220                        if(ioPropertyDataSize != sizeof(UInt32)) CODEC_THROW(kAudioCodecBadPropertySizeError); 
     
    191222                        break; 
    192223                         
    193                 case kAudioCodecPropertyInputChannelLayout : 
    194                 case kAudioCodecPropertyOutputChannelLayout : 
    195                         // by default a codec doesn't support channel layouts. 
    196                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    197                         break; 
    198                 case kAudioCodecPropertyAvailableInputChannelLayouts : 
    199                 case kAudioCodecPropertyAvailableOutputChannelLayouts : 
    200                         // by default a codec doesn't support channel layouts. 
    201                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    202                         break; 
    203                          
    204224                case kAudioCodecPropertyCurrentInputFormat: 
    205225                        if(ioPropertyDataSize == sizeof(AudioStreamBasicDescription)) 
     
    214234                         
    215235                case kAudioCodecPropertySupportedInputFormats: 
     236                case kAudioCodecPropertyInputFormatsForOutputFormat: 
    216237                        thePacketsToGet = ioPropertyDataSize / sizeof(AudioStreamBasicDescription); 
    217238                        GetSupportedInputFormats(reinterpret_cast<AudioStreamBasicDescription*>(outPropertyData), thePacketsToGet); 
     
    231252                         
    232253                case kAudioCodecPropertySupportedOutputFormats: 
     254                case kAudioCodecPropertyOutputFormatsForInputFormat: 
    233255                        thePacketsToGet = ioPropertyDataSize / sizeof(AudioStreamBasicDescription); 
    234256                        GetSupportedOutputFormats(reinterpret_cast<AudioStreamBasicDescription*>(outPropertyData), thePacketsToGet); 
     
    243265                        else 
    244266                        { 
    245                                 CODEC_THROW(kAudioCodecIllegalOperationError); 
     267                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
    246268                        } 
    247269                        break; 
     
    254276                        else 
    255277                        { 
    256                                 CODEC_THROW(kAudioCodecIllegalOperationError); 
     278                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
    257279                        } 
    258280                        break; 
     
    265287                        else 
    266288                        { 
    267                                 CODEC_THROW(kAudioCodecIllegalOperationError); 
     289                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
    268290                        } 
    269291                        break; 
     
    276298                        else 
    277299                        { 
    278                                 CODEC_THROW(kAudioCodecIllegalOperationError); 
     300                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
    279301                        } 
    280302                        break; 
     
    315337                        break; 
    316338 
     339        case kAudioCodecPropertyDoesSampleRateConversion: 
     340                        if(ioPropertyDataSize == sizeof(UInt32)) 
     341                        { 
     342                                *reinterpret_cast<UInt32*>(outPropertyData) = 0; 
     343                        } 
     344                        else 
     345                        { 
     346                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
     347                        } 
     348                        break; 
     349 
    317350                default: 
    318351                        CODEC_THROW(kAudioCodecUnknownPropertyError); 
     
    324357void    ACBaseCodec::SetProperty(AudioCodecPropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData) 
    325358{ 
     359        // No property can be set when the codec is initialized 
     360        if(mIsInitialized) 
     361        { 
     362                CODEC_THROW(kAudioCodecIllegalOperationError); 
     363        } 
     364         
    326365        switch(inPropertyID) 
    327366        { 
    328                 case kAudioCodecPropertyMinimumNumberInputPackets : 
    329                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    330                         break; 
    331                 case kAudioCodecPropertyMinimumNumberOutputPackets : 
    332                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    333                         break; 
    334  
    335                 case kAudioCodecPropertyInputChannelLayout : 
    336                 case kAudioCodecPropertyOutputChannelLayout : 
    337                         // by default a codec doesn't support channel layouts. 
    338                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    339                         break; 
    340  
    341                 case kAudioCodecPropertyAvailableInputChannelLayouts : 
    342                 case kAudioCodecPropertyAvailableOutputChannelLayouts : 
    343                         // by default a codec doesn't support channel layouts. 
    344                         CODEC_THROW(kAudioCodecIllegalOperationError); 
    345                         break; 
    346  
    347367                case kAudioCodecPropertyCurrentInputFormat: 
    348368                        if(inPropertyDataSize == sizeof(AudioStreamBasicDescription)) 
     
    371391                        break; 
    372392                         
     393                case kAudioCodecPropertyMinimumNumberOutputPackets : 
     394                case kAudioCodecPropertyMinimumNumberInputPackets : 
    373395                case kAudioCodecPropertyInputBufferSize: 
    374                         if(inPropertyDataSize == sizeof(UInt32)) 
    375                         { 
    376                                 ReallocateInputBuffer(*reinterpret_cast<const UInt32*>(inPropertyData)); 
    377                         } 
    378                         else 
    379                         { 
    380                                 CODEC_THROW(kAudioCodecBadPropertySizeError); 
    381                         } 
    382                         break; 
    383                          
     396                case kAudioCodecPropertyNameCFString: 
     397                case kAudioCodecPropertyManufacturerCFString: 
     398                case kAudioCodecPropertyFormatCFString: 
    384399                case kAudioCodecPropertySupportedInputFormats: 
    385400                case kAudioCodecPropertySupportedOutputFormats: 
     
    389404                case kAudioCodecPropertyPrimeMethod: 
    390405                case kAudioCodecPropertyPrimeInfo: 
     406                case kAudioCodecPropertyOutputFormatsForInputFormat: 
     407                case kAudioCodecPropertyInputFormatsForOutputFormat: 
     408                case kAudioCodecPropertyDoesSampleRateConversion: 
     409                case kAudioCodecPropertyRequiresPacketDescription: 
    391410                        CODEC_THROW(kAudioCodecIllegalOperationError); 
    392411                        break; 
     
    395414                        CODEC_THROW(kAudioCodecUnknownPropertyError); 
    396415                        break; 
    397                          
    398416        }; 
    399417} 
     
    498516void    ACBaseCodec::GetMagicCookie(void* outMagicCookieData, UInt32& ioMagicCookieDataByteSize) const 
    499517{ 
     518        ioMagicCookieDataByteSize = 0; 
    500519} 
    501520 
  • trunk/ACPublic/ACBaseCodec.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACBaseCodec.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACBaseCodec_h__) 
    4342#define __ACBaseCodec_h__ 
     
    6867//      Construction/Destruction 
    6968public: 
    70                                                                         ACBaseCodec(); 
     69                                                                        ACBaseCodec( OSType theSubType ); 
    7170        virtual                                                 ~ACBaseCodec(); 
    7271 
    7372//      Property Management 
    7473public: 
    75         virtual void                                    GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, bool& outWritable); 
     74        virtual void                                    GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable); 
    7675        virtual void                                    GetProperty(AudioCodecPropertyID inPropertyID, UInt32& ioPropertyDataSize, void* outPropertyData); 
    7776        virtual void                                    SetProperty(AudioCodecPropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData); 
     
    116115         
    117116        FormatList                                              mInputFormatList; 
     117#if TARGET_OS_WIN32 
     118        // VC 2005 screws up if this is not aligned to 8-byte boundaries 
     119        __declspec(align(8)) CAStreamBasicDescription           mInputFormat; 
     120#else 
    118121        CAStreamBasicDescription                mInputFormat; 
     122#endif 
    119123         
    120124        FormatList                                              mOutputFormatList; 
     125#if TARGET_OS_WIN32 
     126        // VC 2005 screws up if this is not aligned to 8-byte boundaries 
     127        __declspec(align(8)) CAStreamBasicDescription           mOutputFormat; 
     128#else 
    121129        CAStreamBasicDescription                mOutputFormat; 
     130#endif 
     131        OSType                                                  mCodecSubType; 
     132        UInt32                                                  mPadding[3]; // Align this with 16-byte boundaries 
    122133 
    123134}; 
  • trunk/ACPublic/ACCodec.cpp

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACCodec.cpp 
    40  
    41 =============================================================================*/ 
    42  
    4341//============================================================================= 
    4442//      Includes 
  • trunk/ACPublic/ACCodec.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACCodec.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACCodec_h__) 
    4342#define __ACCodec_h__ 
     
    4746//============================================================================= 
    4847 
    49 #include "CAConditionalMacros.h" 
    5048 
    51 #if CoreAudio_Use_Framework_Includes 
     49 
     50#if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 
    5251        #include <AudioUnit/AudioCodec.h> 
    5352#else 
     
    7271//      Property Management 
    7372public: 
    74         virtual void    GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outSize, bool& outWritable) = 0; 
     73        virtual void    GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outSize, Boolean& outWritable) = 0; 
    7574        virtual void    GetProperty(AudioCodecPropertyID inPropertyID, UInt32& ioPropertyDataSize, void* outPropertyData) = 0; 
    7675        virtual void    SetProperty(AudioCodecPropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData) = 0; 
     
    9594        throw static_cast<ComponentResult>(err) 
    9695 
     96#define CODEC_THROW_IF(cond, err) \ 
     97        if(bool(cond)) CODEC_THROW(err); 
     98 
    9799#endif 
  • trunk/ACPublic/ACCodecDispatch.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright ᅵ 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACCodecDispatch.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACCodecDispatch_h__) 
    4342#define __ACCodecDispatch_h__ 
     
    4847 
    4948#include "ACCodec.h" 
    50 #include "ACCodecDispatchTypes.h" 
    5149 
    5250//============================================================================= 
     
    6866//============================================================================= 
    6967 
     68#if TARGET_OS_MAC 
     69        #if __LP64__ 
     70                // comp instance, parameters in forward order 
     71                #define PARAM(_typ, _name, _index, _nparams) \ 
     72                        _typ _name = *(_typ *)&inParameters->params[_index + 1]; 
     73        #else 
     74                // parameters in reverse order, then comp instance 
     75                #define PARAM(_typ, _name, _index, _nparams) \ 
     76                        _typ _name = *(_typ *)&inParameters->params[_nparams - 1 - _index]; 
     77        #endif 
     78#elif TARGET_OS_WIN32 
     79                // (no comp instance), parameters in forward order 
     80                #define PARAM(_typ, _name, _index, _nparams) \ 
     81                        _typ _name = *(_typ *)&inParameters->params[_index]; 
     82#endif 
     83 
    7084template <class CodecClass> 
    7185ComponentResult ACCodecDispatch(ComponentParameters* inParameters, CodecClass* inThis) 
     
    8195                        case kComponentOpenSelect: 
    8296                                { 
    83                                         CodecClass*     theCodec = new CodecClass(); 
    84                                         SetComponentInstanceStorage(((AudioCodecOpenGluePB*)inParameters)->inCodec, (Handle)theCodec); 
     97                                        Component codec = (Component)inParameters->params[0]; 
     98                                        ComponentDescription cd; 
     99                                         
     100                                        GetComponentInfo(codec, &cd, NULL, NULL, NULL); 
     101                                        CodecClass*     theCodec = new CodecClass(cd.componentSubType); 
     102                                        SetComponentInstanceStorage((ComponentInstance)codec, (Handle)theCodec); 
    85103                                } 
    86104                                break; 
     
    129147                                                case kAudioCodecGetPropertyInfoSelect: 
    130148                                                        { 
    131                                                                 AudioCodecGetPropertyInfoGluePB* thePB = (AudioCodecGetPropertyInfoGluePB*)inParameters; 
     149                                                                PARAM(AudioCodecPropertyID, inPropertyID, 0, 3); 
     150                                                                PARAM(UInt32 *, outSize, 1, 3); 
     151                                                                PARAM(Boolean *, outWritable, 2, 3); 
     152                                                                 
    132153                                                                UInt32 theSize = 0; 
    133                                                                 bool isWritable = false; 
    134                                                                  
    135                                                                 inThis->GetPropertyInfo(thePB->inPropertyID, theSize, isWritable); 
    136                                                                 if(thePB->outSize != NULL) 
    137                                                                 { 
    138                                                                         *(thePB->outSize) = theSize; 
    139                                                                 } 
    140                                                                 if(thePB->outWritable != NULL) 
    141                                                                 { 
    142                                                                         *(thePB->outWritable) = isWritable ? 1 : 0; 
     154                                                                Boolean isWritable = false; 
     155                                                                 
     156                                                                inThis->GetPropertyInfo(inPropertyID, theSize, isWritable); 
     157                                                                if(outSize != NULL) 
     158                                                                { 
     159                                                                        *outSize = theSize; 
     160                                                                } 
     161                                                                if(outWritable != NULL) 
     162                                                                { 
     163                                                                        *outWritable = isWritable ? 1 : 0; 
    143164                                                                } 
    144165                                                        } 
     
    147168                                                case kAudioCodecGetPropertySelect: 
    148169                                                        { 
    149                                                                 AudioCodecGetPropertyGluePB* thePB = (AudioCodecGetPropertyGluePB*)inParameters; 
    150                                                                  
    151                                                                 if((thePB->ioPropertyDataSize != NULL) && (thePB->outPropertyData != NULL)) 
    152                                                                 { 
    153                                                                         inThis->GetProperty(thePB->inPropertyID, *(thePB->ioPropertyDataSize), thePB->outPropertyData); 
     170                                                                PARAM(AudioCodecPropertyID, inPropertyID, 0, 3); 
     171                                                                PARAM(UInt32 *, ioPropertyDataSize, 1, 3); 
     172                                                                PARAM(void *, outPropertyData, 2, 3); 
     173                                                                 
     174                                                                if((ioPropertyDataSize != NULL) && (outPropertyData != NULL)) 
     175                                                                { 
     176                                                                        inThis->GetProperty(inPropertyID, *ioPropertyDataSize, outPropertyData); 
    154177                                                                } 
    155178                                                                else 
     
    162185                                                case kAudioCodecSetPropertySelect: 
    163186                                                        { 
    164                                                                 AudioCodecSetPropertyGluePB* thePB = (AudioCodecSetPropertyGluePB*)inParameters; 
    165                                                                  
    166                                                                 if(thePB->inPropertyData != NULL) 
    167                                                                 { 
    168                                                                         inThis->SetProperty(thePB->inPropertyID, thePB->inPropertyDataSize, thePB->inPropertyData); 
     187                                                                PARAM(AudioCodecPropertyID, inPropertyID, 0, 3); 
     188                                                                PARAM(UInt32, inPropertyDataSize, 1, 3); 
     189                                                                PARAM(const void *, inPropertyData, 2, 3); 
     190                                                                 
     191                                                                if(inPropertyData != NULL) 
     192                                                                { 
     193                                                                        inThis->SetProperty(inPropertyID, inPropertyDataSize, inPropertyData); 
    169194                                                                } 
    170195                                                                else 
     
    177202                                                case kAudioCodecInitializeSelect: 
    178203                                                        { 
    179                                                                 AudioCodecInitializeGluePB* thePB = (AudioCodecInitializeGluePB*)inParameters; 
    180                                                                  
    181                                                                 inThis->Initialize(thePB->inInputFormat, thePB->inOutputFormat, thePB->inMagicCookie, thePB->inMagicCookieByteSize); 
     204                                                                PARAM(const AudioStreamBasicDescription *, inInputFormat, 0, 4); 
     205                                                                PARAM(const AudioStreamBasicDescription *, inOutputFormat, 1, 4); 
     206                                                                PARAM(const void *, inMagicCookie, 2, 4); 
     207                                                                PARAM(UInt32, inMagicCookieByteSize, 3, 4); 
     208                                                                 
     209                                                                inThis->Initialize(inInputFormat, inOutputFormat, inMagicCookie, inMagicCookieByteSize); 
    182210                                                        } 
    183211                                                        break; 
     
    185213                                                case kAudioCodecUninitializeSelect: 
    186214                                                        { 
    187                                                                 //AudioCodecUninitializeGluePB* thePB = (AudioCodecUninitializeGluePB*)inParameters; 
    188                                                                  
    189215                                                                inThis->Uninitialize(); 
    190216                                                        } 
     
    193219                                                case kAudioCodecAppendInputDataSelect: 
    194220                                                        { 
    195                                                                 AudioCodecAppendInputDataGluePB* thePB = (AudioCodecAppendInputDataGluePB*)inParameters; 
    196                                                                  
    197                                                                 if((thePB->inInputData != NULL) && (thePB->ioInputDataByteSize != NULL)) 
    198                                                                 { 
    199                                                                         if(thePB->ioNumberPackets != NULL) 
     221                                                                PARAM(const void *, inInputData, 0, 4); 
     222                                                                PARAM(UInt32 *, ioInputDataByteSize, 1, 4); 
     223                                                                PARAM(UInt32 *, ioNumberPackets, 2, 4); 
     224                                                                PARAM(const AudioStreamPacketDescription *, inPacketDescription, 3, 4); 
     225                                                                 
     226                                                                if((inInputData != NULL) && (ioInputDataByteSize != NULL)) 
     227                                                                { 
     228                                                                        if(ioNumberPackets != NULL) 
    200229                                                                        { 
    201                                                                                 inThis->AppendInputData(thePB->inInputData, *(thePB->ioInputDataByteSize), *(thePB->ioNumberPackets), thePB->inPacketDescription); 
     230                                                                                inThis->AppendInputData(inInputData, *ioInputDataByteSize, *ioNumberPackets, inPacketDescription); 
    202231                                                                        } 
    203232                                                                        else 
    204233                                                                        { 
    205234                                                                                UInt32 theNumberPackets = 0; 
    206                                                                                 inThis->AppendInputData(thePB->inInputData, *(thePB->ioInputDataByteSize), theNumberPackets, thePB->inPacketDescription); 
     235                                                                                inThis->AppendInputData(inInputData, *ioInputDataByteSize, theNumberPackets, inPacketDescription); 
    207236                                                                        } 
    208237                                                                } 
     
    216245                                                case kAudioCodecProduceOutputDataSelect: 
    217246                                                        { 
    218                                                                 AudioCodecProduceOutputPacketsGluePB* thePB = (AudioCodecProduceOutputPacketsGluePB*)inParameters; 
    219                                                                  
    220                                                                 if((thePB->outOutputData != NULL) && (thePB->ioOutputDataByteSize != NULL) && (thePB->ioNumberPackets != NULL) && (thePB->outStatus != NULL)) 
    221                                                                 { 
    222                                                                         *(thePB->outStatus) = inThis->ProduceOutputPackets(thePB->outOutputData, *(thePB->ioOutputDataByteSize), *(thePB->ioNumberPackets), thePB->outPacketDescription); 
     247                                                                PARAM(void *, outOutputData, 0, 5); 
     248                                                                PARAM(UInt32 *, ioOutputDataByteSize, 1, 5); 
     249                                                                PARAM(UInt32 *, ioNumberPackets, 2, 5); 
     250                                                                PARAM(AudioStreamPacketDescription *, outPacketDescription, 3, 5); 
     251                                                                PARAM(UInt32 *, outStatus, 4, 5); 
     252                                                                 
     253                                                                if((outOutputData != NULL) && (ioOutputDataByteSize != NULL) && (ioNumberPackets != NULL) && (outStatus != NULL)) 
     254                                                                { 
     255                                                                        *outStatus = inThis->ProduceOutputPackets(outOutputData, *ioOutputDataByteSize, *ioNumberPackets, outPacketDescription); 
     256                                                                        if(kAudioCodecProduceOutputPacketFailure == *outStatus) 
     257                                                                        { 
     258                                                                                theError = paramErr; 
     259                                                                        } 
    223260                                                                } 
    224261                                                                else 
     
    231268                                                case kAudioCodecResetSelect: 
    232269                                                        { 
    233                                                                 //AudioCodecResetGluePB* thePB = (AudioCodecResetGluePB*)inParameters; 
    234                                                                  
    235270                                                                inThis->Reset(); 
    236271                                                        } 
  • trunk/ACPublic/ACCodecDispatchTypes.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACCodecDispatchTypes.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACCodecDispatchTypes_h__) 
    4342#define __ACCodecDispatchTypes_h__ 
  • trunk/ACPublic/ACComponentResources.r

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACComponentResources.r 
    40  
    41 =============================================================================*/ 
    42  
    4341#ifndef GEN_MISSING 
    4442        #define GEN_MISSING 0 
  • trunk/ACPublic/ACConditionalMacros.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACConditionalMacros.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACConditionalMacros_h__) 
    4342#define __ACConditionalMacros_h__ 
  • trunk/ACPublic/ACSimpleCodec.cpp

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright ᅵ 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACSimpleCodec.cpp 
    40  
    41 =============================================================================*/ 
    42  
    4341//============================================================================= 
    4442//      Includes 
     
    5250//============================================================================= 
    5351 
    54 static const UInt32 kBufferPad = 3840; // this is used to prevent end from passing start. 
    55  
    56 ACSimpleCodec::ACSimpleCodec(UInt32 inInputBufferByteSize) 
     52static const UInt32 kBufferPad = 64; // this is used to prevent end from passing start. 
     53 
     54ACSimpleCodec::ACSimpleCodec(UInt32 inInputBufferByteSize, OSType theSubType) 
    5755: 
    58         ACBaseCodec(), 
     56        ACBaseCodec(theSubType), 
    5957        mInputBuffer(NULL), 
    6058        mInputBufferByteSize(inInputBufferByteSize+kBufferPad), 
     
    127125} 
    128126 
     127 
    129128void    ACSimpleCodec::AppendInputBuffer(const void* inInputData, UInt32 inOffset, UInt32& ioInputDataByteSize) 
    130129{ 
     
    227226} 
    228227 
     228 
     229void    ACSimpleCodec::ZeroPadInputData(UInt32& ioNumberPackets, const AudioStreamPacketDescription* inPacketDescription) 
     230{ 
     231        //      this buffer handling code doesn't care about such things as the packet descriptions 
     232        if(!mIsInitialized) CODEC_THROW(kAudioCodecStateError); 
     233         
     234         
     235        //      this is a ring buffer we're dealing with, so we need to set up a few things 
     236        UInt32 theUsedByteSize = GetUsedInputBufferByteSize(); 
     237        UInt32 theAvailableByteSize = GetInputBufferByteSize() - theUsedByteSize; 
     238         
     239        // >>jamesmcc: added this because ioNumberPackets was not being updated if less was taken than given. 
     240        // THIS ASSUMES CBR! 
     241        UInt32 bytesPerPacketOfInput = mInputFormat.mBytesPerPacket; 
     242        UInt32 theAvailablePacketSize = theAvailableByteSize / bytesPerPacketOfInput; 
     243         
     244        UInt32 minPacketSize = ioNumberPackets < theAvailablePacketSize ? ioNumberPackets : theAvailablePacketSize; 
     245        UInt32 minByteSize = minPacketSize * bytesPerPacketOfInput; 
     246         
     247        //      we can copy only as much data as there is or up to how much space is availiable 
     248        ioNumberPackets = minPacketSize; 
     249         
     250        // <<jamesmcc  
     251         
     252        //      now we have to copy the data taking into account the wrap around and where the start is 
     253        if(mInputBufferEnd + minByteSize < mInputBufferByteSize) 
     254        { 
     255                //      no wrap around here 
     256                memset(mInputBuffer + mInputBufferEnd, 0, minByteSize); 
     257                 
     258                //      adjust the end point 
     259                mInputBufferEnd += minByteSize; 
     260        } 
     261        else 
     262        { 
     263                //      the copy will wrap 
     264                 
     265                //      copy the first part 
     266                UInt32 theBeforeWrapByteSize = mInputBufferByteSize - mInputBufferEnd; 
     267                memset(mInputBuffer + mInputBufferEnd, 0, theBeforeWrapByteSize); 
     268                 
     269                //      and the rest 
     270                UInt32 theAfterWrapByteSize = minByteSize - theBeforeWrapByteSize; 
     271                memset(mInputBuffer, 0, theAfterWrapByteSize); 
     272                 
     273                //      adjust the end point 
     274                mInputBufferEnd = theAfterWrapByteSize; 
     275        } 
     276} 
     277 
     278 
    229279void    ACSimpleCodec::ConsumeInputData(UInt32 inConsumedByteSize) 
    230280{ 
     
    281331                // need to copy beginning of buffer to the end.  
    282332                // We cleverly over allocated our buffer space to make this possible. 
    283                 memcpy(mInputBuffer + mInputBufferByteSize, mInputBuffer, leftOver); 
     333                memmove(mInputBuffer + mInputBufferByteSize, mInputBuffer, leftOver); 
    284334        } 
    285335         
     
    306356        mInputBufferEnd = 0; 
    307357} 
     358 
     359void    ACSimpleCodec::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable) 
     360{ 
     361        switch(inPropertyID) 
     362        { 
     363                case kAudioCodecPropertyInputBufferSize: 
     364                        outPropertyDataSize = sizeof(UInt32); 
     365                        outWritable = true; 
     366                        break; 
     367                default: 
     368                        ACBaseCodec::GetPropertyInfo(inPropertyID, outPropertyDataSize, outWritable); 
     369                        break; 
     370        } 
     371 
     372} 
     373 
     374void    ACSimpleCodec::SetProperty(AudioCodecPropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData) 
     375{ 
     376        switch(inPropertyID) 
     377        { 
     378                case kAudioCodecPropertyInputBufferSize: 
     379                        if(inPropertyDataSize == sizeof(UInt32)) 
     380                        { 
     381                                ReallocateInputBuffer(*reinterpret_cast<const UInt32*>(inPropertyData)); 
     382                        } 
     383                        else 
     384                        { 
     385                                CODEC_THROW(kAudioCodecBadPropertySizeError); 
     386                        } 
     387                        break; 
     388                default: 
     389            ACBaseCodec::SetProperty(inPropertyID, inPropertyDataSize, inPropertyData); 
     390            break;             
     391    } 
     392} 
  • trunk/ACPublic/ACSimpleCodec.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright ᅵ 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         ACSimpleCodec.h 
    40  
    41 =============================================================================*/ 
    4241#if !defined(__ACSimpleCodec_h__) 
    4342#define __ACSimpleCodec_h__ 
     
    6362//      Construction/Destruction 
    6463public: 
    65                                                 ACSimpleCodec(UInt32 inInputBufferByteSize); 
     64                                                ACSimpleCodec(UInt32 inInputBufferByteSize, OSType theSubType); 
    6665        virtual                         ~ACSimpleCodec(); 
    6766 
     
    7271        virtual void            Reset(); 
    7372 
     73        virtual void            AppendInputBuffer(const void* inInputData, UInt32 inOffset, UInt32& ioInputDataByteSize); 
    7474        virtual void            AppendInputData(const void* inInputData, UInt32& ioInputDataByteSize, UInt32& ioNumberPackets, const AudioStreamPacketDescription* inPacketDescription); 
    75         virtual void            ACSimpleCodec::AppendInputBuffer(const void* inInputData, UInt32 inOffset, UInt32& ioInputDataByteSize); 
     75        virtual void            ZeroPadInputData(UInt32& ioNumberPackets, const AudioStreamPacketDescription* inPacketDescription); 
    7676        virtual UInt32          GetInputBufferByteSize() const; 
    7777        virtual UInt32          GetUsedInputBufferByteSize() const; 
     78        virtual void            GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable); 
     79        virtual void            SetProperty(AudioCodecPropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData); 
    7880 
    7981protected: 
  • trunk/ACPublic/GetCodecBundle.cpp

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         GetCodecBundle.cpp 
    40  
    41  
    42  *  Created by James McCartney on Thu Apr 10 2003. 
    43 =============================================================================*/ 
    44  
    4541#include "GetCodecBundle.h" 
    4642 
    47 const CFStringRef kCodecBundleID = CFSTR("com.apple.audio.codecs.Components"); 
     43#if TARGET_OS_WIN32 
     44        #include "CAWin32StringResources.h" 
     45#endif 
     46 
     47const CFStringRef kCodecBundleID = CFSTR("com.mycompany.myformat"); // must match CFBundleIdentifier in plist file 
    4848 
    4949CFBundleRef GetCodecBundle() 
     
    5353        { 
    5454                sAudioCodecBundle = CFBundleGetBundleWithIdentifier(kCodecBundleID); 
    55                 CFRetain(sAudioCodecBundle); 
     55                if (sAudioCodecBundle) 
     56                { 
     57                        CFRetain(sAudioCodecBundle); 
     58                } 
    5659        } 
    5760        return sAudioCodecBundle; 
  • trunk/ACPublic/GetCodecBundle.h

    r1 r65  
    1 /*      Copyright:      © Copyright 2004 Apple Computer, Inc. All rights reserved. 
    2  
    3         Disclaimer:     IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc. 
    4                         ("Apple") in consideration of your agreement to the following terms, and your 
    5                         use, installation, modification or redistribution of this Apple software 
    6                         constitutes acceptance of these terms.  If you do not agree with these terms, 
    7                         please do not use, install, modify or redistribute this Apple software. 
    8  
    9                         In consideration of your agreement to abide by the following terms, and subject 
    10                         to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs 
    11                         copyrights in this original Apple software (the "Apple Software"), to use, 
    12                         reproduce, modify and redistribute the Apple Software, with or without 
    13                         modifications, in source and/or binary forms; provided that if you redistribute 
    14                         the Apple Software in its entirety and without modifications, you must retain 
    15                         this notice and the following text and disclaimers in all such redistributions of 
    16                         the Apple Software.  Neither the name, trademarks, service marks or logos of 
    17                         Apple Computer, Inc. may be used to endorse or promote products derived from the 
    18                         Apple Software without specific prior written permission from Apple.  Except as 
    19                         expressly stated in this notice, no other rights or licenses, express or implied, 
    20                         are granted by Apple herein, including but not limited to any patent rights that 
    21                         may be infringed by your derivative works or by other works in which the Apple 
    22                         Software may be incorporated. 
    23  
    24                         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO 
    25                         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED 
    26                         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
    27                         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN 
    28                         COMBINATION WITH YOUR PRODUCTS. 
    29  
    30                         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR 
    31                         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
    32                         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
    33                         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION 
    34                         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT 
    35                         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN 
    36                         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     1/*      Copyright © 2007 Apple Inc. All Rights Reserved. 
     2         
     3        Disclaimer: IMPORTANT:  This Apple software is supplied to you by  
     4                        Apple Inc. ("Apple") in consideration of your agreement to the 
     5                        following terms, and your use, installation, modification or 
     6                        redistribution of this Apple software constitutes acceptance of these 
     7                        terms.  If you do not agree with these terms, please do not use, 
     8                        install, modify or redistribute this Apple software. 
     9                         
     10                        In consideration of your agreement to abide by the following terms, and 
     11                        subject to these terms, Apple grants you a personal, non-exclusive 
     12                        license, under Apple's copyrights in this original Apple software (the 
     13                        "Apple Software"), to use, reproduce, modify and redistribute the Apple 
     14                        Software, with or without modifications, in source and/or binary forms; 
     15                        provided that if you redistribute the Apple Software in its entirety and 
     16                        without modifications, you must retain this notice and the following 
     17                        text and disclaimers in all such redistributions of the Apple Software.  
     18                        Neither the name, trademarks, service marks or logos of Apple Inc.  
     19                        may be used to endorse or promote products derived from the Apple 
     20                        Software without specific prior written permission from Apple.  Except 
     21                        as expressly stated in this notice, no other rights or licenses, express 
     22                        or implied, are granted by Apple herein, including but not limited to 
     23                        any patent rights that may be infringed by your derivative works or by 
     24                        other works in which the Apple Software may be incorporated. 
     25                         
     26                        The Apple Software is provided by Apple on an "AS IS" basis.  APPLE 
     27                        MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 
     28                        THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 
     29                        FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 
     30                        OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 
     31                         
     32                        IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 
     33                        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     34                        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     35                        INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 
     36                        MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 
     37                        AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 
     38                        STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 
     39                        POSSIBILITY OF SUCH DAMAGE. 
    3740*/ 
    38 /*============================================================================= 
    39         GetCodecBundle.h 
    40  
    41  
    42  *  Created by James McCartney on Thu Apr 10 2003. 
    43 =============================================================================*/ 
    44  
    4541#ifndef _GetCodecBundle_ 
    4642#define _GetCodecBundle_