validate StreamFormat
validate StreamFormat
- Subject: validate StreamFormat
- From: "Mark's Studio" <email@hidden>
- Date: Fri, 18 Jun 2004 00:59:13 +0200
What is the right thing to do in ChangeStreamFormat, so it's only
supported formats that's allowed?
UInt32 SpectrumAU::SupportedNumChannels ( const AUChannelInfo** outInfo)
{
static AUChannelInfo synthChannels[] = { {1, 1}, {2, 2} };
if (outInfo != NULL)
*outInfo = synthChannels;
return sizeof(synthChannels) / sizeof(AUChannelInfo);
}
ComponentResult SpectrumAU::ChangeStreamFormat(AudioUnitScope iScope,
AudioUnitElement iElem, const CAStreamBasicDescription& sOld, const
CAStreamBasicDescription& sNew)
{
ComponentResult result = AUBase::ChangeStreamFormat(iScope, iElem,
sOld, sNew);
if (result == noErr)
{
if (sOld.NumberChannels()!=sNew.NumberChannels())
{
const UInt32 iCha=sNew.NumberChannels();
if ((iCha>2) || (sNew.NumberInterleavedChannels()>1))
result = kAudioUnitErr_FormatNotSupported;
}
}
return result;
}
Input/Output Channel Handling:
1-1 1-2 1-4 1-5 2-2 2-4 2-5 4-4 4-5
5-5 5-2 6-6 8-8
X X
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
OutputChan:2
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
OutputChan:4
WARNING: Can Initialize Unit to un-supported num channels:InputChan:1,
OutputChan:5
WARNING: Can Initialize Unit to un-supported num channels:InputChan:2,
OutputChan:4
WARNING: Can Initialize Unit to un-supported num channels:InputChan:2,
OutputChan:5
WARNING: Can Initialize Unit to un-supported num channels:InputChan:4,
OutputChan:4
WARNING: Can Initialize Unit to un-supported num channels:InputChan:4,
OutputChan:5
WARNING: Can Initialize Unit to un-supported num channels:InputChan:5,
OutputChan:5
WARNING: Can Initialize Unit to un-supported num channels:InputChan:5,
OutputChan:2
WARNING: Can Initialize Unit to un-supported num channels:InputChan:6,
OutputChan:6
WARNING: Can Initialize Unit to un-supported num channels:InputChan:8,
OutputChan:8
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.