xine-lib: xine-lib-1.2.13/src/audio_out/audio_opensles_out.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions | Variables
audio_opensles_out.c File Reference
`#include <string.h>`
`#include <stdlib.h>`
`#include <dlfcn.h>`
`#include <math.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/audio_out.h>`
`#include <SLES/OpenSLES.h>`

## Data Structures
struct | opensles_driver_s
struct | opensles_class_t

## Macros
#define | LOG_MODULE "audio_opensles_out"
#define | AO_OUT_OPENSLES_IFACE_VERSION 9
#define | OPENSLES_BUFFERS 250 /* max buffers, 10 ms each -> 2.5 seconds */
#define | CHECK_OPENSL_RESULT(errmsg, erraction)

## Typedefs
typedef struct opensles_driver_s | opensles_driver_t

## Functions
static int | _opensles_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
static int | _opensles_num_channels (ao_driver_t *this_gen)
static int | _opensles_bytes_per_frame (ao_driver_t *this_gen)
static int | _opensles_get_gap_tolerance (ao_driver_t *this_gen)
static int | _opensles_write (ao_driver_t *this_gen, int16_t *data, uint32_t num_frames)
static int | _opensles_delay (ao_driver_t *this_gen)
static void | _opensles_close (ao_driver_t *this_gen)
static uint32_t | _opensles_get_capabilities (ao_driver_t *this_gen)
static void | _opensles_exit (ao_driver_t *this_gen)
static int | _opensles_get_property (ao_driver_t *this_gen, int property)
static int | _opensles_set_property (ao_driver_t *this_gen, int property, int value)
static int | _opensles_ctrl (ao_driver_t *this_gen, int cmd,...)
static int | _dlsym_iid (opensles_driver_t *this, const char *name, SLInterfaceID *iid)
static ao_driver_t * | _opensles_open_plugin (audio_driver_class_t *class_gen, const void *data)
static void * | _opensles_init_class (xine_t *xine, const void *data)

## Variables
static const ao_info_t | ao_info_opensles
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ AO_OUT_OPENSLES_IFACE_VERSION

#define AO_OUT_OPENSLES_IFACE_VERSION 9

## ◆ CHECK_OPENSL_RESULT

#define CHECK_OPENSL_RESULT | ( |  | errmsg,
|  |  | erraction )

Value:
do { \
if (result != SL_RESULT_SUCCESS) { \
xprintf (this->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": " \
errmsg ": %" PRIu32 "\n", result); \
erraction ; \
} \
} while (0)
LOG_MODULE
#define LOG_MODULE
Definition audio_opensles_out.c:33
XINE_VERBOSITY_LOG
#define XINE_VERBOSITY_LOG
Definition xine.h:429

Referenced by _opensles_ctrl(), _opensles_delay(), _opensles_get_property(), _opensles_open(), _opensles_open_plugin(), _opensles_set_property(), and _opensles_write().

## ◆ LOG_MODULE

#define LOG_MODULE "audio_opensles_out"

Referenced by _dlsym_iid(), _opensles_open(), and _opensles_open_plugin().

## ◆ OPENSLES_BUFFERS

#define OPENSLES_BUFFERS 250 /* max buffers, 10 ms each -> 2.5 seconds */

Referenced by _opensles_open(), and _opensles_write().

## Typedef Documentation

## ◆ opensles_driver_t

typedef struct opensles_driver_s opensles_driver_t

## Function Documentation

## ◆ _dlsym_iid()

static int _dlsym_iid | ( | opensles_driver_t * | this,
|  | const char * | name,
|  | SLInterfaceID * | iid )
| static

References LOG_MODULE, name, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _opensles_open_plugin().

## ◆ _opensles_bytes_per_frame()

static int _opensles_bytes_per_frame | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by _opensles_open_plugin().

## ◆ _opensles_close()

static void _opensles_close | ( | ao_driver_t * | this_gen | ) |
| static

References _x_freep(), and NULL.

Referenced by _opensles_exit(), and _opensles_open_plugin().

## ◆ _opensles_ctrl()

static int _opensles_ctrl | ( | ao_driver_t * | this_gen,
|  | int | cmd,
|  |  | ... )
| static

References AO_CTRL_FLUSH_BUFFERS, AO_CTRL_PLAY_PAUSE, AO_CTRL_PLAY_RESUME, and CHECK_OPENSL_RESULT.

Referenced by _opensles_open_plugin().

## ◆ _opensles_delay()

static int _opensles_delay | ( | ao_driver_t * | this_gen | ) |
| static

References CHECK_OPENSL_RESULT, and lprintf.

Referenced by _opensles_open_plugin().

## ◆ _opensles_exit()

static void _opensles_exit | ( | ao_driver_t * | this_gen | ) |
| static

References _opensles_close(), and NULL.

Referenced by _opensles_open_plugin().

## ◆ _opensles_get_capabilities()

static uint32_t _opensles_get_capabilities | ( | ao_driver_t * | this_gen | ) |
| static

References AO_CAP_16BITS, AO_CAP_MIXER_VOL, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, and AO_CAP_MUTE_VOL.

Referenced by _opensles_open_plugin().

## ◆ _opensles_get_gap_tolerance()

static int _opensles_get_gap_tolerance | ( | ao_driver_t * | this_gen | ) |
| static

References AO_MAX_GAP.

Referenced by _opensles_open_plugin().

## ◆ _opensles_get_property()

static int _opensles_get_property | ( | ao_driver_t * | this_gen,
|  | int | property )
| static

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, and CHECK_OPENSL_RESULT.

Referenced by _opensles_open_plugin().

## ◆ _opensles_init_class()

static void * _opensles_init_class | ( | xine_t * | xine,
|  | const void * | data )
| static

References _opensles_open_plugin(), default_audio_driver_class_dispose, audio_driver_class_s::description, audio_driver_class_s::dispose, opensles_class_t::driver_class, audio_driver_class_s::identifier, N_, NULL, audio_driver_class_s::open_plugin, and opensles_class_t::xine.

## ◆ _opensles_num_channels()

static int _opensles_num_channels | ( | ao_driver_t * | this_gen | ) |
| static

Referenced by _opensles_open_plugin().

## ◆ _opensles_open()

static int _opensles_open | ( | ao_driver_t * | this_gen,
|  | uint32_t | bits,
|  | uint32_t | rate,
|  | int | mode )
| static

References AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, bits, CHECK_OPENSL_RESULT, ao_driver_s::close, LOG_MODULE, mode(), NULL, OPENSLES_BUFFERS, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _opensles_open_plugin().

## ◆ _opensles_open_plugin()

static ao_driver_t * _opensles_open_plugin | ( | audio_driver_class_t * | class_gen,
|  | const void * | data )
| static

References _dlsym_iid(), _opensles_bytes_per_frame(), _opensles_close(), _opensles_ctrl(), _opensles_delay(), _opensles_exit(), _opensles_get_capabilities(), _opensles_get_gap_tolerance(), _opensles_get_property(), _opensles_num_channels(), _opensles_open(), _opensles_set_property(), _opensles_write(), CHECK_OPENSL_RESULT, LOG_MODULE, lprintf, NULL, opensles_class_t::xine, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _opensles_init_class().

## ◆ _opensles_set_property()

static int _opensles_set_property | ( | ao_driver_t * | this_gen,
|  | int | property,
|  | int | value )
| static

References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, and CHECK_OPENSL_RESULT.

Referenced by _opensles_open_plugin().

## ◆ _opensles_write()

static int _opensles_write | ( | ao_driver_t * | this_gen,
|  | int16_t * | data,
|  | uint32_t | num_frames )
| static

References CHECK_OPENSL_RESULT, OPENSLES_BUFFERS, and xine_usec_sleep().

Referenced by _opensles_open_plugin().

## Variable Documentation

## ◆ ao_info_opensles

const ao_info_t ao_info_opensles
| static

Initial value:
= {
.priority = 5,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_OUT, 9 , "opensles", XINE_VERSION_CODE, &ao_info_opensles, _opensles_init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
ao_info_opensles
static const ao_info_t ao_info_opensles
Definition audio_opensles_out.c:568
_opensles_init_class
static void * _opensles_init_class(xine_t *xine, const void *data)
Definition audio_opensles_out.c:541
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_AUDIO_OUT
#define PLUGIN_AUDIO_OUT
Definition xine_plugin.h:35