RetroArch
Classes | Macros | Functions | Variables
switch_audio.c File Reference
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdint.h>
#include "switch_audio_compat.h"
#include "../audio_driver.h"
#include "../../verbosity.h"
Include dependency graph for switch_audio.c:

Classes

struct  switch_audio_t
 

Macros

#define BUFFER_COUNT   3
 

Functions

static uint32_t switch_audio_data_size (void)
 
static size_t switch_audio_buffer_size (void *data)
 
static ssize_t switch_audio_write (void *data, const void *buf, size_t size)
 
static bool switch_audio_stop (void *data)
 
static bool switch_audio_start (void *data, bool is_shutdown)
 
static bool switch_audio_alive (void *data)
 
static void switch_audio_free (void *data)
 
static bool switch_audio_use_float (void *data)
 
static size_t switch_audio_write_avail (void *data)
 
static void switch_audio_set_nonblock_state (void *data, bool state)
 
static voidswitch_audio_init (const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
 

Variables

static const int sample_rate = 48000
 
static const int max_num_samples = sample_rate
 
static const int num_channels = 2
 
static const size_t sample_buffer_size = ((max_num_samples * num_channels * sizeof(uint16_t)) + 0xfff) & ~0xfff
 
audio_driver_t audio_switch
 

Macro Definition Documentation

◆ BUFFER_COUNT

#define BUFFER_COUNT   3

Function Documentation

◆ switch_audio_alive()

static bool switch_audio_alive ( void data)
static

◆ switch_audio_buffer_size()

static size_t switch_audio_buffer_size ( void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ switch_audio_data_size()

static uint32_t switch_audio_data_size ( void  )
static
Here is the caller graph for this function:

◆ switch_audio_free()

static void switch_audio_free ( void data)
static
Here is the call graph for this function:

◆ switch_audio_init()

static void* switch_audio_init ( const char *  device,
unsigned  rate,
unsigned  latency,
unsigned  block_frames,
unsigned *  new_rate 
)
static
Here is the call graph for this function:

◆ switch_audio_set_nonblock_state()

static void switch_audio_set_nonblock_state ( void data,
bool  state 
)
static

◆ switch_audio_start()

static bool switch_audio_start ( void data,
bool  is_shutdown 
)
static

◆ switch_audio_stop()

static bool switch_audio_stop ( void data)
static

◆ switch_audio_use_float()

static bool switch_audio_use_float ( void data)
static
Here is the call graph for this function:

◆ switch_audio_write()

static ssize_t switch_audio_write ( void data,
const void buf,
size_t  size 
)
static
Here is the call graph for this function:

◆ switch_audio_write_avail()

static size_t switch_audio_write_avail ( void data)
static

Variable Documentation

◆ audio_switch

audio_driver_t audio_switch
Initial value:
= {
"switch",
NULL,
NULL,
}
static bool switch_audio_use_float(void *data)
Definition: switch_audio.c:210
static bool switch_audio_start(void *data, bool is_shutdown)
Definition: switch_audio.c:162
static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
Definition: switch_audio.c:73
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static size_t switch_audio_write_avail(void *data)
Definition: switch_audio.c:216
static bool switch_audio_stop(void *data)
Definition: switch_audio.c:144
static void switch_audio_free(void *data)
Definition: switch_audio.c:187
static void * switch_audio_init(const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
Definition: switch_audio.c:234
static size_t switch_audio_buffer_size(void *data)
Definition: switch_audio.c:63
static void switch_audio_set_nonblock_state(void *data, bool state)
Definition: switch_audio.c:226
static bool switch_audio_alive(void *data)
Definition: switch_audio.c:179

◆ max_num_samples

const int max_num_samples = sample_rate
static

◆ num_channels

const int num_channels = 2
static

◆ sample_buffer_size

const size_t sample_buffer_size = ((max_num_samples * num_channels * sizeof(uint16_t)) + 0xfff) & ~0xfff
static

◆ sample_rate

const int sample_rate = 48000
static