Re: AUGraph stream format problems
Re: AUGraph stream format problems
- Subject: Re: AUGraph stream format problems
- From: William Stewart <email@hidden>
- Date: Mon, 6 Oct 2003 16:47:00 -0700
James,
On 06/10/2003, at 4:33 PM, James Coker wrote:
On Monday, October 6, 2003, at 04:19 PM, William Stewart wrote:
AUGraph doesn't make these decisions.
The errors are being returned by the AU you are connecting too (the
connection semantics are enforced by the AU - ie. the connection
needs to have the same format from output to input - if that format
is invalid then the connection will return an error). Its left to the
user of the graph to ensure that the connection will be valid and to
deal with it when it isn't.
Ok, I grok that.
The next bit is a little confusing:
We modified this behaviour between Jaguar and Panther given the
discussions we'd had about AU's and format negotiation (ie. can't
generally reset formats if the AU is initialized) - so the AUGraph
code's order of operations was modified to reflect this semantic.
Thus, now, the AUGraph will *not* initialize an AU until it is
involved in a connection, and it will initialize the AU *after* the
connection is made.
Does 'now' mean AUGraph in Jaguar, or in Panther?
now means Panther (or the core audio pieces that are in the QuickTime
6.4 update to Jaguar)
Obviously, as a connection can involve both input and output sides,
this is not foolproof. Also, if the graph is running, this
connection/initialization will be made on the render thread -
generally not a good idea.
So the general advise is, make sure the formats are correct and the
AU is initialized before connecting it to a playing graph. (That also
allows you to determine if the AU can become a member of the graph at
the location, etc, you want it to be).
This seems contradictory with the statement above about AUGraph. So I
should check the I/O bus formats, then init the AU, then add to the
graph?
Yes - I don't see the contradiction... The AU will still be connected
by the graph, but be establishing the formats correctly *before* doing
the connection, and *intitializing* an AU before connecting it (but
after setting its formats!) two things then happen:
(1) In the process of making a connection there is no mismatch of the
formats, so no need to reformat the AU
(2) The graph then initializes the unit - which becomes a no-op because
you've already initialized it outside of the graph by *explicitly*
calling AudioUnitInitialize on the AU before connecting it.
Does that make sense.
(BTW - this order of operations will work with a previous Jaguar graph
as well)
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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.