Re: SCAudioFillBuffer vs AudioConverterFillComplexBuffer
Re: SCAudioFillBuffer vs AudioConverterFillComplexBuffer
- Subject: Re: SCAudioFillBuffer vs AudioConverterFillComplexBuffer
- From: Brad Ford <email@hidden>
- Date: Thu, 9 Apr 2009 11:35:58 -0700
So to follow up, here was the solution to Jim's SCAudioFillBuffer
problem.
SCAudio, by default, disallows non-interleaved output, since Standard
Compression components historically are used to produce safe settings
for doing encodes to various file formats. So non-interleaved output
is not the typical usage case. To get SCAudio to produce non-
interleaved pcm output, you just add one call:
// after you open the component,
SCAudioFormatFlagsRestrictions restrictions;
restrictions.formatFlagsMask =
kLinearPCMFormatFlagIsNonInterleaved;
restrictions.formatFlagsValues =
kLinearPCMFormatFlagIsNonInterleaved;
err = QTSetComponentProperty( *outSCAudio, kQTPropertyClass_SCAudio,
kQTSCAudioPropertyID_ClientRestrictedLPCMFlags,
sizeof( restrictions),
&restrictions);
Now Jim's code works as expected.
-Brad Ford
QuickTime Engineering
On Apr 7, 2009, at 2:03 PM, Brad Ford wrote:
There's not enough code here. Jim, could you send me a little
command line app (source code) that I can look at? Also have a look
at scaudiocompress sample code if you haven't already.
-Brad Ford
QuickTime Engineering
On Apr 7, 2009, at 1:13 PM, Jim Heintz wrote:
Hi All,
I am working on porting a project to Quicktime for Windows, and
therefore must change from using AudioConverter to the
StandardCompressionSubTypeAudio component. My code works great
with AudioConverter, however I am having trouble decoding AAC using
SCAudioFillBuffer. I am able to create the component and set its
kQTSCAudioPropertyID_InputBasicStream and
kQTSCAudioPropertyID_BasicStream parameters without error, however
whenever I call SCAudioFillBuffer, it returns -50 and never calls
the DataProc handler function. I setup the AudioBufferList in
exactly the same manner as I do when I call
AudioConverterFillComplexBuffer, but for some reason it is
complaining of a bad parameter.
Here is the code that calls SCAudioFillBuffer
UInt32 outPackets = AAC_PACKET_FLOATS * 64;
decompBufList->mNumberBuffers = 2;
decompBufList->mBuffers[0].mNumberChannels = 1;
decompBufList->mBuffers[0].mDataByteSize = CONVERTER_BUF_SIZE;
decompBufList->mBuffers[0].mData = decompressBuffer;
decompBufList->mBuffers[1].mNumberChannels = 1;
decompBufList->mBuffers[1].mDataByteSize = CONVERTER_BUF_SIZE;
decompBufList->mBuffers[1].mData = decompressBuffer2;
#if MAC_VERSION
int err = AudioConverterFillComplexBuffer(decompressor,
decoderDataProc, this, &outPackets, decompBufList, NULL);
#else
int err = SCAudioFillBuffer( decompressor, decoderDataProc, this,
&outPackets, decompBufList, NULL);
#endif
This code works properly on Mac, however on Windows
SCAudioFillBuffer returns -50 and never calls decoderDataProc.
I have tried a lot of different things... Any suggestions?
Best regards,
Jim Heintz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden