mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-11 13:30:05 -05:00
Lot of cleanings with the help of gcc3
This commit is contained in:
parent
ce8275b943
commit
5b50ec848a
59 changed files with 669 additions and 667 deletions
|
|
@ -26,10 +26,10 @@
|
|||
#include <limits.h>
|
||||
#include "pcm_local.h"
|
||||
|
||||
static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
|
||||
static inline void div64_32(u_int64_t *n, u_int32_t d, u_int32_t *rem)
|
||||
{
|
||||
*rem = *n % div;
|
||||
*n /= div;
|
||||
*rem = *n % d;
|
||||
*n /= d;
|
||||
}
|
||||
|
||||
static inline unsigned int div32(unsigned int a, unsigned int b,
|
||||
|
|
@ -379,7 +379,8 @@ void snd_interval_print(const snd_interval_t *i, snd_output_t *out)
|
|||
i->openmax ? ')' : ']');
|
||||
}
|
||||
|
||||
void boundary_abs(int a, int adir, int *b, int *bdir)
|
||||
#if 0
|
||||
static void boundary_abs(int a, int adir, int *b, int *bdir)
|
||||
{
|
||||
if (a < 0 || (a == 0 && adir < 0)) {
|
||||
*b = -a;
|
||||
|
|
@ -389,6 +390,7 @@ void boundary_abs(int a, int adir, int *b, int *bdir)
|
|||
*bdir = adir;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void boundary_sub(int a, int adir, int b, int bdir, int *c, int *cdir)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,11 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef SND_INTERVAL_C
|
||||
#define INTERVAL_INLINE inline
|
||||
#else
|
||||
#define INTERVAL_INLINE extern inline
|
||||
#endif
|
||||
#define INTERVAL_INLINE static inline
|
||||
|
||||
INTERVAL_INLINE void snd_interval_any(snd_interval_t *i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,11 +21,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef SND_MASK_C
|
||||
#define MASK_INLINE inline
|
||||
#else
|
||||
#define MASK_INLINE extern inline
|
||||
#endif
|
||||
#define MASK_INLINE static inline
|
||||
|
||||
#ifndef MASK_MASK
|
||||
#define MASK_MAX 31
|
||||
|
|
|
|||
|
|
@ -647,10 +647,10 @@ const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
|
|||
* \param access PCM access type
|
||||
* \return ascii name of PCM access type
|
||||
*/
|
||||
const char *snd_pcm_access_name(snd_pcm_access_t access)
|
||||
const char *snd_pcm_access_name(snd_pcm_access_t acc)
|
||||
{
|
||||
assert(access <= SND_PCM_ACCESS_LAST);
|
||||
return snd_pcm_access_names[snd_enum_to_int(access)];
|
||||
assert(acc <= SND_PCM_ACCESS_LAST);
|
||||
return snd_pcm_access_names[snd_enum_to_int(acc)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -923,9 +923,9 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
|||
int err;
|
||||
snd_config_t *pcm_conf, *conf, *type_conf = NULL;
|
||||
snd_config_iterator_t i, next;
|
||||
const char *lib = NULL, *open = NULL;
|
||||
int (*open_func)(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
||||
snd_pcm_stream_t stream, int mode);
|
||||
const char *lib = NULL, *open_name = NULL;
|
||||
int (*open_func)(snd_pcm_t **, const char *, snd_config_t *,
|
||||
snd_pcm_stream_t, int);
|
||||
void *h;
|
||||
const char *name1;
|
||||
assert(pcmp && name);
|
||||
|
|
@ -1025,7 +1025,7 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
|||
continue;
|
||||
}
|
||||
if (strcmp(id, "open") == 0) {
|
||||
err = snd_config_get_string(n, &open);
|
||||
err = snd_config_get_string(n, &open_name);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
|
|
@ -1036,8 +1036,8 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
if (!open) {
|
||||
open = buf;
|
||||
if (!open_name) {
|
||||
open_name = buf;
|
||||
snprintf(buf, sizeof(buf), "_snd_pcm_%s_open", str);
|
||||
}
|
||||
if (!lib)
|
||||
|
|
@ -1047,9 +1047,9 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
|
|||
SNDERR("Cannot open shared library %s", lib);
|
||||
return -ENOENT;
|
||||
}
|
||||
open_func = dlsym(h, open);
|
||||
open_func = dlsym(h, open_name);
|
||||
if (!open_func) {
|
||||
SNDERR("symbol %s is not defined inside %s", open, lib);
|
||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||
dlclose(h);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
|
@ -1323,7 +1323,7 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t
|
|||
}
|
||||
case 16: {
|
||||
while (samples-- > 0) {
|
||||
*(u_int16_t*)dst = *(u_int16_t*)src;
|
||||
*(u_int16_t*)dst = *(const u_int16_t*)src;
|
||||
src += src_step;
|
||||
dst += dst_step;
|
||||
}
|
||||
|
|
@ -1331,7 +1331,7 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t
|
|||
}
|
||||
case 32: {
|
||||
while (samples-- > 0) {
|
||||
*(u_int32_t*)dst = *(u_int32_t*)src;
|
||||
*(u_int32_t*)dst = *(const u_int32_t*)src;
|
||||
src += src_step;
|
||||
dst += dst_step;
|
||||
}
|
||||
|
|
@ -1339,7 +1339,7 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes_t
|
|||
}
|
||||
case 64: {
|
||||
while (samples-- > 0) {
|
||||
*(u_int64_t*)dst = *(u_int64_t*)src;
|
||||
*(u_int64_t*)dst = *(const u_int64_t*)src;
|
||||
src += src_step;
|
||||
dst += dst_step;
|
||||
}
|
||||
|
|
@ -1550,7 +1550,7 @@ void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask)
|
|||
*/
|
||||
int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val)
|
||||
{
|
||||
return snd_mask_test((snd_mask_t *) mask, (unsigned long) val);
|
||||
return snd_mask_test((const snd_mask_t *) mask, (unsigned long) val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1641,7 +1641,7 @@ void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask)
|
|||
*/
|
||||
int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val)
|
||||
{
|
||||
return snd_mask_test((snd_mask_t *) mask, (unsigned long) val);
|
||||
return snd_mask_test((const snd_mask_t *) mask, (unsigned long) val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1733,7 +1733,7 @@ void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask)
|
|||
*/
|
||||
int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val)
|
||||
{
|
||||
return snd_mask_test((snd_mask_t *) mask, (unsigned long) val);
|
||||
return snd_mask_test((const snd_mask_t *) mask, (unsigned long) val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1888,7 +1888,7 @@ int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params)
|
|||
*/
|
||||
int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_FORMAT, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TEST, SND_PCM_HW_PARAM_FORMAT, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1900,7 +1900,7 @@ int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, s
|
|||
*/
|
||||
int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val)
|
||||
{
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_FORMAT, snd_enum_to_int(val), 0);
|
||||
return snd_pcm_hw_param_set(pcm, params, SND_TRY, SND_PCM_HW_PARAM_FORMAT, val, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4091,7 +4091,7 @@ snd_pcm_sframes_t snd_pcm_read_areas(snd_pcm_t *pcm, const snd_pcm_channel_area_
|
|||
#endif
|
||||
}
|
||||
_end:
|
||||
return xfer > 0 ? xfer : err;
|
||||
return xfer > 0 ? (snd_pcm_sframes_t) xfer : err;
|
||||
}
|
||||
|
||||
snd_pcm_sframes_t snd_pcm_write_areas(snd_pcm_t *pcm, const snd_pcm_channel_area_t *areas,
|
||||
|
|
@ -4174,7 +4174,7 @@ snd_pcm_sframes_t snd_pcm_write_areas(snd_pcm_t *pcm, const snd_pcm_channel_area
|
|||
}
|
||||
}
|
||||
_end:
|
||||
return xfer > 0 ? xfer : err;
|
||||
return xfer > 0 ? (snd_pcm_sframes_t) xfer : err;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t _snd_pcm_mmap_hw_ptr(snd_pcm_t *pcm)
|
||||
|
|
|
|||
|
|
@ -55,13 +55,14 @@ typedef void (*adpcm_f)(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getputidx,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getputidx,
|
||||
snd_pcm_adpcm_state_t *states);
|
||||
|
||||
typedef struct {
|
||||
/* This field need to be the first */
|
||||
snd_pcm_plugin_t plug;
|
||||
int getput_idx;
|
||||
unsigned int getput_idx;
|
||||
adpcm_f func;
|
||||
snd_pcm_format_t sformat;
|
||||
snd_pcm_adpcm_state_t *states;
|
||||
|
|
@ -194,7 +195,8 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx,
|
||||
snd_pcm_adpcm_state_t *states)
|
||||
{
|
||||
#define PUT16_LABELS
|
||||
|
|
@ -211,7 +213,7 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
const snd_pcm_channel_area_t *src_area = &src_areas[channel];
|
||||
const snd_pcm_channel_area_t *dst_area = &dst_areas[channel];
|
||||
srcbit = src_area->first + src_area->step * src_offset;
|
||||
src = src_area->addr + srcbit / 8;
|
||||
src = (const char *) src_area->addr + srcbit / 8;
|
||||
srcbit %= 8;
|
||||
src_step = src_area->step / 8;
|
||||
srcbit_step = src_area->step % 8;
|
||||
|
|
@ -220,7 +222,7 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
frames1 = frames;
|
||||
while (frames1-- > 0) {
|
||||
int16_t sample;
|
||||
int v;
|
||||
unsigned char v;
|
||||
if (srcbit)
|
||||
v = *src & 0x0f;
|
||||
else
|
||||
|
|
@ -246,7 +248,8 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx,
|
||||
snd_pcm_adpcm_state_t *states)
|
||||
{
|
||||
#define GET16_LABELS
|
||||
|
|
@ -266,7 +269,7 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
src = snd_pcm_channel_area_addr(src_area, src_offset);
|
||||
src_step = snd_pcm_channel_area_step(src_area);
|
||||
dstbit = dst_area->first + dst_area->step * dst_offset;
|
||||
dst = dst_area->addr + dstbit / 8;
|
||||
dst = (char *) dst_area->addr + dstbit / 8;
|
||||
dstbit %= 8;
|
||||
dst_step = dst_area->step / 8;
|
||||
dstbit_step = dst_area->step % 8;
|
||||
|
|
|
|||
|
|
@ -27,12 +27,13 @@ typedef void (*alaw_f)(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getputidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getputidx);
|
||||
|
||||
typedef struct {
|
||||
/* This field need to be the first */
|
||||
snd_pcm_plugin_t plug;
|
||||
int getput_idx;
|
||||
unsigned int getput_idx;
|
||||
alaw_f func;
|
||||
snd_pcm_format_t sformat;
|
||||
} snd_pcm_alaw_t;
|
||||
|
|
@ -124,7 +125,8 @@ void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx)
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx)
|
||||
{
|
||||
#define PUT16_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
@ -132,7 +134,7 @@ void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
void *put = put16_labels[putidx];
|
||||
unsigned int channel;
|
||||
for (channel = 0; channel < channels; ++channel) {
|
||||
const char *src;
|
||||
const unsigned char *src;
|
||||
char *dst;
|
||||
int src_step, dst_step;
|
||||
snd_pcm_uframes_t frames1;
|
||||
|
|
@ -160,7 +162,8 @@ void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx)
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx)
|
||||
{
|
||||
#define GET16_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ typedef enum _snd_pcm_file_format {
|
|||
typedef struct {
|
||||
snd_pcm_t *slave;
|
||||
int close_slave;
|
||||
const char *fname;
|
||||
char *fname;
|
||||
int fd;
|
||||
int format;
|
||||
snd_pcm_uframes_t appl_ptr;
|
||||
|
|
@ -430,7 +430,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, const char *fname, int
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
file->fname = fname;
|
||||
file->fname = strdup(fname);
|
||||
file->fd = fd;
|
||||
file->format = format;
|
||||
file->slave = slave;
|
||||
|
|
@ -515,11 +515,6 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
|
|||
SNDERR("file is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (fname) {
|
||||
fname = strdup(fname);
|
||||
if (!fname)
|
||||
return -ENOMEM;
|
||||
}
|
||||
/* This is needed cause snd_config_update may destroy config */
|
||||
sname = strdup(sname);
|
||||
if (!sname)
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ static snd_pcm_sframes_t snd_pcm_hw_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_
|
|||
return xferi.result;
|
||||
}
|
||||
|
||||
snd_pcm_sframes_t snd_pcm_hw_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
|
||||
static snd_pcm_sframes_t snd_pcm_hw_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
|
||||
{
|
||||
snd_pcm_sframes_t result;
|
||||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
|
|
@ -361,7 +361,8 @@ static int snd_pcm_hw_mmap_status(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
void *ptr;
|
||||
ptr = mmap(NULL, page_align(sizeof(struct sndrv_pcm_mmap_status)), PROT_READ, MAP_FILE|MAP_SHARED,
|
||||
ptr = mmap(NULL, page_align(sizeof(struct sndrv_pcm_mmap_status)),
|
||||
PROT_READ, MAP_FILE|MAP_SHARED,
|
||||
hw->fd, SNDRV_PCM_MMAP_OFFSET_STATUS);
|
||||
if (ptr == MAP_FAILED || ptr == NULL) {
|
||||
SYSERR("status mmap failed");
|
||||
|
|
@ -376,7 +377,8 @@ static int snd_pcm_hw_mmap_control(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
void *ptr;
|
||||
ptr = mmap(NULL, page_align(sizeof(struct sndrv_pcm_mmap_control)), PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED,
|
||||
ptr = mmap(NULL, page_align(sizeof(struct sndrv_pcm_mmap_control)),
|
||||
PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED,
|
||||
hw->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL);
|
||||
if (ptr == MAP_FAILED || ptr == NULL) {
|
||||
SYSERR("control mmap failed");
|
||||
|
|
@ -411,7 +413,7 @@ static int snd_pcm_hw_mmap(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
if (!(pcm->info & SND_PCM_INFO_MMAP)) {
|
||||
snd_pcm_uframes_t size = snd_pcm_frames_to_bytes(pcm, pcm->buffer_size);
|
||||
snd_pcm_uframes_t size = snd_pcm_frames_to_bytes(pcm, (snd_pcm_sframes_t) pcm->buffer_size);
|
||||
int id = shmget(IPC_PRIVATE, size, 0666);
|
||||
if (id < 0) {
|
||||
SYSERR("shmget failed");
|
||||
|
|
@ -481,7 +483,7 @@ static snd_pcm_sframes_t snd_pcm_hw_avail_update(snd_pcm_t *pcm)
|
|||
static void snd_pcm_hw_dump(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
snd_pcm_hw_t *hw = pcm->private_data;
|
||||
char *name = "Unknown";
|
||||
char *name;
|
||||
int err = snd_card_get_name(hw->card, &name);
|
||||
assert(err >= 0);
|
||||
snd_output_printf(out, "Hardware PCM card %d '%s' device %d subdevice %d\n",
|
||||
|
|
@ -527,10 +529,10 @@ snd_pcm_fast_ops_t snd_pcm_hw_fast_ops = {
|
|||
mmap_forward: snd_pcm_hw_mmap_forward,
|
||||
};
|
||||
|
||||
int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode)
|
||||
static int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode)
|
||||
{
|
||||
char filename[32];
|
||||
char *filefmt;
|
||||
const char *filefmt;
|
||||
int ver;
|
||||
int ret = 0, fd = -1;
|
||||
int attempt = 0;
|
||||
|
|
@ -645,11 +647,6 @@ int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdev
|
|||
return ret;
|
||||
}
|
||||
|
||||
int snd_pcm_hw_open_device(snd_pcm_t **pcmp, int card, int device, snd_pcm_stream_t stream, int mode)
|
||||
{
|
||||
return snd_pcm_hw_open_subdevice(pcmp, card, device, -1, stream, mode);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode)
|
||||
{
|
||||
int err = snd_pcm_hw_open_subdevice(pcmp, card, device, subdevice, stream, mode);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
typedef struct {
|
||||
/* This field need to be the first */
|
||||
snd_pcm_plugin_t plug;
|
||||
int conv_idx;
|
||||
unsigned int conv_idx;
|
||||
snd_pcm_format_t sformat;
|
||||
} snd_pcm_linear_t;
|
||||
|
||||
|
|
@ -90,7 +90,8 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f
|
|||
|
||||
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int convidx)
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int convidx)
|
||||
{
|
||||
#define CONV_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ int snd_pcm_plug_open(snd_pcm_t **pcmp,
|
|||
unsigned int tt_cused, unsigned int tt_sused,
|
||||
snd_pcm_t *slave, int close_slave);
|
||||
int snd_pcm_plug_open_hw(snd_pcm_t **pcm, const char *name, int card, int device, int subdevice, snd_pcm_stream_t stream, int mode);
|
||||
int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *socket, const char *sname, snd_pcm_stream_t stream, int mode);
|
||||
int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *sockname, const char *sname, snd_pcm_stream_t stream, int mode);
|
||||
int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, const char *fname, int fd, const char *fmt, snd_pcm_t *slave, int close_slave);
|
||||
int snd_pcm_null_open(snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode);
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area
|
|||
{
|
||||
unsigned int bitofs = area->first + area->step * offset;
|
||||
assert(bitofs % 8 == 0);
|
||||
return area->addr + bitofs / 8;
|
||||
return (char *) area->addr + bitofs / 8;
|
||||
}
|
||||
|
||||
static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area)
|
||||
|
|
@ -498,46 +498,46 @@ int snd_pcm_hw_strategy_simple_choices(snd_pcm_hw_strategy_t *strategy, int orde
|
|||
int snd_pcm_slave_conf(snd_config_t *conf, const char **namep,
|
||||
unsigned int count, ...);
|
||||
|
||||
#define SND_PCM_HW_PARBIT_ACCESS (1 << SND_PCM_HW_PARAM_ACCESS)
|
||||
#define SND_PCM_HW_PARBIT_FORMAT (1 << SND_PCM_HW_PARAM_FORMAT)
|
||||
#define SND_PCM_HW_PARBIT_SUBFORMAT (1 << SND_PCM_HW_PARAM_SUBFORMAT)
|
||||
#define SND_PCM_HW_PARBIT_CHANNELS (1 << SND_PCM_HW_PARAM_CHANNELS)
|
||||
#define SND_PCM_HW_PARBIT_RATE (1 << SND_PCM_HW_PARAM_RATE)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_TIME (1 << SND_PCM_HW_PARAM_PERIOD_TIME)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_SIZE (1 << SND_PCM_HW_PARAM_PERIOD_SIZE)
|
||||
#define SND_PCM_HW_PARBIT_PERIODS (1 << SND_PCM_HW_PARAM_PERIODS)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_TIME (1 << SND_PCM_HW_PARAM_BUFFER_TIME)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_SIZE (1 << SND_PCM_HW_PARAM_BUFFER_SIZE)
|
||||
#define SND_PCM_HW_PARBIT_SAMPLE_BITS (1 << SND_PCM_HW_PARAM_SAMPLE_BITS)
|
||||
#define SND_PCM_HW_PARBIT_FRAME_BITS (1 << SND_PCM_HW_PARAM_FRAME_BITS)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_BYTES (1 << SND_PCM_HW_PARAM_PERIOD_BYTES)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_BYTES (1 << SND_PCM_HW_PARAM_BUFFER_BYTES)
|
||||
#define SND_PCM_HW_PARBIT_TICK_TIME (1 << SND_PCM_HW_PARAM_TICK_TIME)
|
||||
#define SND_PCM_HW_PARBIT_ACCESS (1U << SND_PCM_HW_PARAM_ACCESS)
|
||||
#define SND_PCM_HW_PARBIT_FORMAT (1U << SND_PCM_HW_PARAM_FORMAT)
|
||||
#define SND_PCM_HW_PARBIT_SUBFORMAT (1U << SND_PCM_HW_PARAM_SUBFORMAT)
|
||||
#define SND_PCM_HW_PARBIT_CHANNELS (1U << SND_PCM_HW_PARAM_CHANNELS)
|
||||
#define SND_PCM_HW_PARBIT_RATE (1U << SND_PCM_HW_PARAM_RATE)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_TIME (1U << SND_PCM_HW_PARAM_PERIOD_TIME)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_SIZE (1U << SND_PCM_HW_PARAM_PERIOD_SIZE)
|
||||
#define SND_PCM_HW_PARBIT_PERIODS (1U << SND_PCM_HW_PARAM_PERIODS)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_TIME (1U << SND_PCM_HW_PARAM_BUFFER_TIME)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_SIZE (1U << SND_PCM_HW_PARAM_BUFFER_SIZE)
|
||||
#define SND_PCM_HW_PARBIT_SAMPLE_BITS (1U << SND_PCM_HW_PARAM_SAMPLE_BITS)
|
||||
#define SND_PCM_HW_PARBIT_FRAME_BITS (1U << SND_PCM_HW_PARAM_FRAME_BITS)
|
||||
#define SND_PCM_HW_PARBIT_PERIOD_BYTES (1U << SND_PCM_HW_PARAM_PERIOD_BYTES)
|
||||
#define SND_PCM_HW_PARBIT_BUFFER_BYTES (1U << SND_PCM_HW_PARAM_BUFFER_BYTES)
|
||||
#define SND_PCM_HW_PARBIT_TICK_TIME (1U << SND_PCM_HW_PARAM_TICK_TIME)
|
||||
|
||||
|
||||
#define SND_PCM_ACCBIT_MMAP ((1 << (unsigned long) SND_PCM_ACCESS_MMAP_INTERLEAVED) | \
|
||||
(1 << (unsigned long) SND_PCM_ACCESS_MMAP_NONINTERLEAVED) | \
|
||||
(1 << (unsigned long) SND_PCM_ACCESS_MMAP_COMPLEX))
|
||||
#define SND_PCM_ACCBIT_MMAP ((1U << SND_PCM_ACCESS_MMAP_INTERLEAVED) | \
|
||||
(1U << SND_PCM_ACCESS_MMAP_NONINTERLEAVED) | \
|
||||
(1U << SND_PCM_ACCESS_MMAP_COMPLEX))
|
||||
|
||||
#define SND_PCM_ACCBIT_SHM ((1 << (unsigned long) SND_PCM_ACCESS_MMAP_INTERLEAVED) | \
|
||||
(1 << (unsigned long) SND_PCM_ACCESS_RW_INTERLEAVED) | \
|
||||
(1 << (unsigned long) SND_PCM_ACCESS_MMAP_NONINTERLEAVED) | \
|
||||
(1 << (unsigned long) SND_PCM_ACCESS_RW_NONINTERLEAVED))
|
||||
#define SND_PCM_ACCBIT_SHM ((1U << SND_PCM_ACCESS_MMAP_INTERLEAVED) | \
|
||||
(1U << SND_PCM_ACCESS_RW_INTERLEAVED) | \
|
||||
(1U << SND_PCM_ACCESS_MMAP_NONINTERLEAVED) | \
|
||||
(1U << SND_PCM_ACCESS_RW_NONINTERLEAVED))
|
||||
|
||||
#define SND_PCM_FMTBIT_LINEAR \
|
||||
((1 << (unsigned long) SND_PCM_FORMAT_S8) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U8) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S16_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S16_BE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U16_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U16_BE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S24_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S24_BE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U24_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U24_BE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S32_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_S32_BE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U32_LE) | \
|
||||
(1 << (unsigned long) SND_PCM_FORMAT_U32_BE))
|
||||
((1U << SND_PCM_FORMAT_S8) | \
|
||||
(1U << SND_PCM_FORMAT_U8) | \
|
||||
(1U << SND_PCM_FORMAT_S16_LE) | \
|
||||
(1U << SND_PCM_FORMAT_S16_BE) | \
|
||||
(1U << SND_PCM_FORMAT_U16_LE) | \
|
||||
(1U << SND_PCM_FORMAT_U16_BE) | \
|
||||
(1U << SND_PCM_FORMAT_S24_LE) | \
|
||||
(1U << SND_PCM_FORMAT_S24_BE) | \
|
||||
(1U << SND_PCM_FORMAT_U24_LE) | \
|
||||
(1U << SND_PCM_FORMAT_U24_BE) | \
|
||||
(1U << SND_PCM_FORMAT_S32_LE) | \
|
||||
(1U << SND_PCM_FORMAT_S32_BE) | \
|
||||
(1U << SND_PCM_FORMAT_U32_LE) | \
|
||||
(1U << SND_PCM_FORMAT_U32_BE))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
struct _snd_pcm_scope {
|
||||
int enabled;
|
||||
const char *name;
|
||||
char *name;
|
||||
snd_pcm_scope_ops_t *ops;
|
||||
void *private_data;
|
||||
struct list_head list;
|
||||
|
|
@ -65,10 +65,10 @@ typedef struct _snd_pcm_meter {
|
|||
struct timespec delay;
|
||||
} snd_pcm_meter_t;
|
||||
|
||||
void snd_pcm_meter_add_frames(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t ptr,
|
||||
snd_pcm_uframes_t frames)
|
||||
static void snd_pcm_meter_add_frames(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t ptr,
|
||||
snd_pcm_uframes_t frames)
|
||||
{
|
||||
snd_pcm_meter_t *meter = pcm->private_data;
|
||||
while (frames > 0) {
|
||||
|
|
@ -108,7 +108,8 @@ static void snd_pcm_meter_update_main(snd_pcm_t *pcm)
|
|||
frames += pcm->boundary;
|
||||
if (frames > 0) {
|
||||
assert((snd_pcm_uframes_t) frames <= pcm->buffer_size);
|
||||
snd_pcm_meter_add_frames(pcm, areas, old_rptr, frames);
|
||||
snd_pcm_meter_add_frames(pcm, areas, old_rptr,
|
||||
(snd_pcm_uframes_t) frames);
|
||||
}
|
||||
if (locked)
|
||||
pthread_mutex_unlock(&meter->update_mutex);
|
||||
|
|
@ -139,13 +140,14 @@ static int snd_pcm_meter_update_scope(snd_pcm_t *pcm)
|
|||
frames += pcm->boundary;
|
||||
if (frames > 0) {
|
||||
assert((snd_pcm_uframes_t) frames <= pcm->buffer_size);
|
||||
snd_pcm_meter_add_frames(pcm, areas, old_rptr, frames);
|
||||
snd_pcm_meter_add_frames(pcm, areas, old_rptr,
|
||||
(snd_pcm_uframes_t) frames);
|
||||
}
|
||||
pthread_mutex_unlock(&meter->update_mutex);
|
||||
return reset;
|
||||
}
|
||||
|
||||
int snd_pcm_scope_remove(snd_pcm_scope_t *scope)
|
||||
static int snd_pcm_scope_remove(snd_pcm_scope_t *scope)
|
||||
{
|
||||
if (scope->name)
|
||||
free((void *)scope->name);
|
||||
|
|
@ -155,7 +157,7 @@ int snd_pcm_scope_remove(snd_pcm_scope_t *scope)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_scope_enable(snd_pcm_scope_t *scope)
|
||||
static int snd_pcm_scope_enable(snd_pcm_scope_t *scope)
|
||||
{
|
||||
int err;
|
||||
assert(!scope->enabled);
|
||||
|
|
@ -164,7 +166,7 @@ int snd_pcm_scope_enable(snd_pcm_scope_t *scope)
|
|||
return err;
|
||||
}
|
||||
|
||||
int snd_pcm_scope_disable(snd_pcm_scope_t *scope)
|
||||
static int snd_pcm_scope_disable(snd_pcm_scope_t *scope)
|
||||
{
|
||||
assert(scope->enabled);
|
||||
scope->ops->disable(scope);
|
||||
|
|
@ -391,7 +393,8 @@ static snd_pcm_sframes_t snd_pcm_meter_mmap_forward(snd_pcm_t *pcm, snd_pcm_ufra
|
|||
if (result <= 0)
|
||||
return result;
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||
snd_pcm_meter_add_frames(pcm, snd_pcm_mmap_areas(pcm), old_rptr, result);
|
||||
snd_pcm_meter_add_frames(pcm, snd_pcm_mmap_areas(pcm), old_rptr,
|
||||
(snd_pcm_uframes_t) result);
|
||||
meter->rptr = *pcm->appl_ptr;
|
||||
}
|
||||
return result;
|
||||
|
|
@ -451,13 +454,13 @@ static int snd_pcm_meter_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_meter_hw_refine_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
static int snd_pcm_meter_hw_refine_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
snd_pcm_meter_t *meter = pcm->private_data;
|
||||
return snd_pcm_hw_refine(meter->slave, params);
|
||||
}
|
||||
|
||||
int snd_pcm_meter_hw_params_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
static int snd_pcm_meter_hw_params_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
snd_pcm_meter_t *meter = pcm->private_data;
|
||||
return _snd_pcm_hw_params(meter->slave, params);
|
||||
|
|
@ -637,15 +640,15 @@ int snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name, unsigned int frequenc
|
|||
}
|
||||
|
||||
|
||||
int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
||||
snd_config_t *conf)
|
||||
static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
||||
snd_config_t *conf)
|
||||
{
|
||||
char buf[256];
|
||||
snd_config_iterator_t i, next;
|
||||
const char *lib = NULL, *open = NULL, *str = NULL;
|
||||
const char *lib = NULL, *open_name = NULL, *str = NULL;
|
||||
snd_config_t *c, *type_conf;
|
||||
int (*open_func)(snd_pcm_t *pcm, const char *name,
|
||||
snd_config_t *conf);
|
||||
int (*open_func)(snd_pcm_t *, const char *,
|
||||
snd_config_t *);
|
||||
void *h;
|
||||
int err;
|
||||
err = snd_config_search(conf, "type", &c);
|
||||
|
|
@ -674,7 +677,7 @@ int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
|||
continue;
|
||||
}
|
||||
if (strcmp(id, "open") == 0) {
|
||||
err = snd_config_get_string(n, &open);
|
||||
err = snd_config_get_string(n, &open_name);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
|
|
@ -685,8 +688,8 @@ int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
if (!open) {
|
||||
open = buf;
|
||||
if (!open_name) {
|
||||
open_name = buf;
|
||||
snprintf(buf, sizeof(buf), "_snd_pcm_scope_%s_open", str);
|
||||
}
|
||||
if (!lib)
|
||||
|
|
@ -696,9 +699,9 @@ int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name,
|
|||
SNDERR("Cannot open shared library %s", lib);
|
||||
return -ENOENT;
|
||||
}
|
||||
open_func = dlsym(h, open);
|
||||
open_func = dlsym(h, open_name);
|
||||
if (!open_func) {
|
||||
SNDERR("symbol %s is not defined inside %s", open, lib);
|
||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||
dlclose(h);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
|
@ -762,7 +765,7 @@ int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name,
|
|||
free((void *) sname);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = snd_pcm_meter_open(pcmp, name, frequency < 0 ? FREQUENCY : frequency, spcm, 1);
|
||||
err = snd_pcm_meter_open(pcmp, name, frequency > 0 ? (unsigned int) frequency : FREQUENCY, spcm, 1);
|
||||
if (err < 0)
|
||||
snd_pcm_close(spcm);
|
||||
if (!scopes)
|
||||
|
|
@ -894,7 +897,7 @@ snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm)
|
|||
*/
|
||||
void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val)
|
||||
{
|
||||
scope->name = val;
|
||||
scope->name = strdup(val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -954,7 +957,7 @@ static int s16_enable(snd_pcm_scope_t *scope)
|
|||
snd_pcm_t *spcm = meter->slave;
|
||||
snd_pcm_channel_area_t *a;
|
||||
unsigned int c;
|
||||
int index;
|
||||
int idx;
|
||||
if (spcm->format == SND_PCM_FORMAT_S16 &&
|
||||
spcm->access == SND_PCM_ACCESS_MMAP_NONINTERLEAVED) {
|
||||
s16->buf = (int16_t *) meter->buf;
|
||||
|
|
@ -964,7 +967,7 @@ static int s16_enable(snd_pcm_scope_t *scope)
|
|||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SND_PCM_FORMAT_IMA_ADPCM:
|
||||
index = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, SND_PCM_FORMAT_S16);
|
||||
idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, SND_PCM_FORMAT_S16);
|
||||
break;
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
|
|
@ -980,12 +983,12 @@ static int s16_enable(snd_pcm_scope_t *scope)
|
|||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
index = snd_pcm_linear_convert_index(spcm->format, SND_PCM_FORMAT_S16);
|
||||
idx = snd_pcm_linear_convert_index(spcm->format, SND_PCM_FORMAT_S16);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
s16->index = index;
|
||||
s16->index = idx;
|
||||
if (spcm->format == SND_PCM_FORMAT_IMA_ADPCM) {
|
||||
s16->adpcm_states = calloc(spcm->channels, sizeof(*s16->adpcm_states));
|
||||
if (!s16->adpcm_states)
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
|
|||
return 0;
|
||||
default:
|
||||
assert(0);
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ void snd_pcm_mmap_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
|||
*pcm->hw_ptr = hw_ptr;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_mmap_write_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
static snd_pcm_uframes_t snd_pcm_mmap_write_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
{
|
||||
const snd_pcm_channel_area_t *pcm_areas;
|
||||
snd_pcm_uframes_t pcm_offset;
|
||||
|
|
@ -143,10 +143,10 @@ snd_pcm_uframes_t snd_pcm_mmap_write_areas(snd_pcm_t *pcm,
|
|||
return xfer;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_mmap_read_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
static snd_pcm_uframes_t snd_pcm_mmap_read_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
{
|
||||
const snd_pcm_channel_area_t *pcm_areas;
|
||||
snd_pcm_uframes_t pcm_offset;
|
||||
|
|
|
|||
|
|
@ -27,12 +27,13 @@ typedef void (*mulaw_f)(const snd_pcm_channel_area_t *src_areas,
|
|||
snd_pcm_uframes_t src_offset,
|
||||
const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getputidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getputidx);
|
||||
|
||||
typedef struct {
|
||||
/* This field need to be the first */
|
||||
snd_pcm_plugin_t plug;
|
||||
int getput_idx;
|
||||
unsigned int getput_idx;
|
||||
mulaw_f func;
|
||||
snd_pcm_format_t sformat;
|
||||
} snd_pcm_mulaw_t;
|
||||
|
|
@ -141,7 +142,8 @@ void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx)
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx)
|
||||
{
|
||||
#define PUT16_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
@ -149,7 +151,7 @@ void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
void *put = put16_labels[putidx];
|
||||
unsigned int channel;
|
||||
for (channel = 0; channel < channels; ++channel) {
|
||||
const char *src;
|
||||
const unsigned char *src;
|
||||
char *dst;
|
||||
int src_step, dst_step;
|
||||
snd_pcm_uframes_t frames1;
|
||||
|
|
@ -177,7 +179,8 @@ void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx)
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx)
|
||||
{
|
||||
#define GET16_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ static int snd_pcm_multi_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
|
|||
memset(info, 0, sizeof(*info));
|
||||
info->stream = snd_enum_to_int(pcm->stream);
|
||||
info->card = -1;
|
||||
strcpy(info->id, "multi");
|
||||
strcpy(info->name, "multi");
|
||||
strcpy(info->subname, "multi");
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||
info->subdevices_count = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -107,11 +107,11 @@ static int snd_pcm_multi_hw_refine_cprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t
|
|||
multi->channels_count, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
params->info = ~0;
|
||||
params->info = ~0U;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_pcm_multi_hw_refine_sprepare(snd_pcm_t *pcm, int slave_idx,
|
||||
static int snd_pcm_multi_hw_refine_sprepare(snd_pcm_t *pcm, unsigned int slave_idx,
|
||||
snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
|
|
@ -126,7 +126,7 @@ static int snd_pcm_multi_hw_refine_sprepare(snd_pcm_t *pcm, int slave_idx,
|
|||
}
|
||||
|
||||
static int snd_pcm_multi_hw_refine_schange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
|
||||
int slave_idx ATTRIBUTE_UNUSED,
|
||||
unsigned int slave_idx ATTRIBUTE_UNUSED,
|
||||
snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
|
|
@ -159,7 +159,7 @@ static int snd_pcm_multi_hw_refine_schange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
static int snd_pcm_multi_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
|
||||
int slave_idx ATTRIBUTE_UNUSED,
|
||||
unsigned int slave_idx ATTRIBUTE_UNUSED,
|
||||
snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
|
|
@ -194,7 +194,7 @@ static int snd_pcm_multi_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
static int snd_pcm_multi_hw_refine_slave(snd_pcm_t *pcm,
|
||||
int slave_idx,
|
||||
unsigned int slave_idx,
|
||||
snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
|
|
@ -244,7 +244,7 @@ static int snd_pcm_multi_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
}
|
||||
|
||||
static int snd_pcm_multi_hw_params_slave(snd_pcm_t *pcm,
|
||||
int slave_idx,
|
||||
unsigned int slave_idx,
|
||||
snd_pcm_hw_params_t *sparams)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
|
|
@ -443,13 +443,6 @@ static int snd_pcm_multi_munmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_multi_poll_descriptor(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
snd_pcm_t *slave = multi->slaves[0].pcm;
|
||||
return _snd_pcm_poll_descriptor(slave);
|
||||
}
|
||||
|
||||
static void snd_pcm_multi_dump(snd_pcm_t *pcm, snd_output_t *out)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm->private_data;
|
||||
|
|
@ -592,7 +585,7 @@ int _snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
char **slaves_name = NULL;
|
||||
snd_pcm_t **slaves_pcm = NULL;
|
||||
unsigned int *slaves_channels = NULL;
|
||||
unsigned int *channels_sidx = NULL;
|
||||
int *channels_sidx = NULL;
|
||||
unsigned int *channels_schannel = NULL;
|
||||
unsigned int slaves_count = 0;
|
||||
unsigned int channels_count = 0;
|
||||
|
|
@ -663,14 +656,14 @@ int _snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
idx = 0;
|
||||
snd_config_for_each(i, inext, slaves) {
|
||||
snd_config_t *m = snd_config_iterator_entry(i);
|
||||
const char *name;
|
||||
const char *n;
|
||||
int channels;
|
||||
slaves_id[idx] = snd_config_get_id(m);
|
||||
err = snd_pcm_slave_conf(m, &name, 1,
|
||||
err = snd_pcm_slave_conf(m, &n, 1,
|
||||
SND_PCM_HW_PARAM_CHANNELS, 1, &channels);
|
||||
if (err < 0)
|
||||
goto _free;
|
||||
slaves_name[idx] = strdup(name);
|
||||
slaves_name[idx] = strdup(n);
|
||||
slaves_channels[idx] = channels;
|
||||
++idx;
|
||||
}
|
||||
|
|
@ -691,7 +684,7 @@ int _snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
}
|
||||
snd_config_for_each(j, jnext, m) {
|
||||
snd_config_t *n = snd_config_iterator_entry(j);
|
||||
const char *id = snd_config_get_id(n);
|
||||
id = snd_config_get_id(n);
|
||||
if (strcmp(id, "comment") == 0)
|
||||
continue;
|
||||
if (strcmp(id, "slave") == 0) {
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ static int snd_pcm_null_info(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_info_t * i
|
|||
memset(info, 0, sizeof(*info));
|
||||
info->stream = snd_enum_to_int(pcm->stream);
|
||||
info->card = -1;
|
||||
strcpy(info->id, "null");
|
||||
strcpy(info->name, "null");
|
||||
strcpy(info->subname, "null");
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||
info->subdevices_count = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,45 +21,45 @@
|
|||
|
||||
#include "pcm_local.h"
|
||||
|
||||
static inline int hw_is_mask(int var)
|
||||
static inline int hw_is_mask(snd_pcm_hw_param_t var)
|
||||
{
|
||||
return var >= SND_PCM_HW_PARAM_FIRST_MASK &&
|
||||
var <= SND_PCM_HW_PARAM_LAST_MASK;
|
||||
}
|
||||
|
||||
static inline int hw_is_interval(int var)
|
||||
static inline int hw_is_interval(snd_pcm_hw_param_t var)
|
||||
{
|
||||
return var >= SND_PCM_HW_PARAM_FIRST_INTERVAL &&
|
||||
var <= SND_PCM_HW_PARAM_LAST_INTERVAL;
|
||||
}
|
||||
|
||||
static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
assert(hw_is_mask(var));
|
||||
return (snd_mask_t*)¶ms->masks[var - SND_PCM_HW_PARAM_FIRST_MASK];
|
||||
}
|
||||
|
||||
static inline snd_interval_t *hw_param_interval(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
assert(hw_is_interval(var));
|
||||
return ¶ms->intervals[var - SND_PCM_HW_PARAM_FIRST_INTERVAL];
|
||||
}
|
||||
|
||||
static inline const snd_mask_t *hw_param_mask_c(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
return (const snd_mask_t *)hw_param_mask((snd_pcm_hw_params_t*) params, var);
|
||||
}
|
||||
|
||||
static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
return (const snd_interval_t *)hw_param_interval((snd_pcm_hw_params_t*) params, var);
|
||||
}
|
||||
|
||||
void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var)
|
||||
static void _snd_pcm_hw_param_any(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var)
|
||||
{
|
||||
if (hw_is_mask(var)) {
|
||||
snd_mask_any(hw_param_mask(params, var));
|
||||
|
|
@ -134,12 +134,12 @@ unsigned int snd_pcm_hw_param_get_min(const snd_pcm_hw_params_t *params,
|
|||
return snd_interval_min(i);
|
||||
}
|
||||
assert(0);
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return the maximum value for field PAR. */
|
||||
unsigned int snd_pcm_hw_param_get_max(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var, int *dir)
|
||||
snd_pcm_hw_param_t var, int *dir)
|
||||
{
|
||||
if (hw_is_mask(var)) {
|
||||
if (dir)
|
||||
|
|
@ -153,7 +153,7 @@ unsigned int snd_pcm_hw_param_get_max(const snd_pcm_hw_params_t *params,
|
|||
return snd_interval_max(i);
|
||||
}
|
||||
assert(0);
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return the mask for field PAR.
|
||||
|
|
@ -208,8 +208,8 @@ void _snd_pcm_hw_param_set_empty(snd_pcm_hw_params_t *params,
|
|||
}
|
||||
}
|
||||
|
||||
int _snd_pcm_hw_param_set_integer(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
static int _snd_pcm_hw_param_set_integer(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
int changed;
|
||||
assert(hw_is_interval(var));
|
||||
|
|
@ -261,8 +261,8 @@ int snd_pcm_hw_param_set_integer(snd_pcm_t *pcm,
|
|||
return err;
|
||||
}
|
||||
|
||||
int _snd_pcm_hw_param_set_first(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
static int _snd_pcm_hw_param_set_first(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
int changed;
|
||||
if (hw_is_mask(var))
|
||||
|
|
@ -297,8 +297,8 @@ unsigned int snd_pcm_hw_param_set_first(snd_pcm_t *pcm,
|
|||
return snd_pcm_hw_param_get(params, var, dir);
|
||||
}
|
||||
|
||||
int _snd_pcm_hw_param_set_last(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
static int _snd_pcm_hw_param_set_last(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
int changed;
|
||||
if (hw_is_mask(var))
|
||||
|
|
@ -337,21 +337,21 @@ int _snd_pcm_hw_param_set_min(snd_pcm_hw_params_t *params,
|
|||
snd_pcm_hw_param_t var, unsigned int val, int dir)
|
||||
{
|
||||
int changed;
|
||||
int open = 0;
|
||||
int openmin = 0;
|
||||
if (dir) {
|
||||
if (dir > 0) {
|
||||
open = 1;
|
||||
openmin = 1;
|
||||
} else if (dir < 0) {
|
||||
if (val > 0) {
|
||||
open = 1;
|
||||
openmin = 1;
|
||||
val--;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hw_is_mask(var))
|
||||
changed = snd_mask_refine_min(hw_param_mask(params, var), val + !!open);
|
||||
changed = snd_mask_refine_min(hw_param_mask(params, var), val + !!openmin);
|
||||
else if (hw_is_interval(var))
|
||||
changed = snd_interval_refine_min(hw_param_interval(params, var), val, open);
|
||||
changed = snd_interval_refine_min(hw_param_interval(params, var), val, openmin);
|
||||
else {
|
||||
assert(0);
|
||||
return -EINVAL;
|
||||
|
|
@ -407,23 +407,23 @@ int _snd_pcm_hw_param_set_max(snd_pcm_hw_params_t *params,
|
|||
snd_pcm_hw_param_t var, unsigned int val, int dir)
|
||||
{
|
||||
int changed;
|
||||
int open = 0;
|
||||
int openmax = 0;
|
||||
if (dir) {
|
||||
if (dir < 0) {
|
||||
open = 1;
|
||||
openmax = 1;
|
||||
} else if (dir > 0) {
|
||||
open = 1;
|
||||
openmax = 1;
|
||||
val++;
|
||||
}
|
||||
}
|
||||
if (hw_is_mask(var)) {
|
||||
if (val == 0 && open) {
|
||||
if (val == 0 && openmax) {
|
||||
snd_mask_none(hw_param_mask(params, var));
|
||||
changed = -EINVAL;
|
||||
} else
|
||||
changed = snd_mask_refine_max(hw_param_mask(params, var), val - !!open);
|
||||
changed = snd_mask_refine_max(hw_param_mask(params, var), val - !!openmax);
|
||||
} else if (hw_is_interval(var))
|
||||
changed = snd_interval_refine_max(hw_param_interval(params, var), val, open);
|
||||
changed = snd_interval_refine_max(hw_param_interval(params, var), val, openmax);
|
||||
else {
|
||||
assert(0);
|
||||
return -EINVAL;
|
||||
|
|
@ -790,6 +790,7 @@ unsigned int snd_pcm_hw_param_set_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *para
|
|||
return v;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Inside configuration space defined by PARAMS set PAR to the available value
|
||||
nearest to BEST after VAL (on equal difference values less than BEST are
|
||||
returned first).
|
||||
|
|
@ -860,12 +861,13 @@ int snd_pcm_hw_param_set_next(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
assert(v >= 0);
|
||||
return v;
|
||||
}
|
||||
#endif
|
||||
|
||||
void snd_pcm_hw_param_set_near_minmax(snd_pcm_t *pcm,
|
||||
snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int min, int *mindir,
|
||||
unsigned int max, int *maxdir)
|
||||
static void snd_pcm_hw_param_set_near_minmax(snd_pcm_t *pcm,
|
||||
snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int min, int *mindir,
|
||||
unsigned int max, int *maxdir)
|
||||
{
|
||||
snd_pcm_hw_params_t tmp;
|
||||
int err;
|
||||
|
|
@ -902,8 +904,9 @@ void snd_pcm_hw_param_refine_near(snd_pcm_t *pcm,
|
|||
|
||||
/* ---- end of refinement functions ---- */
|
||||
|
||||
int snd_pcm_hw_param_empty(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
#if 0
|
||||
static int snd_pcm_hw_param_empty(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
if (hw_is_mask(var))
|
||||
return snd_mask_empty(hw_param_mask_c(params, var));
|
||||
|
|
@ -912,6 +915,7 @@ int snd_pcm_hw_param_empty(const snd_pcm_hw_params_t *params,
|
|||
assert(0);
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
int snd_pcm_hw_param_always_eq(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
|
|
@ -953,7 +957,7 @@ int snd_pcm_hw_param_never_eq(const snd_pcm_hw_params_t *params,
|
|||
max buffer size
|
||||
min tick time
|
||||
*/
|
||||
void snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
static void snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||
{
|
||||
snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_ACCESS, 0);
|
||||
snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_FORMAT, 0);
|
||||
|
|
@ -966,8 +970,9 @@ void snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_TICK_TIME, 0);
|
||||
}
|
||||
|
||||
unsigned int snd_pcm_hw_param_count(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
#if 0
|
||||
static unsigned int snd_pcm_hw_param_count(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var)
|
||||
{
|
||||
if (hw_is_mask(var)) {
|
||||
const snd_mask_t *mask = hw_param_mask_c(params, var);
|
||||
|
|
@ -980,6 +985,7 @@ unsigned int snd_pcm_hw_param_count(const snd_pcm_hw_params_t *params,
|
|||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int _snd_pcm_hw_param_refine(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
|
|
@ -1003,8 +1009,9 @@ int _snd_pcm_hw_param_refine(snd_pcm_hw_params_t *params,
|
|||
return changed;
|
||||
}
|
||||
|
||||
void _snd_pcm_hw_param_copy(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var,
|
||||
const snd_pcm_hw_params_t *src)
|
||||
#if 0
|
||||
static void _snd_pcm_hw_param_copy(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var,
|
||||
const snd_pcm_hw_params_t *src)
|
||||
{
|
||||
if (hw_is_mask(var)) {
|
||||
snd_mask_t *d = hw_param_mask(params, var);
|
||||
|
|
@ -1012,6 +1019,7 @@ void _snd_pcm_hw_param_copy(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var,
|
|||
snd_mask_copy(d, s);
|
||||
params->cmask |= 1 << var;
|
||||
params->rmask |= 1 << var;
|
||||
return;
|
||||
}
|
||||
if (hw_is_interval(var)) {
|
||||
snd_interval_t *d = hw_param_interval(params, var);
|
||||
|
|
@ -1019,9 +1027,11 @@ void _snd_pcm_hw_param_copy(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var,
|
|||
snd_interval_copy(d, s);
|
||||
params->cmask |= 1 << var;
|
||||
params->rmask |= 1 << var;
|
||||
return;
|
||||
}
|
||||
assert(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void snd_pcm_hw_param_dump(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var, snd_output_t *out)
|
||||
|
|
@ -1506,8 +1516,8 @@ struct _snd_pcm_hw_rule {
|
|||
void *private_data;
|
||||
};
|
||||
|
||||
int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
snd_interval_t t;
|
||||
snd_interval_mul(hw_param_interval_c(params, rule->deps[0]),
|
||||
|
|
@ -1515,7 +1525,7 @@ int snd_pcm_hw_rule_mul(snd_pcm_hw_params_t *params,
|
|||
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params,
|
||||
static int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
snd_interval_t t;
|
||||
|
|
@ -1524,8 +1534,8 @@ int snd_pcm_hw_rule_div(snd_pcm_hw_params_t *params,
|
|||
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
snd_interval_t t;
|
||||
snd_interval_muldivk(hw_param_interval_c(params, rule->deps[0]),
|
||||
|
|
@ -1534,8 +1544,8 @@ int snd_pcm_hw_rule_muldivk(snd_pcm_hw_params_t *params,
|
|||
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
snd_interval_t t;
|
||||
snd_interval_mulkdiv(hw_param_interval_c(params, rule->deps[0]),
|
||||
|
|
@ -1544,8 +1554,8 @@ int snd_pcm_hw_rule_mulkdiv(snd_pcm_hw_params_t *params,
|
|||
return snd_interval_refine(hw_param_interval(params, rule->var), &t);
|
||||
}
|
||||
|
||||
int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
int changed = 0;
|
||||
snd_pcm_format_t k;
|
||||
|
|
@ -1558,7 +1568,7 @@ int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
|
|||
bits = snd_pcm_format_physical_width(k);
|
||||
if (bits < 0)
|
||||
continue;
|
||||
if (!snd_interval_test(i, bits)) {
|
||||
if (!snd_interval_test(i, (unsigned int) bits)) {
|
||||
snd_pcm_format_mask_reset(mask, k);
|
||||
if (snd_mask_empty(mask))
|
||||
return -EINVAL;
|
||||
|
|
@ -1569,8 +1579,8 @@ int snd_pcm_hw_rule_format(snd_pcm_hw_params_t *params,
|
|||
}
|
||||
|
||||
|
||||
int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
static int snd_pcm_hw_rule_sample_bits(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_rule_t *rule)
|
||||
{
|
||||
unsigned int min, max;
|
||||
snd_pcm_format_t k;
|
||||
|
|
@ -2008,7 +2018,7 @@ int snd_pcm_hw_params_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
|||
return err;
|
||||
}
|
||||
|
||||
int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
||||
static int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
||||
{
|
||||
assert(pcm && params);
|
||||
assert(pcm->setup);
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm
|
|||
s = 0;
|
||||
}
|
||||
}
|
||||
err = snd_pcm_route_open(new, NULL, slv->format, slv->channels, ttable, tt_ssize, tt_cused, tt_sused, plug->slave, plug->slave != plug->req_slave);
|
||||
err = snd_pcm_route_open(new, NULL, slv->format, (int) slv->channels, ttable, tt_ssize, tt_cused, tt_sused, plug->slave, plug->slave != plug->req_slave);
|
||||
if (err < 0)
|
||||
return err;
|
||||
slv->channels = clt->channels;
|
||||
|
|
@ -288,7 +288,7 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
|
|||
snd_pcm_plug_t *plug = pcm->private_data;
|
||||
int err;
|
||||
snd_pcm_format_t cfmt;
|
||||
int (*f)(snd_pcm_t **pcm, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave);
|
||||
int (*f)(snd_pcm_t **_pcm, const char *name, snd_pcm_format_t sformat, snd_pcm_t *slave, int close_slave);
|
||||
if (snd_pcm_format_linear(slv->format)) {
|
||||
/* Conversion is done in another plugin */
|
||||
if (clt->format == slv->format ||
|
||||
|
|
@ -362,7 +362,7 @@ static int snd_pcm_plug_insert_plugins(snd_pcm_t *pcm,
|
|||
snd_pcm_plug_params_t *slave)
|
||||
{
|
||||
snd_pcm_plug_t *plug = pcm->private_data;
|
||||
int (*funcs[])(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_plug_params_t *s, snd_pcm_plug_params_t *d) = {
|
||||
int (*funcs[])(snd_pcm_t *_pcm, snd_pcm_t **new, snd_pcm_plug_params_t *s, snd_pcm_plug_params_t *d) = {
|
||||
snd_pcm_plug_change_format,
|
||||
snd_pcm_plug_change_channels,
|
||||
snd_pcm_plug_change_rate,
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ int snd_pcm_plugin_prepare(snd_pcm_t *pcm)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_plugin_reset(snd_pcm_t *pcm)
|
||||
static int snd_pcm_plugin_reset(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
int err;
|
||||
|
|
@ -169,7 +169,7 @@ snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames
|
|||
snd_pcm_sframes_t err;
|
||||
/* FIXME: rate plugin */
|
||||
if (plugin->slave_frames)
|
||||
frames = plugin->slave_frames(pcm, frames);
|
||||
frames = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
|
||||
snd_atomic_write_begin(&plugin->watom);
|
||||
err = snd_pcm_rewind(plugin->slave, frames);
|
||||
if (err < 0) {
|
||||
|
|
@ -181,20 +181,20 @@ snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames
|
|||
}
|
||||
if (plugin->client_frames)
|
||||
err = plugin->client_frames(pcm, err);
|
||||
snd_pcm_mmap_hw_backward(pcm, err);
|
||||
snd_pcm_mmap_hw_backward(pcm, (snd_pcm_uframes_t) err);
|
||||
n += err;
|
||||
} else
|
||||
snd_atomic_write_begin(&plugin->watom);
|
||||
_end:
|
||||
snd_pcm_mmap_appl_backward(pcm, n);
|
||||
snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) n);
|
||||
snd_atomic_write_end(&plugin->watom);
|
||||
return n;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_plugin_write_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
static snd_pcm_uframes_t snd_pcm_plugin_write_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
snd_pcm_t *slave = plugin->slave;
|
||||
|
|
@ -225,10 +225,10 @@ snd_pcm_uframes_t snd_pcm_plugin_write_areas(snd_pcm_t *pcm,
|
|||
return xfer;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_plugin_read_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
static snd_pcm_uframes_t snd_pcm_plugin_read_areas(snd_pcm_t *pcm,
|
||||
const snd_pcm_channel_area_t *areas,
|
||||
snd_pcm_uframes_t offset,
|
||||
snd_pcm_uframes_t size)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
snd_pcm_t *slave = plugin->slave;
|
||||
|
|
@ -350,15 +350,17 @@ snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
|
|||
snd_pcm_t *slave = plugin->slave;
|
||||
const snd_pcm_channel_area_t *areas, *slave_areas;
|
||||
snd_pcm_uframes_t xfer, offset, size;
|
||||
snd_pcm_uframes_t slave_offset, slave_size;
|
||||
snd_pcm_uframes_t slave_offset;
|
||||
snd_pcm_sframes_t slave_size;
|
||||
slave_size = snd_pcm_avail_update(slave);
|
||||
if (slave_size <= 0)
|
||||
return slave_size;
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK ||
|
||||
pcm->access == SND_PCM_ACCESS_RW_INTERLEAVED ||
|
||||
pcm->access == SND_PCM_ACCESS_RW_NONINTERLEAVED)
|
||||
return plugin->client_frames ?
|
||||
plugin->client_frames(pcm, slave_size) : slave_size;
|
||||
return (plugin->client_frames ?
|
||||
plugin->client_frames(pcm, slave_size) :
|
||||
slave_size);
|
||||
xfer = snd_pcm_mmap_capture_avail(pcm);
|
||||
size = pcm->buffer_size - xfer;
|
||||
areas = snd_pcm_mmap_areas(pcm);
|
||||
|
|
@ -398,7 +400,7 @@ snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
|
|||
int snd_pcm_plugin_mmap(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_plugin_t *plug = pcm->private_data;
|
||||
size_t size = snd_pcm_frames_to_bytes(pcm, pcm->buffer_size);
|
||||
size_t size = snd_pcm_frames_to_bytes(pcm, (snd_pcm_sframes_t) pcm->buffer_size);
|
||||
int id = shmget(IPC_PRIVATE, size, 0666);
|
||||
if (id < 0) {
|
||||
SYSERR("shmget failed");
|
||||
|
|
@ -418,12 +420,6 @@ int snd_pcm_plugin_munmap(snd_pcm_t *pcm)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_plugin_poll_descriptor(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
return _snd_pcm_poll_descriptor(plugin->slave);
|
||||
}
|
||||
|
||||
int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
|
|
@ -446,7 +442,7 @@ int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
goto _again;
|
||||
}
|
||||
if (plugin->client_frames)
|
||||
status->avail_max = plugin->client_frames(pcm, status->avail_max);
|
||||
status->avail_max = plugin->client_frames(pcm, (snd_pcm_sframes_t) status->avail_max);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,37 +95,42 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
|
|||
unsigned int *tt_cused, unsigned int *tt_sused,
|
||||
int schannels);
|
||||
int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
|
||||
snd_pcm_format_t sformat, unsigned int schannels,
|
||||
snd_pcm_format_t sformat, int schannels,
|
||||
snd_pcm_route_ttable_entry_t *ttable,
|
||||
unsigned int tt_ssize,
|
||||
unsigned int tt_cused, unsigned int tt_sused,
|
||||
snd_pcm_t *slave, int close_slave);
|
||||
int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, int srate, snd_pcm_t *slave, int close_slave);
|
||||
int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, unsigned int srate, snd_pcm_t *slave, int close_slave);
|
||||
|
||||
|
||||
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int convidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int convidx);
|
||||
void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx);
|
||||
void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx);
|
||||
void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx);
|
||||
void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx);
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx);
|
||||
|
||||
typedef struct _snd_pcm_adpcm_state {
|
||||
int pred_val; /* Calculated predicted value */
|
||||
|
|
@ -136,11 +141,13 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int putidx,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int putidx,
|
||||
snd_pcm_adpcm_state_t *states);
|
||||
void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames, int getidx,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
unsigned int getidx,
|
||||
snd_pcm_adpcm_state_t *states);
|
||||
|
|
|
|||
|
|
@ -39,30 +39,30 @@ typedef snd_pcm_uframes_t (*rate_f)(const snd_pcm_channel_area_t *dst_areas,
|
|||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t src_frames,
|
||||
unsigned int channels,
|
||||
int getidx, int putidx,
|
||||
unsigned int getidx, unsigned int putidx,
|
||||
unsigned int arg,
|
||||
snd_pcm_rate_state_t *states);
|
||||
|
||||
typedef struct {
|
||||
/* This field need to be the first */
|
||||
snd_pcm_plugin_t plug;
|
||||
int get_idx;
|
||||
int put_idx;
|
||||
unsigned int get_idx;
|
||||
unsigned int put_idx;
|
||||
unsigned int pitch;
|
||||
rate_f func;
|
||||
snd_pcm_format_t sformat;
|
||||
int srate;
|
||||
unsigned int srate;
|
||||
snd_pcm_rate_state_t *states;
|
||||
} snd_pcm_rate_t;
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
|
||||
unsigned int channels,
|
||||
int getidx, int putidx,
|
||||
unsigned int get_threshold,
|
||||
snd_pcm_rate_state_t *states)
|
||||
static snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
|
||||
unsigned int channels,
|
||||
unsigned int getidx, unsigned int putidx,
|
||||
unsigned int get_threshold,
|
||||
snd_pcm_rate_state_t *states)
|
||||
{
|
||||
#define GET16_LABELS
|
||||
#define PUT16_LABELS
|
||||
|
|
@ -129,14 +129,14 @@ snd_pcm_uframes_t snd_pcm_rate_expand(const snd_pcm_channel_area_t *dst_areas,
|
|||
return src_frames1;
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t snd_pcm_rate_shrink(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
|
||||
unsigned int channels,
|
||||
int getidx, int putidx,
|
||||
unsigned int get_increment,
|
||||
snd_pcm_rate_state_t *states)
|
||||
static snd_pcm_uframes_t snd_pcm_rate_shrink(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset, snd_pcm_uframes_t *dst_framesp,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset, snd_pcm_uframes_t src_frames,
|
||||
unsigned int channels,
|
||||
unsigned int getidx, unsigned int putidx,
|
||||
unsigned int get_increment,
|
||||
snd_pcm_rate_state_t *states)
|
||||
{
|
||||
#define GET16_LABELS
|
||||
#define PUT16_LABELS
|
||||
|
|
@ -436,7 +436,7 @@ snd_pcm_rate_read_areas(snd_pcm_t *pcm,
|
|||
return size;
|
||||
}
|
||||
|
||||
snd_pcm_sframes_t snd_pcm_rate_client_frames(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
||||
static snd_pcm_sframes_t snd_pcm_rate_client_frames(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
||||
{
|
||||
snd_pcm_rate_t *rate = pcm->private_data;
|
||||
/* Round toward zero */
|
||||
|
|
@ -446,7 +446,7 @@ snd_pcm_sframes_t snd_pcm_rate_client_frames(snd_pcm_t *pcm, snd_pcm_sframes_t f
|
|||
return muldiv_down(frames, rate->pitch, DIV);
|
||||
}
|
||||
|
||||
snd_pcm_sframes_t snd_pcm_rate_slave_frames(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
||||
static snd_pcm_sframes_t snd_pcm_rate_slave_frames(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
||||
{
|
||||
snd_pcm_rate_t *rate = pcm->private_data;
|
||||
/* Round toward zero */
|
||||
|
|
@ -489,7 +489,7 @@ snd_pcm_ops_t snd_pcm_rate_ops = {
|
|||
munmap: snd_pcm_plugin_munmap,
|
||||
};
|
||||
|
||||
int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, int srate, snd_pcm_t *slave, int close_slave)
|
||||
int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sformat, unsigned int srate, snd_pcm_t *slave, int close_slave)
|
||||
{
|
||||
snd_pcm_t *pcm;
|
||||
snd_pcm_rate_t *rate;
|
||||
|
|
@ -581,7 +581,8 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
|||
free((void *) sname);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = snd_pcm_rate_open(pcmp, name, sformat, srate, spcm, 1);
|
||||
err = snd_pcm_rate_open(pcmp, name,
|
||||
sformat, (unsigned int) srate, spcm, 1);
|
||||
if (err < 0)
|
||||
snd_pcm_close(spcm);
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ typedef struct snd_pcm_route_ttable_dst snd_pcm_route_ttable_dst_t;
|
|||
|
||||
typedef struct {
|
||||
enum {UINT32=0, UINT64=1, FLOAT=2} sum_idx;
|
||||
int get_idx;
|
||||
int put_idx;
|
||||
int conv_idx;
|
||||
int src_size;
|
||||
unsigned int get_idx;
|
||||
unsigned int put_idx;
|
||||
unsigned int conv_idx;
|
||||
unsigned int src_size;
|
||||
snd_pcm_format_t dst_sfmt;
|
||||
unsigned int ndsts;
|
||||
snd_pcm_route_ttable_dst_t *dsts;
|
||||
|
|
@ -87,24 +87,24 @@ typedef struct {
|
|||
} snd_pcm_route_t;
|
||||
|
||||
|
||||
void snd_pcm_route_convert1_zero(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas ATTRIBUTE_UNUSED,
|
||||
snd_pcm_uframes_t src_offset ATTRIBUTE_UNUSED,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable ATTRIBUTE_UNUSED,
|
||||
const snd_pcm_route_params_t *params)
|
||||
static void snd_pcm_route_convert1_zero(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas ATTRIBUTE_UNUSED,
|
||||
snd_pcm_uframes_t src_offset ATTRIBUTE_UNUSED,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable ATTRIBUTE_UNUSED,
|
||||
const snd_pcm_route_params_t *params)
|
||||
{
|
||||
snd_pcm_area_silence(dst_area, dst_offset, frames, params->dst_sfmt);
|
||||
}
|
||||
|
||||
void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable,
|
||||
const snd_pcm_route_params_t *params)
|
||||
static void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable,
|
||||
const snd_pcm_route_params_t *params)
|
||||
{
|
||||
#define CONV_LABELS
|
||||
#include "plugin_ops.h"
|
||||
|
|
@ -143,13 +143,13 @@ void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area,
|
|||
}
|
||||
}
|
||||
|
||||
void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable,
|
||||
const snd_pcm_route_params_t *params)
|
||||
static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t frames,
|
||||
const snd_pcm_route_ttable_dst_t* ttable,
|
||||
const snd_pcm_route_params_t *params)
|
||||
{
|
||||
#define GETU_LABELS
|
||||
#define PUT32_LABELS
|
||||
|
|
@ -376,13 +376,13 @@ void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
|
|||
}
|
||||
}
|
||||
|
||||
void snd_pcm_route_convert(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t dst_channels,
|
||||
snd_pcm_uframes_t frames,
|
||||
snd_pcm_route_params_t *params)
|
||||
static void snd_pcm_route_convert(const snd_pcm_channel_area_t *dst_areas,
|
||||
snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas,
|
||||
snd_pcm_uframes_t src_offset,
|
||||
snd_pcm_uframes_t dst_channels,
|
||||
snd_pcm_uframes_t frames,
|
||||
snd_pcm_route_params_t *params)
|
||||
{
|
||||
unsigned int dst_channel;
|
||||
snd_pcm_route_ttable_dst_t *dstp;
|
||||
|
|
@ -459,7 +459,7 @@ static int snd_pcm_route_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t
|
|||
}
|
||||
if (route->schannels >= 0) {
|
||||
_snd_pcm_hw_param_set(sparams, SND_PCM_HW_PARAM_CHANNELS,
|
||||
route->schannels, 0);
|
||||
(unsigned int) route->schannels, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -650,10 +650,10 @@ snd_pcm_ops_t snd_pcm_route_ops = {
|
|||
munmap: snd_pcm_plugin_munmap,
|
||||
};
|
||||
|
||||
int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t stream,
|
||||
unsigned int tt_ssize,
|
||||
snd_pcm_route_ttable_entry_t *ttable,
|
||||
unsigned int tt_cused, unsigned int tt_sused)
|
||||
static int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t stream,
|
||||
unsigned int tt_ssize,
|
||||
snd_pcm_route_ttable_entry_t *ttable,
|
||||
unsigned int tt_cused, unsigned int tt_sused)
|
||||
{
|
||||
unsigned int src_channel, dst_channel;
|
||||
snd_pcm_route_ttable_dst_t *dptr;
|
||||
|
|
@ -710,7 +710,7 @@ int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t stream,
|
|||
else
|
||||
dptr->func = snd_pcm_route_convert1_many;
|
||||
if (nsrcs > 0) {
|
||||
dptr->srcs = calloc(nsrcs, sizeof(*srcs));
|
||||
dptr->srcs = calloc((unsigned int) nsrcs, sizeof(*srcs));
|
||||
if (!dptr->srcs)
|
||||
return -ENOMEM;
|
||||
memcpy(dptr->srcs, srcs, sizeof(*srcs) * nsrcs);
|
||||
|
|
@ -723,7 +723,7 @@ int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t stream,
|
|||
|
||||
|
||||
int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
|
||||
snd_pcm_format_t sformat, unsigned int schannels,
|
||||
snd_pcm_format_t sformat, int schannels,
|
||||
snd_pcm_route_ttable_entry_t *ttable,
|
||||
unsigned int tt_ssize,
|
||||
unsigned int tt_cused, unsigned int tt_sused,
|
||||
|
|
@ -801,11 +801,11 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
|
|||
if (snd_config_get_type(in) != SND_CONFIG_TYPE_COMPOUND)
|
||||
return -EINVAL;
|
||||
snd_config_for_each(j, jnext, in) {
|
||||
snd_config_t *jn = snd_config_iterator_entry(j);
|
||||
snd_config_t *jnode = snd_config_iterator_entry(j);
|
||||
double value;
|
||||
long schannel;
|
||||
int err;
|
||||
const char *id = snd_config_get_id(jn);
|
||||
const char *id = snd_config_get_id(jnode);
|
||||
errno = 0;
|
||||
schannel = strtol(id, &p, 10);
|
||||
if (errno || *p ||
|
||||
|
|
@ -814,10 +814,10 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
|
|||
SNDERR("Invalid slave channel: %s", id);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = snd_config_get_real(jn, &value);
|
||||
err = snd_config_get_real(jnode, &value);
|
||||
if (err < 0) {
|
||||
long v;
|
||||
err = snd_config_get_integer(jn, &v);
|
||||
err = snd_config_get_integer(jnode, &v);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ static snd_pcm_uframes_t _snd_pcm_share_slave_missing(snd_pcm_share_slave_t *sla
|
|||
return missing;
|
||||
}
|
||||
|
||||
void *snd_pcm_share_thread(void *data)
|
||||
static void *snd_pcm_share_thread(void *data)
|
||||
{
|
||||
snd_pcm_share_slave_t *slave = data;
|
||||
snd_pcm_t *spcm = slave->pcm;
|
||||
|
|
@ -775,7 +775,7 @@ static snd_pcm_sframes_t _snd_pcm_share_mmap_forward(snd_pcm_t *pcm, snd_pcm_ufr
|
|||
}
|
||||
snd_pcm_mmap_appl_forward(pcm, size);
|
||||
if (share->state == SND_PCM_STATE_RUNNING) {
|
||||
snd_pcm_sframes_t frames = _snd_pcm_share_slave_forward(slave);
|
||||
frames = _snd_pcm_share_slave_forward(slave);
|
||||
if (frames > 0) {
|
||||
snd_pcm_sframes_t err;
|
||||
err = snd_pcm_mmap_forward(slave->pcm, frames);
|
||||
|
|
@ -1314,7 +1314,6 @@ int snd_pcm_share_open(snd_pcm_t **pcmp, const char *name, const char *sname,
|
|||
Pthread_mutex_unlock(&snd_pcm_share_slaves_mutex);
|
||||
list_for_each(i, &slave->clients) {
|
||||
snd_pcm_share_t *sh = list_entry(i, snd_pcm_share_t, list);
|
||||
unsigned int k;
|
||||
for (k = 0; k < sh->channels; ++k) {
|
||||
if (slave_map[sh->slave_channels[k]]) {
|
||||
SNDERR("Slave channel %d is already in use", sh->slave_channels[k]);
|
||||
|
|
@ -1456,7 +1455,8 @@ int _snd_pcm_share_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
if (schannels <= 0)
|
||||
schannels = schannel_max + 1;
|
||||
err = snd_pcm_share_open(pcmp, name, sname, sformat, srate,
|
||||
schannels, speriod_time, sbuffer_time,
|
||||
(unsigned int) schannels,
|
||||
speriod_time, sbuffer_time,
|
||||
channels, channels_map, stream, mode);
|
||||
_free:
|
||||
free(channels_map);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ typedef struct {
|
|||
volatile snd_pcm_shm_ctrl_t *ctrl;
|
||||
} snd_pcm_shm_t;
|
||||
|
||||
int receive_fd(int socket, void *data, size_t len, int *fd)
|
||||
int receive_fd(int sock, void *data, size_t len, int *fd)
|
||||
{
|
||||
int ret;
|
||||
size_t cmsg_len = CMSG_LEN(sizeof(int));
|
||||
|
|
@ -68,7 +68,7 @@ int receive_fd(int socket, void *data, size_t len, int *fd)
|
|||
msghdr.msg_controllen = cmsg_len;
|
||||
msghdr.msg_flags = 0;
|
||||
|
||||
ret = recvmsg(socket, &msghdr, 0);
|
||||
ret = recvmsg(sock, &msghdr, 0);
|
||||
if (ret < 0) {
|
||||
SYSERR("recvmsg failed");
|
||||
return -errno;
|
||||
|
|
@ -563,7 +563,7 @@ static int make_inet_socket(const char *host, int port)
|
|||
}
|
||||
#endif
|
||||
|
||||
int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *socket, const char *sname, snd_pcm_stream_t stream, int mode)
|
||||
int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *sockname, const char *sname, snd_pcm_stream_t stream, int mode)
|
||||
{
|
||||
snd_pcm_t *pcm;
|
||||
snd_pcm_shm_t *shm = NULL;
|
||||
|
|
@ -578,9 +578,9 @@ int snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, const char *socket, con
|
|||
if (snamelen > 255)
|
||||
return -EINVAL;
|
||||
|
||||
result = make_local_socket(socket);
|
||||
result = make_local_socket(sockname);
|
||||
if (result < 0) {
|
||||
SNDERR("server for socket %s is not running", socket);
|
||||
SNDERR("server for socket %s is not running", sockname);
|
||||
goto _err;
|
||||
}
|
||||
sock = result;
|
||||
|
|
@ -687,7 +687,7 @@ int is_local(struct hostent *hent)
|
|||
}
|
||||
|
||||
conf.ifc_len = numreqs * sizeof(struct ifreq);
|
||||
conf.ifc_buf = malloc(conf.ifc_len);
|
||||
conf.ifc_buf = malloc((unsigned int) conf.ifc_len);
|
||||
while (1) {
|
||||
err = ioctl(s, SIOCGIFCONF, &conf);
|
||||
if (err < 0) {
|
||||
|
|
@ -698,17 +698,17 @@ int is_local(struct hostent *hent)
|
|||
break;
|
||||
numreqs *= 2;
|
||||
conf.ifc_len = numreqs * sizeof(struct ifreq);
|
||||
conf.ifc_buf = realloc(conf.ifc_buf, conf.ifc_len);
|
||||
conf.ifc_buf = realloc(conf.ifc_buf, (unsigned int) conf.ifc_len);
|
||||
}
|
||||
numreqs = conf.ifc_len / sizeof(struct ifreq);
|
||||
for (i = 0; i < numreqs; ++i) {
|
||||
struct ifreq *req = &conf.ifc_req[i];
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)&req->ifr_addr;
|
||||
sin->sin_family = AF_INET;
|
||||
struct sockaddr_in *s_in = (struct sockaddr_in *)&req->ifr_addr;
|
||||
s_in->sin_family = AF_INET;
|
||||
err = ioctl(s, SIOCGIFADDR, req);
|
||||
if (err < 0)
|
||||
continue;
|
||||
if (haddr->s_addr == sin->sin_addr.s_addr)
|
||||
if (haddr->s_addr == s_in->sin_addr.s_addr)
|
||||
break;
|
||||
}
|
||||
close(s);
|
||||
|
|
@ -724,7 +724,7 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
const char *pcm_name = NULL;
|
||||
snd_config_t *sconfig;
|
||||
const char *host = NULL;
|
||||
const char *socket = NULL;
|
||||
const char *sockname = NULL;
|
||||
long port = -1;
|
||||
int err;
|
||||
int local;
|
||||
|
|
@ -786,7 +786,7 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
continue;
|
||||
}
|
||||
if (strcmp(id, "socket") == 0) {
|
||||
err = snd_config_get_string(n, &socket);
|
||||
err = snd_config_get_string(n, &sockname);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
return -EINVAL;
|
||||
|
|
@ -809,7 +809,7 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
SNDERR("host is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!socket) {
|
||||
if (!sockname) {
|
||||
SNDERR("socket is not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -823,6 +823,6 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, snd_config_t *conf,
|
|||
SNDERR("%s is not the local host", host);
|
||||
return -EINVAL;
|
||||
}
|
||||
return snd_pcm_shm_open(pcmp, name, socket, pcm_name, stream, mode);
|
||||
return snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,15 @@
|
|||
#define as_s32(ptr) (*(int32_t*)(ptr))
|
||||
#define as_s64(ptr) (*(int64_t*)(ptr))
|
||||
|
||||
#define as_u8c(ptr) (*(const u_int8_t*)(ptr))
|
||||
#define as_u16c(ptr) (*(const u_int16_t*)(ptr))
|
||||
#define as_u32c(ptr) (*(const u_int32_t*)(ptr))
|
||||
#define as_u64c(ptr) (*(const u_int64_t*)(ptr))
|
||||
#define as_s8c(ptr) (*(const int8_t*)(ptr))
|
||||
#define as_s16c(ptr) (*(const int16_t*)(ptr))
|
||||
#define as_s32c(ptr) (*(const int32_t*)(ptr))
|
||||
#define as_s64c(ptr) (*(const int64_t*)(ptr))
|
||||
|
||||
#ifdef COPY_LABELS
|
||||
static void *copy_labels[4] = {
|
||||
&©_8,
|
||||
|
|
@ -40,10 +49,10 @@ static void *copy_labels[4] = {
|
|||
|
||||
#ifdef COPY_END
|
||||
while(0) {
|
||||
copy_8: as_s8(dst) = as_s8(src); goto COPY_END;
|
||||
copy_16: as_s16(dst) = as_s16(src); goto COPY_END;
|
||||
copy_32: as_s32(dst) = as_s32(src); goto COPY_END;
|
||||
copy_64: as_s64(dst) = as_s64(src); goto COPY_END;
|
||||
copy_8: as_s8(dst) = as_s8c(src); goto COPY_END;
|
||||
copy_16: as_s16(dst) = as_s16c(src); goto COPY_END;
|
||||
copy_32: as_s32(dst) = as_s32c(src); goto COPY_END;
|
||||
copy_64: as_s64(dst) = as_s64c(src); goto COPY_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -183,100 +192,100 @@ static void *conv_labels[4 * 2 * 2 * 4 * 2] = {
|
|||
|
||||
#ifdef CONV_END
|
||||
while(0) {
|
||||
conv_xxx1_xxx1: as_u8(dst) = as_u8(src); goto CONV_END;
|
||||
conv_xxx1_xx10: as_u16(dst) = (u_int16_t)as_u8(src) << 8; goto CONV_END;
|
||||
conv_xxx1_xx01: as_u16(dst) = (u_int16_t)as_u8(src); goto CONV_END;
|
||||
conv_xxx1_x100: as_u32(dst) = (u_int32_t)as_u8(src) << 16; goto CONV_END;
|
||||
conv_xxx1_001x: as_u32(dst) = (u_int32_t)as_u8(src) << 8; goto CONV_END;
|
||||
conv_xxx1_1000: as_u32(dst) = (u_int32_t)as_u8(src) << 24; goto CONV_END;
|
||||
conv_xxx1_0001: as_u32(dst) = (u_int32_t)as_u8(src); goto CONV_END;
|
||||
conv_xxx1_xxx9: as_u8(dst) = as_u8(src) ^ 0x80; goto CONV_END;
|
||||
conv_xxx1_xx90: as_u16(dst) = (u_int16_t)(as_u8(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xxx1_xx09: as_u16(dst) = (u_int16_t)(as_u8(src) ^ 0x80); goto CONV_END;
|
||||
conv_xxx1_x900: as_u32(dst) = (u_int32_t)(as_u8(src) ^ 0x80) << 16; goto CONV_END;
|
||||
conv_xxx1_009x: as_u32(dst) = (u_int32_t)(as_u8(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xxx1_9000: as_u32(dst) = (u_int32_t)(as_u8(src) ^ 0x80) << 24; goto CONV_END;
|
||||
conv_xxx1_0009: as_u32(dst) = (u_int32_t)(as_u8(src) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xxx1: as_u8(dst) = as_u16(src) >> 8; goto CONV_END;
|
||||
conv_xx12_xx12: as_u16(dst) = as_u16(src); goto CONV_END;
|
||||
conv_xx12_xx21: as_u16(dst) = bswap_16(as_u16(src)); goto CONV_END;
|
||||
conv_xx12_x120: as_u32(dst) = (u_int32_t)as_u16(src) << 8; goto CONV_END;
|
||||
conv_xx12_021x: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src)) << 8; goto CONV_END;
|
||||
conv_xx12_1200: as_u32(dst) = (u_int32_t)as_u16(src) << 16; goto CONV_END;
|
||||
conv_xx12_0021: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src)); goto CONV_END;
|
||||
conv_xx12_xxx9: as_u8(dst) = (as_u16(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_xx92: as_u16(dst) = as_u16(src) ^ 0x8000; goto CONV_END;
|
||||
conv_xx12_xx29: as_u16(dst) = bswap_16(as_u16(src)) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_x920: as_u32(dst) = (u_int32_t)(as_u16(src) ^ 0x8000) << 8; goto CONV_END;
|
||||
conv_xx12_029x: as_u32(dst) = (u_int32_t)(bswap_16(as_u16(src)) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_9200: as_u32(dst) = (u_int32_t)(as_u16(src) ^ 0x8000) << 16; goto CONV_END;
|
||||
conv_xx12_0029: as_u32(dst) = (u_int32_t)(bswap_16(as_u16(src)) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xxx2: as_u8(dst) = as_u16(src) & 0xff; goto CONV_END;
|
||||
conv_xx12_x210: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src)) << 8; goto CONV_END;
|
||||
conv_xx12_012x: as_u32(dst) = (u_int32_t)as_u16(src) << 8; goto CONV_END;
|
||||
conv_xx12_2100: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src)) << 16; goto CONV_END;
|
||||
conv_xx12_0012: as_u32(dst) = (u_int32_t)as_u16(src); goto CONV_END;
|
||||
conv_xx12_xxxA: as_u8(dst) = (as_u16(src) ^ 0x80) & 0xff; goto CONV_END;
|
||||
conv_xx12_xxA1: as_u16(dst) = bswap_16(as_u16(src) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xx1A: as_u16(dst) = as_u16(src) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_xA10: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_01Ax: as_u32(dst) = (u_int32_t)(as_u16(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_A100: as_u32(dst) = (u_int32_t)bswap_16(as_u16(src) ^ 0x80) << 16; goto CONV_END;
|
||||
conv_xx12_001A: as_u32(dst) = (u_int32_t)(as_u16(src) ^ 0x80); goto CONV_END;
|
||||
conv_x123_xxx1: as_u8(dst) = as_u32(src) >> 16; goto CONV_END;
|
||||
conv_x123_xx12: as_u16(dst) = as_u32(src) >> 8; goto CONV_END;
|
||||
conv_x123_xx21: as_u16(dst) = bswap_16(as_u32(src) >> 8); goto CONV_END;
|
||||
conv_x123_x123: as_u32(dst) = as_u32(src); goto CONV_END;
|
||||
conv_x123_321x: as_u32(dst) = bswap_32(as_u32(src)); goto CONV_END;
|
||||
conv_x123_1230: as_u32(dst) = as_u32(src) << 8; goto CONV_END;
|
||||
conv_x123_0321: as_u32(dst) = bswap_32(as_u32(src)) >> 8; goto CONV_END;
|
||||
conv_x123_xxx9: as_u8(dst) = (as_u32(src) >> 16) ^ 0x80; goto CONV_END;
|
||||
conv_x123_xx92: as_u16(dst) = (as_u32(src) >> 8) ^ 0x8000; goto CONV_END;
|
||||
conv_x123_xx29: as_u16(dst) = bswap_16(as_u32(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_x123_x923: as_u32(dst) = as_u32(src) ^ 0x800000; goto CONV_END;
|
||||
conv_x123_329x: as_u32(dst) = bswap_32(as_u32(src)) ^ 0x8000; goto CONV_END;
|
||||
conv_x123_9230: as_u32(dst) = (as_u32(src) ^ 0x800000) << 8; goto CONV_END;
|
||||
conv_x123_0329: as_u32(dst) = (bswap_32(as_u32(src)) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xxx3: as_u8(dst) = (as_u32(src) >> 8) & 0xff; goto CONV_END;
|
||||
conv_123x_xx32: as_u16(dst) = bswap_16(as_u32(src) >> 8); goto CONV_END;
|
||||
conv_123x_xx23: as_u16(dst) = (as_u32(src) >> 8) & 0xffff; goto CONV_END;
|
||||
conv_123x_x321: as_u32(dst) = bswap_32(as_u32(src)); goto CONV_END;
|
||||
conv_123x_123x: as_u32(dst) = as_u32(src); goto CONV_END;
|
||||
conv_123x_3210: as_u32(dst) = bswap_32(as_u32(src)) << 8; goto CONV_END;
|
||||
conv_123x_0123: as_u32(dst) = as_u32(src) >> 8; goto CONV_END;
|
||||
conv_123x_xxxB: as_u8(dst) = ((as_u32(src) >> 8) & 0xff) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xxB2: as_u16(dst) = bswap_16((as_u32(src) >> 8) ^ 0x80); goto CONV_END;
|
||||
conv_123x_xx2B: as_u16(dst) = ((as_u32(src) >> 8) & 0xffff) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xB21: as_u32(dst) = bswap_32(as_u32(src)) ^ 0x800000; goto CONV_END;
|
||||
conv_123x_12Bx: as_u32(dst) = as_u32(src) ^ 0x8000; goto CONV_END;
|
||||
conv_123x_B210: as_u32(dst) = bswap_32(as_u32(src) ^ 0x8000) << 8; goto CONV_END;
|
||||
conv_123x_012B: as_u32(dst) = (as_u32(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxx1: as_u8(dst) = as_u32(src) >> 24; goto CONV_END;
|
||||
conv_1234_xx12: as_u16(dst) = as_u32(src) >> 16; goto CONV_END;
|
||||
conv_1234_xx21: as_u16(dst) = bswap_16(as_u32(src) >> 16); goto CONV_END;
|
||||
conv_1234_x123: as_u32(dst) = as_u32(src) >> 8; goto CONV_END;
|
||||
conv_1234_321x: as_u32(dst) = bswap_32(as_u32(src)) << 8; goto CONV_END;
|
||||
conv_1234_1234: as_u32(dst) = as_u32(src); goto CONV_END;
|
||||
conv_1234_4321: as_u32(dst) = bswap_32(as_u32(src)); goto CONV_END;
|
||||
conv_1234_xxx9: as_u8(dst) = (as_u32(src) >> 24) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xx92: as_u16(dst) = (as_u32(src) >> 16) ^ 0x8000; goto CONV_END;
|
||||
conv_1234_xx29: as_u16(dst) = bswap_16(as_u32(src) >> 16) ^ 0x80; goto CONV_END;
|
||||
conv_1234_x923: as_u32(dst) = (as_u32(src) >> 8) ^ 0x800000; goto CONV_END;
|
||||
conv_1234_329x: as_u32(dst) = (bswap_32(as_u32(src)) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_1234_9234: as_u32(dst) = as_u32(src) ^ 0x80000000; goto CONV_END;
|
||||
conv_1234_4329: as_u32(dst) = bswap_32(as_u32(src)) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxx4: as_u8(dst) = as_u32(src) & 0xff; goto CONV_END;
|
||||
conv_1234_xx43: as_u16(dst) = bswap_16(as_u32(src)); goto CONV_END;
|
||||
conv_1234_xx34: as_u16(dst) = as_u32(src) & 0xffff; goto CONV_END;
|
||||
conv_1234_x432: as_u32(dst) = bswap_32(as_u32(src)) >> 8; goto CONV_END;
|
||||
conv_1234_234x: as_u32(dst) = as_u32(src) << 8; goto CONV_END;
|
||||
conv_1234_xxxC: as_u8(dst) = (as_u32(src) & 0xff) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxC3: as_u16(dst) = bswap_16(as_u32(src) ^ 0x80); goto CONV_END;
|
||||
conv_1234_xx3C: as_u16(dst) = (as_u32(src) & 0xffff) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xC32: as_u32(dst) = (bswap_32(as_u32(src)) >> 8) ^ 0x800000; goto CONV_END;
|
||||
conv_1234_23Cx: as_u32(dst) = (as_u32(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_1234_C321: as_u32(dst) = bswap_32(as_u32(src) ^ 0x80); goto CONV_END;
|
||||
conv_1234_123C: as_u32(dst) = as_u32(src) ^ 0x80; goto CONV_END;
|
||||
conv_xxx1_xxx1: as_u8(dst) = as_u8c(src); goto CONV_END;
|
||||
conv_xxx1_xx10: as_u16(dst) = (u_int16_t)as_u8c(src) << 8; goto CONV_END;
|
||||
conv_xxx1_xx01: as_u16(dst) = (u_int16_t)as_u8c(src); goto CONV_END;
|
||||
conv_xxx1_x100: as_u32(dst) = (u_int32_t)as_u8c(src) << 16; goto CONV_END;
|
||||
conv_xxx1_001x: as_u32(dst) = (u_int32_t)as_u8c(src) << 8; goto CONV_END;
|
||||
conv_xxx1_1000: as_u32(dst) = (u_int32_t)as_u8c(src) << 24; goto CONV_END;
|
||||
conv_xxx1_0001: as_u32(dst) = (u_int32_t)as_u8c(src); goto CONV_END;
|
||||
conv_xxx1_xxx9: as_u8(dst) = as_u8c(src) ^ 0x80; goto CONV_END;
|
||||
conv_xxx1_xx90: as_u16(dst) = (u_int16_t)(as_u8c(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xxx1_xx09: as_u16(dst) = (u_int16_t)(as_u8c(src) ^ 0x80); goto CONV_END;
|
||||
conv_xxx1_x900: as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 16; goto CONV_END;
|
||||
conv_xxx1_009x: as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xxx1_9000: as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80) << 24; goto CONV_END;
|
||||
conv_xxx1_0009: as_u32(dst) = (u_int32_t)(as_u8c(src) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xxx1: as_u8(dst) = as_u16c(src) >> 8; goto CONV_END;
|
||||
conv_xx12_xx12: as_u16(dst) = as_u16c(src); goto CONV_END;
|
||||
conv_xx12_xx21: as_u16(dst) = bswap_16(as_u16c(src)); goto CONV_END;
|
||||
conv_xx12_x120: as_u32(dst) = (u_int32_t)as_u16c(src) << 8; goto CONV_END;
|
||||
conv_xx12_021x: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 8; goto CONV_END;
|
||||
conv_xx12_1200: as_u32(dst) = (u_int32_t)as_u16c(src) << 16; goto CONV_END;
|
||||
conv_xx12_0021: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)); goto CONV_END;
|
||||
conv_xx12_xxx9: as_u8(dst) = (as_u16c(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_xx92: as_u16(dst) = as_u16c(src) ^ 0x8000; goto CONV_END;
|
||||
conv_xx12_xx29: as_u16(dst) = bswap_16(as_u16c(src)) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_x920: as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x8000) << 8; goto CONV_END;
|
||||
conv_xx12_029x: as_u32(dst) = (u_int32_t)(bswap_16(as_u16c(src)) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_9200: as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x8000) << 16; goto CONV_END;
|
||||
conv_xx12_0029: as_u32(dst) = (u_int32_t)(bswap_16(as_u16c(src)) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xxx2: as_u8(dst) = as_u16c(src) & 0xff; goto CONV_END;
|
||||
conv_xx12_x210: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 8; goto CONV_END;
|
||||
conv_xx12_012x: as_u32(dst) = (u_int32_t)as_u16c(src) << 8; goto CONV_END;
|
||||
conv_xx12_2100: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src)) << 16; goto CONV_END;
|
||||
conv_xx12_0012: as_u32(dst) = (u_int32_t)as_u16c(src); goto CONV_END;
|
||||
conv_xx12_xxxA: as_u8(dst) = (as_u16c(src) ^ 0x80) & 0xff; goto CONV_END;
|
||||
conv_xx12_xxA1: as_u16(dst) = bswap_16(as_u16c(src) ^ 0x80); goto CONV_END;
|
||||
conv_xx12_xx1A: as_u16(dst) = as_u16c(src) ^ 0x80; goto CONV_END;
|
||||
conv_xx12_xA10: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_01Ax: as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_xx12_A100: as_u32(dst) = (u_int32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; goto CONV_END;
|
||||
conv_xx12_001A: as_u32(dst) = (u_int32_t)(as_u16c(src) ^ 0x80); goto CONV_END;
|
||||
conv_x123_xxx1: as_u8(dst) = as_u32c(src) >> 16; goto CONV_END;
|
||||
conv_x123_xx12: as_u16(dst) = as_u32c(src) >> 8; goto CONV_END;
|
||||
conv_x123_xx21: as_u16(dst) = bswap_16(as_u32c(src) >> 8); goto CONV_END;
|
||||
conv_x123_x123: as_u32(dst) = as_u32c(src); goto CONV_END;
|
||||
conv_x123_321x: as_u32(dst) = bswap_32(as_u32c(src)); goto CONV_END;
|
||||
conv_x123_1230: as_u32(dst) = as_u32c(src) << 8; goto CONV_END;
|
||||
conv_x123_0321: as_u32(dst) = bswap_32(as_u32c(src)) >> 8; goto CONV_END;
|
||||
conv_x123_xxx9: as_u8(dst) = (as_u32c(src) >> 16) ^ 0x80; goto CONV_END;
|
||||
conv_x123_xx92: as_u16(dst) = (as_u32c(src) >> 8) ^ 0x8000; goto CONV_END;
|
||||
conv_x123_xx29: as_u16(dst) = bswap_16(as_u32c(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_x123_x923: as_u32(dst) = as_u32c(src) ^ 0x800000; goto CONV_END;
|
||||
conv_x123_329x: as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x8000; goto CONV_END;
|
||||
conv_x123_9230: as_u32(dst) = (as_u32c(src) ^ 0x800000) << 8; goto CONV_END;
|
||||
conv_x123_0329: as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xxx3: as_u8(dst) = (as_u32c(src) >> 8) & 0xff; goto CONV_END;
|
||||
conv_123x_xx32: as_u16(dst) = bswap_16(as_u32c(src) >> 8); goto CONV_END;
|
||||
conv_123x_xx23: as_u16(dst) = (as_u32c(src) >> 8) & 0xffff; goto CONV_END;
|
||||
conv_123x_x321: as_u32(dst) = bswap_32(as_u32c(src)); goto CONV_END;
|
||||
conv_123x_123x: as_u32(dst) = as_u32c(src); goto CONV_END;
|
||||
conv_123x_3210: as_u32(dst) = bswap_32(as_u32c(src)) << 8; goto CONV_END;
|
||||
conv_123x_0123: as_u32(dst) = as_u32c(src) >> 8; goto CONV_END;
|
||||
conv_123x_xxxB: as_u8(dst) = ((as_u32c(src) >> 8) & 0xff) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xxB2: as_u16(dst) = bswap_16((as_u32c(src) >> 8) ^ 0x80); goto CONV_END;
|
||||
conv_123x_xx2B: as_u16(dst) = ((as_u32c(src) >> 8) & 0xffff) ^ 0x80; goto CONV_END;
|
||||
conv_123x_xB21: as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x800000; goto CONV_END;
|
||||
conv_123x_12Bx: as_u32(dst) = as_u32c(src) ^ 0x8000; goto CONV_END;
|
||||
conv_123x_B210: as_u32(dst) = bswap_32(as_u32c(src) ^ 0x8000) << 8; goto CONV_END;
|
||||
conv_123x_012B: as_u32(dst) = (as_u32c(src) >> 8) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxx1: as_u8(dst) = as_u32c(src) >> 24; goto CONV_END;
|
||||
conv_1234_xx12: as_u16(dst) = as_u32c(src) >> 16; goto CONV_END;
|
||||
conv_1234_xx21: as_u16(dst) = bswap_16(as_u32c(src) >> 16); goto CONV_END;
|
||||
conv_1234_x123: as_u32(dst) = as_u32c(src) >> 8; goto CONV_END;
|
||||
conv_1234_321x: as_u32(dst) = bswap_32(as_u32c(src)) << 8; goto CONV_END;
|
||||
conv_1234_1234: as_u32(dst) = as_u32c(src); goto CONV_END;
|
||||
conv_1234_4321: as_u32(dst) = bswap_32(as_u32c(src)); goto CONV_END;
|
||||
conv_1234_xxx9: as_u8(dst) = (as_u32c(src) >> 24) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xx92: as_u16(dst) = (as_u32c(src) >> 16) ^ 0x8000; goto CONV_END;
|
||||
conv_1234_xx29: as_u16(dst) = bswap_16(as_u32c(src) >> 16) ^ 0x80; goto CONV_END;
|
||||
conv_1234_x923: as_u32(dst) = (as_u32c(src) >> 8) ^ 0x800000; goto CONV_END;
|
||||
conv_1234_329x: as_u32(dst) = (bswap_32(as_u32c(src)) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_1234_9234: as_u32(dst) = as_u32c(src) ^ 0x80000000; goto CONV_END;
|
||||
conv_1234_4329: as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxx4: as_u8(dst) = as_u32c(src) & 0xff; goto CONV_END;
|
||||
conv_1234_xx43: as_u16(dst) = bswap_16(as_u32c(src)); goto CONV_END;
|
||||
conv_1234_xx34: as_u16(dst) = as_u32c(src) & 0xffff; goto CONV_END;
|
||||
conv_1234_x432: as_u32(dst) = bswap_32(as_u32c(src)) >> 8; goto CONV_END;
|
||||
conv_1234_234x: as_u32(dst) = as_u32c(src) << 8; goto CONV_END;
|
||||
conv_1234_xxxC: as_u8(dst) = (as_u32c(src) & 0xff) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xxC3: as_u16(dst) = bswap_16(as_u32c(src) ^ 0x80); goto CONV_END;
|
||||
conv_1234_xx3C: as_u16(dst) = (as_u32c(src) & 0xffff) ^ 0x80; goto CONV_END;
|
||||
conv_1234_xC32: as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x800000; goto CONV_END;
|
||||
conv_1234_23Cx: as_u32(dst) = (as_u32c(src) ^ 0x80) << 8; goto CONV_END;
|
||||
conv_1234_C321: as_u32(dst) = bswap_32(as_u32c(src) ^ 0x80); goto CONV_END;
|
||||
conv_1234_123C: as_u32(dst) = as_u32c(src) ^ 0x80; goto CONV_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -304,20 +313,20 @@ static void *get16_labels[4 * 2 * 2] = {
|
|||
|
||||
#ifdef GET16_END
|
||||
while(0) {
|
||||
get16_1_10: sample = (u_int16_t)as_u8(src) << 8; goto GET16_END;
|
||||
get16_1_90: sample = (u_int16_t)(as_u8(src) ^ 0x80) << 8; goto GET16_END;
|
||||
get16_12_12: sample = as_u16(src); goto GET16_END;
|
||||
get16_12_92: sample = as_u16(src) ^ 0x8000; goto GET16_END;
|
||||
get16_12_21: sample = bswap_16(as_u16(src)); goto GET16_END;
|
||||
get16_12_A1: sample = bswap_16(as_u16(src) ^ 0x80); goto GET16_END;
|
||||
get16_0123_12: sample = as_u32(src) >> 8; goto GET16_END;
|
||||
get16_0123_92: sample = (as_u32(src) >> 8) ^ 0x8000; goto GET16_END;
|
||||
get16_1230_32: sample = bswap_16(as_u32(src) >> 8); goto GET16_END;
|
||||
get16_1230_B2: sample = bswap_16((as_u32(src) >> 8) ^ 0x8000); goto GET16_END;
|
||||
get16_1234_12: sample = as_u32(src) >> 16; goto GET16_END;
|
||||
get16_1234_92: sample = (as_u32(src) >> 16) ^ 0x8000; goto GET16_END;
|
||||
get16_1234_43: sample = bswap_16(as_u32(src)); goto GET16_END;
|
||||
get16_1234_C3: sample = bswap_16(as_u32(src) ^ 0x80); goto GET16_END;
|
||||
get16_1_10: sample = (u_int16_t)as_u8c(src) << 8; goto GET16_END;
|
||||
get16_1_90: sample = (u_int16_t)(as_u8c(src) ^ 0x80) << 8; goto GET16_END;
|
||||
get16_12_12: sample = as_u16c(src); goto GET16_END;
|
||||
get16_12_92: sample = as_u16c(src) ^ 0x8000; goto GET16_END;
|
||||
get16_12_21: sample = bswap_16(as_u16c(src)); goto GET16_END;
|
||||
get16_12_A1: sample = bswap_16(as_u16c(src) ^ 0x80); goto GET16_END;
|
||||
get16_0123_12: sample = as_u32c(src) >> 8; goto GET16_END;
|
||||
get16_0123_92: sample = (as_u32c(src) >> 8) ^ 0x8000; goto GET16_END;
|
||||
get16_1230_32: sample = bswap_16(as_u32c(src) >> 8); goto GET16_END;
|
||||
get16_1230_B2: sample = bswap_16((as_u32c(src) >> 8) ^ 0x8000); goto GET16_END;
|
||||
get16_1234_12: sample = as_u32c(src) >> 16; goto GET16_END;
|
||||
get16_1234_92: sample = (as_u32c(src) >> 16) ^ 0x8000; goto GET16_END;
|
||||
get16_1234_43: sample = bswap_16(as_u32c(src)); goto GET16_END;
|
||||
get16_1234_C3: sample = bswap_16(as_u32c(src) ^ 0x80); goto GET16_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -386,20 +395,20 @@ static void *get32_labels[4 * 2 * 2] = {
|
|||
|
||||
#ifdef GET32_END
|
||||
while (0) {
|
||||
get32_1_1000: sample = (u_int32_t)as_u8(src) << 24; goto GET32_END;
|
||||
get32_1_9000: sample = (u_int32_t)(as_u8(src) ^ 0x80) << 24; goto GET32_END;
|
||||
get32_12_1200: sample = (u_int32_t)as_u16(src) << 16; goto GET32_END;
|
||||
get32_12_9200: sample = (u_int32_t)(as_u16(src) ^ 0x8000) << 16; goto GET32_END;
|
||||
get32_12_2100: sample = (u_int32_t)bswap_16(as_u16(src)) << 16; goto GET32_END;
|
||||
get32_12_A100: sample = (u_int32_t)bswap_16(as_u16(src) ^ 0x80) << 16; goto GET32_END;
|
||||
get32_0123_1230: sample = as_u32(src) << 8; goto GET32_END;
|
||||
get32_0123_9230: sample = (as_u32(src) << 8) ^ 0x80000000; goto GET32_END;
|
||||
get32_1230_3210: sample = bswap_32(as_u32(src) >> 8); goto GET32_END;
|
||||
get32_1230_B210: sample = bswap_32((as_u32(src) >> 8) ^ 0x80); goto GET32_END;
|
||||
get32_1234_1234: sample = as_u32(src); goto GET32_END;
|
||||
get32_1234_9234: sample = as_u32(src) ^ 0x80000000; goto GET32_END;
|
||||
get32_1234_4321: sample = bswap_32(as_u32(src)); goto GET32_END;
|
||||
get32_1234_C321: sample = bswap_32(as_u32(src) ^ 0x80); goto GET32_END;
|
||||
get32_1_1000: sample = (u_int32_t)as_u8c(src) << 24; goto GET32_END;
|
||||
get32_1_9000: sample = (u_int32_t)(as_u8c(src) ^ 0x80) << 24; goto GET32_END;
|
||||
get32_12_1200: sample = (u_int32_t)as_u16c(src) << 16; goto GET32_END;
|
||||
get32_12_9200: sample = (u_int32_t)(as_u16c(src) ^ 0x8000) << 16; goto GET32_END;
|
||||
get32_12_2100: sample = (u_int32_t)bswap_16(as_u16c(src)) << 16; goto GET32_END;
|
||||
get32_12_A100: sample = (u_int32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; goto GET32_END;
|
||||
get32_0123_1230: sample = as_u32c(src) << 8; goto GET32_END;
|
||||
get32_0123_9230: sample = (as_u32c(src) << 8) ^ 0x80000000; goto GET32_END;
|
||||
get32_1230_3210: sample = bswap_32(as_u32c(src) >> 8); goto GET32_END;
|
||||
get32_1230_B210: sample = bswap_32((as_u32c(src) >> 8) ^ 0x80); goto GET32_END;
|
||||
get32_1234_1234: sample = as_u32c(src); goto GET32_END;
|
||||
get32_1234_9234: sample = as_u32c(src) ^ 0x80000000; goto GET32_END;
|
||||
get32_1234_4321: sample = bswap_32(as_u32c(src)); goto GET32_END;
|
||||
get32_1234_C321: sample = bswap_32(as_u32c(src) ^ 0x80); goto GET32_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -468,20 +477,20 @@ static void *getu_labels[4 * 2 * 2] = {
|
|||
|
||||
#ifdef GETU_END
|
||||
while (0) {
|
||||
getu_1_1: sample = as_u8(src); goto GETU_END;
|
||||
getu_1_9: sample = as_u8(src) ^ 0x80; goto GETU_END;
|
||||
getu_12_12: sample = as_u16(src); goto GETU_END;
|
||||
getu_12_92: sample = as_u16(src) ^ 0x8000; goto GETU_END;
|
||||
getu_12_21: sample = bswap_16(as_u16(src)); goto GETU_END;
|
||||
getu_12_A1: sample = bswap_16(as_u16(src) ^ 0x80); goto GETU_END;
|
||||
getu_0123_0123: sample = as_u32(src); goto GETU_END;
|
||||
getu_0123_0923: sample = (as_u32(src) ^ 0x800000); goto GETU_END;
|
||||
getu_1230_0321: sample = bswap_32(as_u32(src)); goto GETU_END;
|
||||
getu_1230_0B21: sample = bswap_32(as_u32(src) ^ 0x8000); goto GETU_END;
|
||||
getu_1234_1234: sample = as_u32(src); goto GETU_END;
|
||||
getu_1234_9234: sample = as_u32(src) ^ 0x80000000; goto GETU_END;
|
||||
getu_1234_4321: sample = bswap_32(as_u32(src)); goto GETU_END;
|
||||
getu_1234_C321: sample = bswap_32(as_u32(src) ^ 0x80); goto GETU_END;
|
||||
getu_1_1: sample = as_u8c(src); goto GETU_END;
|
||||
getu_1_9: sample = as_u8c(src) ^ 0x80; goto GETU_END;
|
||||
getu_12_12: sample = as_u16c(src); goto GETU_END;
|
||||
getu_12_92: sample = as_u16c(src) ^ 0x8000; goto GETU_END;
|
||||
getu_12_21: sample = bswap_16(as_u16c(src)); goto GETU_END;
|
||||
getu_12_A1: sample = bswap_16(as_u16c(src) ^ 0x80); goto GETU_END;
|
||||
getu_0123_0123: sample = as_u32c(src); goto GETU_END;
|
||||
getu_0123_0923: sample = (as_u32c(src) ^ 0x800000); goto GETU_END;
|
||||
getu_1230_0321: sample = bswap_32(as_u32c(src)); goto GETU_END;
|
||||
getu_1230_0B21: sample = bswap_32(as_u32c(src) ^ 0x8000); goto GETU_END;
|
||||
getu_1234_1234: sample = as_u32c(src); goto GETU_END;
|
||||
getu_1234_9234: sample = as_u32c(src) ^ 0x80000000; goto GETU_END;
|
||||
getu_1234_4321: sample = bswap_32(as_u32c(src)); goto GETU_END;
|
||||
getu_1234_C321: sample = bswap_32(as_u32c(src) ^ 0x80); goto GETU_END;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue