GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
droidaudio.c File Reference
#include "javaenv.h"
#include <gpac/modules/audio_out.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <gpac/constants.h>
#include <android/log.h>
+ Include dependency graph for droidaudio.c:

Data Structures

struct  DroidContext
 

Macros

#define STREAM_MUSIC   3
 
#define CHANNEL_CONFIGURATION_MONO   2
 
#define CHANNEL_CONFIGURATION_STEREO   3
 
#define ENCODING_PCM_8BIT   3
 
#define ENCODING_PCM_16BIT   2
 
#define MODE_STREAM   1
 
#define CHANNEL_OUT_MONO   4
 
#define CHANNEL_IN_STEREO   12
 
#define CHANNEL_IN_MONO   16
 
#define TAG   "GPAC Android Audio"
 
#define LOGV(X, Y)   __android_log_print(ANDROID_LOG_VERBOSE, TAG, X, Y)
 
#define LOGV3(X, Y, Z, K)   __android_log_print(ANDROID_LOG_VERBOSE, TAG, X, Y, Z, K)
 
#define LOGD(X, Y)   __android_log_print(ANDROID_LOG_DEBUG, TAG, X, Y)
 
#define LOGD2(X, Y, Z)   __android_log_print(ANDROID_LOG_DEBUG, TAG, X, Y, Z)
 
#define LOGE(X, Y)   __android_log_print(ANDROID_LOG_ERROR, TAG, X, Y)
 
#define LOGE3(X, Y, Z, W)   __android_log_print(ANDROID_LOG_ERROR, TAG, X, Y, Z, W)
 
#define LOGW(X, Y)   __android_log_print(ANDROID_LOG_WARN, TAG, X, Y)
 
#define LOGI(X, Y)   __android_log_print(ANDROID_LOG_INFO, TAG, X, Y)
 

Functions

static GF_Err WAV_Setup (GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration)
 
static void WAV_Shutdown (GF_AudioOutput *dr)
 
static GF_Err WAV_ConfigureOutput (GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *nbBitsPerSample, u32 channel_cfg)
 
static void WAV_WriteAudio (GF_AudioOutput *dr)
 
static void WAV_Play (GF_AudioOutput *dr, u32 PlayType)
 
static void WAV_UpdateVolume (DroidContext *ctx)
 
static void WAV_SetVolume (GF_AudioOutput *dr, u32 Volume)
 
static void WAV_SetPan (GF_AudioOutput *dr, u32 Pan)
 
static GF_Err WAV_QueryOutputSampleRate (GF_AudioOutput *dr, u32 *desired_samplerate, u32 *NbChannels, u32 *nbBitsPerSample)
 
static u32 WAV_GetAudioDelay (GF_AudioOutput *dr)
 
static u32 WAV_GetTotalBufferTime (GF_AudioOutput *dr)
 
void * NewWAVRender ()
 
void DeleteWAVRender (void *ifce)
 
const u32QueryInterfaces ()
 
GF_BaseInterfaceLoadInterface (u32 InterfaceType)
 
void ShutdownInterface (GF_BaseInterface *ifce)
 

Variables

static const char android_device [] = "Android Default"
 
static jclass cAudioTrack = 0
 
static jobject mtrack = 0
 
static jmethodID mAudioTrack
 
static jmethodID setStereoVolume
 
static jmethodID mGetMinBufferSize
 
static jmethodID mPlay
 
static jmethodID mStop
 
static jmethodID mRelease
 
static jmethodID mWriteB
 
static jmethodID mWriteS
 
static jmethodID mFlush
 

Data Structure Documentation

struct DroidContext
+ Collaboration diagram for DroidContext:
Data Fields
JNIEnv * env
jobject mtrack
u32 num_buffers
u32 delay
u32 total_length_ms
Bool force_config
u32 cfg_num_buffers
u32 cfg_duration
u32 sampleRateInHz
u32 channelConfig
u32 audioFormat
s32 mbufferSizeInBytes
u32 volume
u32 pan
jarray buff

Macro Definition Documentation

#define STREAM_MUSIC   3
#define CHANNEL_CONFIGURATION_MONO   2
#define CHANNEL_CONFIGURATION_STEREO   3
#define ENCODING_PCM_8BIT   3
#define ENCODING_PCM_16BIT   2
#define MODE_STREAM   1
#define CHANNEL_OUT_MONO   4
#define CHANNEL_IN_STEREO   12
#define CHANNEL_IN_MONO   16
#define TAG   "GPAC Android Audio"
#define LOGV (   X,
 
)    __android_log_print(ANDROID_LOG_VERBOSE, TAG, X, Y)
#define LOGV3 (   X,
  Y,
  Z,
 
)    __android_log_print(ANDROID_LOG_VERBOSE, TAG, X, Y, Z, K)
#define LOGD (   X,
 
)    __android_log_print(ANDROID_LOG_DEBUG, TAG, X, Y)
#define LOGD2 (   X,
  Y,
 
)    __android_log_print(ANDROID_LOG_DEBUG, TAG, X, Y, Z)
#define LOGE (   X,
 
)    __android_log_print(ANDROID_LOG_ERROR, TAG, X, Y)
#define LOGE3 (   X,
  Y,
  Z,
 
)    __android_log_print(ANDROID_LOG_ERROR, TAG, X, Y, Z, W)
#define LOGW (   X,
 
)    __android_log_print(ANDROID_LOG_WARN, TAG, X, Y)
#define LOGI (   X,
 
)    __android_log_print(ANDROID_LOG_INFO, TAG, X, Y)

Function Documentation

static GF_Err WAV_Setup ( GF_AudioOutput dr,
void *  os_handle,
u32  num_buffers,
u32  total_duration 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WAV_Shutdown ( GF_AudioOutput dr)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err WAV_ConfigureOutput ( GF_AudioOutput dr,
u32 SampleRate,
u32 NbChannels,
u32 nbBitsPerSample,
u32  channel_cfg 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WAV_WriteAudio ( GF_AudioOutput dr)
static

+ Here is the caller graph for this function:

static void WAV_Play ( GF_AudioOutput dr,
u32  PlayType 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WAV_UpdateVolume ( DroidContext ctx)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WAV_SetVolume ( GF_AudioOutput dr,
u32  Volume 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void WAV_SetPan ( GF_AudioOutput dr,
u32  Pan 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err WAV_QueryOutputSampleRate ( GF_AudioOutput dr,
u32 desired_samplerate,
u32 NbChannels,
u32 nbBitsPerSample 
)
static

+ Here is the caller graph for this function:

static u32 WAV_GetAudioDelay ( GF_AudioOutput dr)
static

+ Here is the caller graph for this function:

static u32 WAV_GetTotalBufferTime ( GF_AudioOutput dr)
static

+ Here is the caller graph for this function:

void* NewWAVRender ( )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DeleteWAVRender ( void *  ifce)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const u32* QueryInterfaces ( )
GF_BaseInterface* LoadInterface ( u32  InterfaceType)

+ Here is the call graph for this function:

void ShutdownInterface ( GF_BaseInterface ifce)

+ Here is the call graph for this function:

Variable Documentation

const char android_device[] = "Android Default"
static
jclass cAudioTrack = 0
static
jobject mtrack = 0
static
jmethodID mAudioTrack
static
jmethodID setStereoVolume
static
jmethodID mGetMinBufferSize
static
jmethodID mPlay
static
jmethodID mStop
static
jmethodID mRelease
static
jmethodID mWriteB
static
jmethodID mWriteS
static
jmethodID mFlush
static