Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
- Subject: Re: AudioCodec, ProduceOutputpackets and ioOutputDataByteSize
- From: Mike Erickson <email@hidden>
- Date: Tue, 9 May 2006 17:26:06 -0400
I *am* returning true for
kAudioCodecPropertyRequiresPacketDescription, and I don't get packet
descriptions in my encoder when testing with afconvert and
ConvertFile from the SDK. How can I ever hope to encode VBR?
BTW, I am filling in ioOutputDataByteSize, I just left it zeroed by
mistake once and nothing seemed to change.
Mike
On May 9, 2006, at 5:15 PM, James McCartney wrote:
If your codec is VBR, you must return true for
kAudioCodecPropertyRequiresPacketDescription.
If the client did not provide packet descriptions, your codec will
not get a pointer to any to fill out.
The value of ioOutputDataByteSize on return from
AudioCodecProduceOutputPackets IS used when encoding. It should not
be zero unless you are returning a non-success result code. If you
are setting this to zero and there is a request could not be filled
in a single pull, you will likely get a corrupted stream.
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.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.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