Audio output driver for Android OS.
More...
#include <MpodAndroid.h>
|
static void | audioCallback (int event, void *user, void *info) |
| Callback function called by Android to request more data. More...
|
|
Audio output driver for Android OS.
- See also
- MpOutputDeviceDriver
Enumerator |
---|
DRIVER_IDLE |
MpodAndroid is being initialized or initialization failed.
|
DRIVER_INIT |
MpodAndroid has been successfully initialized and is not playing.
|
DRIVER_STARTING |
MpodAndroid is starting playing.
|
DRIVER_PLAYING |
MpodAndroid is playing.
|
DRIVER_STOPPING |
MpodAndroid is stopping.
|
DRIVER_STOPPED |
MpodAndroid is stopped: the AudioTrack will be stopped.
|
Default constructor.
- Note
- Device name is not supported under Android for now.
Copy constructor (not implemented for this class)
OsStatus enableDevice |
( |
unsigned |
samplesPerFrame, |
|
|
unsigned |
samplesPerSec, |
|
|
MpFrameTime |
currentFrameTime, |
|
|
OsCallback & |
frameTicker |
|
) |
| |
|
virtual |
OsStatus disableDevice |
( |
| ) |
|
|
virtual |
Uninitialize device driver.
This method disables the device driver and should release any platform device resources so that the device might be used else where.
this SHOULD NOT be used to mute/unmute a device. Disabling and enabling a device results in state and buffer queues being cleared.
This method is supposed to be used from MpAudioOutputConnection only. If you want disable device, use MpOutputDeviceManager or MpAudioOutputConnection methods.
Implements MpOutputDeviceDriver.
Send data to output device.
This method is called from a callback which is called when we fire ticker notification. See enableDevice() for details.
- Parameters
-
[in] | numSamples | - Number of samples in samples array. |
[in] | samples | - Array of samples to push to device. |
[in] | frameTime | - Time of pushed frame. Device may consider does it want it or not internally. If frame come too late driver should return OS_SUCCESS and throw out it silently. Common problem is when MediaTask queue is jammed - no frames are processed for some time and then they are processed bursty. Using given frameTime driver may keep its internal queue short. It is guaranteed that frame time would increase monotonically. |
- Returns
- OS_LIMIT_REACHED if mixer buffer is full, i.e. frame come too early.
-
OS_FAILED for other errors.
-
OS_SUCCESS if frame sent correctly.
- See also
- enableDevice() for documentation when this is being called.
Implements MpOutputDeviceDriver.
UtlBoolean initAudioTrack |
( |
| ) |
|
|
protected |
Allocates and configures AudioTrack used for PCM output.
void audioCallback |
( |
int |
event, |
|
|
void * |
user, |
|
|
void * |
info |
|
) |
| |
|
staticprotected |
Callback function called by Android to request more data.
Assignment operator (not implemented for this class)
Android type of the output stream.
Pointer to audio track used for playback.
Mutex to control concurrent access to this object from audio callback and application API
condition enabling interface to wait for audio callback completion after a change is requested
The current frame time for this device.
OsNotification* mpNotifier |
|
protected |
Event signaled when windows is ready to receive a new buffer.
Buffer which pushBuffer should copy to.
Index of the first sample not yet pushed to device.