| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Sep 18, 2006, at 9:15 PM, David M. Cotter wrote:
There's no exact way to do this. (Believe me I've tried!). The AudioConverter uses a pull model, not a push model. That said, the AudioConverter contract is much more lax than AudioUnits'. No matter how much you ask for, in your input proc, you can provide ALL the samples you have, and it will internally copy and buffer them if your output isn't going to consume all of them on the current pull. In general, it's a good idea to err on the "pull for a little too much" side, rather than pull for too little. SCAudio is not obligated to provide all the packets you pulled for. It can provide none, fewer than you asked for, or exactly the number you asked for (but never more, since that would overrun your output buffer). If you know how many packets of input you've got, and your input format is not variable-frames-per-packet (i.e. it has a non-zero mFramesPerPacket), and your output format is not variable-frames per packet (i.e. it also has a non-zero mFramesPerPacket), then you can compute how many packets to pull for.
It's a bad idea to try to consume exactly 1 video frame's worth of audio through SCAudio (or AudioConverter for that matter), unless you're going to a PCM format. If you're going to a compressed format, you're not going to be able to make them line up exactly. But as I said above, SCAudio will internally buffer anything you don't use up in the current pull round, and give it to you the next time.
Whenever your input proc is called, provide all the input you currently have available. If your input proc is called and you are currently dry (but not permanently out of data), simply return an error from your input proc. If you are out of data and won't be getting any more, set *ioNumPackets to zero, and all the ioData mData's to NULL. -Brad Ford QuickTime Engineering
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-API mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-api/email@hidden This email sent to email@hidden
| References: | |
| >RE: SCAudioFillBuffer (From: "Joe Honoroff" <email@hidden>) | |
| >Fwd: SCAudioFillBuffer (From: Brad Ford <email@hidden>) | |
| >Re: SCAudioFillBuffer (From: "David M. Cotter" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.