OSDN Git Service

Enable aux effect attachment before the AudioTrack creation.
authorJean-Michel Trivi <jmtrivi@google.com>
Tue, 12 Oct 2010 21:05:56 +0000 (14:05 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Tue, 12 Oct 2010 21:05:56 +0000 (14:05 -0700)
commitc35fd2e7ba670b1024a920ebf007b0fa1d92c969
tree4f18bc230c4c443983160a557b186db49cb98208
parent521de5ed291f559f536fd429521b00c67e756725
Enable aux effect attachment before the AudioTrack creation.

When an OpenSL ES AudioPlayer is playing content from a URI or FD,
 the AudioTrack it plays on is only created once prefetching is
 far along enough that the playback properties are known (channel
 count, word size and sample rate). This happens after Realize()
 is called on the AudioPlayer. If, before the AudioTrack is created,
 the SLEffectSendItf interface is used to configure the aux send
 for that player, there is no AudioTrack to configure.

 The fix consists in keeping track of the effect the track needs
 to be attached to, and with what level. Once the track is
 created, and it gets configured (volume, mutes, channel solos,
 marker callbacks) we also attach it to the aux effect if
 necessary.

Change-Id: I12230a8cbf7dc3876d3713a006b9702d44e9d6e5
opensles/libopensles/IEngine.c
opensles/libopensles/android_AudioPlayer.cpp
opensles/libopensles/android_Effect.cpp
opensles/libopensles/sles_allinclusive.h