libgpac
Documentation of the core library of GPAC
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 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
 

Functions

static GF_Err AAOut_Setup (GF_AudioOutput *dr, void *os_handle, u32 num_buffers, u32 total_duration)
 
static void AAOut_Shutdown (GF_AudioOutput *dr)
 
static GF_Err AAOut_ConfigureOutput (GF_AudioOutput *dr, u32 *SampleRate, u32 *NbChannels, u32 *nbBitsPerSample, u64 channel_cfg)
 
static void AAOut_WriteAudio (GF_AudioOutput *dr)
 
static void AAOut_Play (GF_AudioOutput *dr, u32 PlayType)
 
static void AAOut_UpdateVolume (DroidContext *ctx)
 
static void AAOut_SetVolume (GF_AudioOutput *dr, u32 Volume)
 
static void AAOut_SetPan (GF_AudioOutput *dr, u32 Pan)
 
static GF_Err AAOut_QueryOutputSampleRate (GF_AudioOutput *dr, u32 *desired_samplerate, u32 *NbChannels, u32 *nbBitsPerSample)
 
static u32 AAOut_GetAudioDelay (GF_AudioOutput *dr)
 
static u32 AAOut_GetTotalBufferTime (GF_AudioOutput *dr)
 
void * NewAAOutRender ()
 
void DeleteAAOutRender (void *ifce)
 
GPAC_MODULE_EXPORT const u32QueryInterfaces ()
 
GPAC_MODULE_EXPORT GF_BaseInterfaceLoadInterface (u32 InterfaceType)
 
GPAC_MODULE_EXPORT void ShutdownInterface (GF_BaseInterface *ifce)
 

Variables

static const char android_device [] = "Android Default"
 

Data Structure Documentation

◆ DroidContext

struct DroidContext
Data Fields
JNIEnv * env
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
jclass class_AudioTrack
jobject obj_AudioTrack
jmethodID fun_AudioTrack
jmethodID fun_setStereoVolume
jmethodID fun_GetMinBufferSize
jmethodID fun_Play
jmethodID fun_Stop
jmethodID fun_Release
jmethodID fun_WriteB
jmethodID fun_WriteS
jmethodID fun_Flush

Macro Definition Documentation

◆ STREAM_MUSIC

#define STREAM_MUSIC   3

◆ CHANNEL_CONFIGURATION_MONO

#define CHANNEL_CONFIGURATION_MONO   2

◆ CHANNEL_CONFIGURATION_STEREO

#define CHANNEL_CONFIGURATION_STEREO   3

◆ ENCODING_PCM_8BIT

#define ENCODING_PCM_8BIT   3

◆ ENCODING_PCM_16BIT

#define ENCODING_PCM_16BIT   2

◆ MODE_STREAM

#define MODE_STREAM   1

◆ CHANNEL_OUT_MONO

#define CHANNEL_OUT_MONO   4

◆ CHANNEL_IN_STEREO

#define CHANNEL_IN_STEREO   12

◆ CHANNEL_IN_MONO

#define CHANNEL_IN_MONO   16

Function Documentation

◆ AAOut_Setup()

static GF_Err AAOut_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:

◆ AAOut_Shutdown()

static void AAOut_Shutdown ( GF_AudioOutput dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_ConfigureOutput()

static GF_Err AAOut_ConfigureOutput ( GF_AudioOutput dr,
u32 SampleRate,
u32 NbChannels,
u32 nbBitsPerSample,
u64  channel_cfg 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_WriteAudio()

static void AAOut_WriteAudio ( GF_AudioOutput dr)
static
+ Here is the caller graph for this function:

◆ AAOut_Play()

static void AAOut_Play ( GF_AudioOutput dr,
u32  PlayType 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_UpdateVolume()

static void AAOut_UpdateVolume ( DroidContext ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_SetVolume()

static void AAOut_SetVolume ( GF_AudioOutput dr,
u32  Volume 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_SetPan()

static void AAOut_SetPan ( GF_AudioOutput dr,
u32  Pan 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AAOut_QueryOutputSampleRate()

static GF_Err AAOut_QueryOutputSampleRate ( GF_AudioOutput dr,
u32 desired_samplerate,
u32 NbChannels,
u32 nbBitsPerSample 
)
static
+ Here is the caller graph for this function:

◆ AAOut_GetAudioDelay()

static u32 AAOut_GetAudioDelay ( GF_AudioOutput dr)
static
+ Here is the caller graph for this function:

◆ AAOut_GetTotalBufferTime()

static u32 AAOut_GetTotalBufferTime ( GF_AudioOutput dr)
static
+ Here is the caller graph for this function:

◆ NewAAOutRender()

void* NewAAOutRender ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteAAOutRender()

void DeleteAAOutRender ( void *  ifce)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QueryInterfaces()

GPAC_MODULE_EXPORT const u32* QueryInterfaces ( )

◆ LoadInterface()

GPAC_MODULE_EXPORT GF_BaseInterface* LoadInterface ( u32  InterfaceType)
+ Here is the call graph for this function:

◆ ShutdownInterface()

GPAC_MODULE_EXPORT void ShutdownInterface ( GF_BaseInterface ifce)
+ Here is the call graph for this function:

Variable Documentation

◆ android_device

const char android_device[] = "Android Default"
static