Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
- Subject: Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
- From: Jeff Moore <email@hidden>
- Date: Tue, 9 May 2006 12:54:32 -0700
There could be lots of reasons. For instance, you don't say how you
are filling out the ASBD for the format your encoder. For VBR
formats, you should be specifying pretty much the whole ASBD as zero
save for the sample rate, format ID and number of channels (and flags
if you are using any).
Also, from looking at the AudioConverter's code, it looks as if the
packet descriptions won't get asked for if the caller of the
AudioConverter didn't ask for them. What are you using to test your
codec with?
On May 9, 2006, at 12:44 PM, Mike Erickson wrote:
Ok, so if I fill in the properties
kAudioCodecPropertyRequiresPacketDescription and
kAudioCodecPropertyHasVariablePacketByteSizes correctly with non-
zero values, why is outPacketDescription always NULL when my
ProduceOutputPackets is called? How do I make sure I get the
packet descriptions so I can encode VBR?
Mike
Jeff Moore wrote:
On return, ioOutputDataByteSize is supposed to contain the number of
bytes the codec wrote to the buffer pointed to by outOutputData. If
you are writing a codec, you should always follow the semantics of
the Audio Codec API regardless of what the layers above are doing
with the values you return. You never know when those layers are
going to change, so it's best to just follow the rules here.
Also, there's no requirement that the caller of
AudioCodecProduceOutputPackets use what you return in
ioOutputDataByteSize. The reason why is that it is, in a lot of ways,
redundant information when you already know the format of the data
(and thus know the bytes per packet) or, in the case of VBR formats,
you have the packet descriptions.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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