Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15965
b: refs/heads/master
c: 6ac77bc
h: refs/heads/master
i:
  15963: 5d72047
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 3f9137e commit f919e57
Show file tree
Hide file tree
Showing 11 changed files with 544 additions and 534 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f956b4a3ae790e1bdde865ac42dd1b99b64a6256
refs/heads/master: 6ac77bc180fbd985988015020c2e2347e802959d
41 changes: 19 additions & 22 deletions trunk/include/sound/pcm_oss.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
*
*/

typedef struct _snd_pcm_plugin snd_pcm_plugin_t;
typedef struct _snd_pcm_oss_setup snd_pcm_oss_setup_t;

struct _snd_pcm_oss_setup {
struct snd_pcm_oss_setup {
char *task_name;
unsigned int disable:1,
direct:1,
Expand All @@ -36,10 +33,10 @@ struct _snd_pcm_oss_setup {
buggyptr:1;
unsigned int periods;
unsigned int period_size;
snd_pcm_oss_setup_t *next;
struct snd_pcm_oss_setup *next;
};

typedef struct _snd_pcm_oss_runtime {
struct snd_pcm_oss_runtime {
unsigned params: 1, /* format/parameter change */
prepare: 1, /* need to prepare the operation */
trigger: 1, /* trigger flag */
Expand All @@ -59,30 +56,30 @@ typedef struct _snd_pcm_oss_runtime {
size_t mmap_bytes;
char *buffer; /* vmallocated period */
size_t buffer_used; /* used length from period buffer */
snd_pcm_plugin_t *plugin_first;
snd_pcm_plugin_t *plugin_last;
struct snd_pcm_plugin *plugin_first;
struct snd_pcm_plugin *plugin_last;
unsigned int prev_hw_ptr_interrupt;
} snd_pcm_oss_runtime_t;
};

typedef struct _snd_pcm_oss_file {
snd_pcm_substream_t *streams[2];
} snd_pcm_oss_file_t;
struct snd_pcm_oss_file {
struct snd_pcm_substream *streams[2];
};

typedef struct _snd_pcm_oss_substream {
struct snd_pcm_oss_substream {
unsigned oss: 1; /* oss mode */
snd_pcm_oss_setup_t *setup; /* active setup */
snd_pcm_oss_file_t *file;
} snd_pcm_oss_substream_t;
struct snd_pcm_oss_setup *setup; /* active setup */
struct snd_pcm_oss_file *file;
};

typedef struct _snd_pcm_oss_stream {
snd_pcm_oss_setup_t *setup_list; /* setup list */
struct snd_pcm_oss_stream {
struct snd_pcm_oss_setup *setup_list; /* setup list */
struct semaphore setup_mutex;
snd_info_entry_t *proc_entry;
} snd_pcm_oss_stream_t;
struct snd_info_entry *proc_entry;
};

typedef struct _snd_pcm_oss {
struct snd_pcm_oss {
int reg;
unsigned int reg_mask;
} snd_pcm_oss_t;
};

#endif /* __SOUND_PCM_OSS_H */
16 changes: 8 additions & 8 deletions trunk/sound/core/oss/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <sound/pcm.h>
#include "pcm_plugin.h"

static snd_pcm_sframes_t copy_transfer(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static snd_pcm_sframes_t copy_transfer(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
unsigned int channel;
Expand Down Expand Up @@ -58,13 +58,13 @@ static snd_pcm_sframes_t copy_transfer(snd_pcm_plugin_t *plugin,
return frames;
}

int snd_pcm_plugin_build_copy(snd_pcm_plug_t *plug,
snd_pcm_plugin_format_t *src_format,
snd_pcm_plugin_format_t *dst_format,
snd_pcm_plugin_t **r_plugin)
int snd_pcm_plugin_build_copy(struct snd_pcm_substream *plug,
struct snd_pcm_plugin_format *src_format,
struct snd_pcm_plugin_format *dst_format,
struct snd_pcm_plugin **r_plugin)
{
int err;
snd_pcm_plugin_t *plugin;
struct snd_pcm_plugin *plugin;
int width;

snd_assert(r_plugin != NULL, return -ENXIO);
Expand Down
28 changes: 14 additions & 14 deletions trunk/sound/core/oss/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* Basic io plugin
*/

static snd_pcm_sframes_t io_playback_transfer(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static snd_pcm_sframes_t io_playback_transfer(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
snd_assert(plugin != NULL, return -ENXIO);
Expand All @@ -58,9 +58,9 @@ static snd_pcm_sframes_t io_playback_transfer(snd_pcm_plugin_t *plugin,
}
}

static snd_pcm_sframes_t io_capture_transfer(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static snd_pcm_sframes_t io_capture_transfer(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
snd_assert(plugin != NULL, return -ENXIO);
Expand All @@ -82,13 +82,13 @@ static snd_pcm_sframes_t io_capture_transfer(snd_pcm_plugin_t *plugin,
return 0;
}

static snd_pcm_sframes_t io_src_channels(snd_pcm_plugin_t *plugin,
static snd_pcm_sframes_t io_src_channels(struct snd_pcm_plugin *plugin,
snd_pcm_uframes_t frames,
snd_pcm_plugin_channel_t **channels)
struct snd_pcm_plugin_channel **channels)
{
int err;
unsigned int channel;
snd_pcm_plugin_channel_t *v;
struct snd_pcm_plugin_channel *v;
err = snd_pcm_plugin_client_channels(plugin, frames, &v);
if (err < 0)
return err;
Expand All @@ -100,13 +100,13 @@ static snd_pcm_sframes_t io_src_channels(snd_pcm_plugin_t *plugin,
return frames;
}

int snd_pcm_plugin_build_io(snd_pcm_plug_t *plug,
snd_pcm_hw_params_t *params,
snd_pcm_plugin_t **r_plugin)
int snd_pcm_plugin_build_io(struct snd_pcm_substream *plug,
struct snd_pcm_hw_params *params,
struct snd_pcm_plugin **r_plugin)
{
int err;
snd_pcm_plugin_format_t format;
snd_pcm_plugin_t *plugin;
struct snd_pcm_plugin_format format;
struct snd_pcm_plugin *plugin;

snd_assert(r_plugin != NULL, return -ENXIO);
*r_plugin = NULL;
Expand Down
38 changes: 19 additions & 19 deletions trunk/sound/core/oss/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
* Basic linear conversion plugin
*/

typedef struct linear_private_data {
struct linear_priv {
int conv;
} linear_t;
};

static void convert(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static void convert(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define CONV_LABELS
#include "plugin_ops.h"
#undef CONV_LABELS
linear_t *data = (linear_t *)plugin->extra_data;
struct linear_priv *data = (struct linear_priv *)plugin->extra_data;
void *conv = conv_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
Expand Down Expand Up @@ -75,15 +75,15 @@ static void convert(snd_pcm_plugin_t *plugin,
}
}

static snd_pcm_sframes_t linear_transfer(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
linear_t *data;
struct linear_priv *data;

snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO);
data = (linear_t *)plugin->extra_data;
data = (struct linear_priv *)plugin->extra_data;
if (frames == 0)
return 0;
#ifdef CONFIG_SND_DEBUG
Expand Down Expand Up @@ -128,14 +128,14 @@ int conv_index(int src_format, int dst_format)
return src_width * 32 + src_endian * 16 + sign * 8 + dst_width * 2 + dst_endian;
}

int snd_pcm_plugin_build_linear(snd_pcm_plug_t *plug,
snd_pcm_plugin_format_t *src_format,
snd_pcm_plugin_format_t *dst_format,
snd_pcm_plugin_t **r_plugin)
int snd_pcm_plugin_build_linear(struct snd_pcm_substream *plug,
struct snd_pcm_plugin_format *src_format,
struct snd_pcm_plugin_format *dst_format,
struct snd_pcm_plugin **r_plugin)
{
int err;
struct linear_private_data *data;
snd_pcm_plugin_t *plugin;
struct linear_priv *data;
struct snd_pcm_plugin *plugin;

snd_assert(r_plugin != NULL, return -ENXIO);
*r_plugin = NULL;
Expand All @@ -147,10 +147,10 @@ int snd_pcm_plugin_build_linear(snd_pcm_plug_t *plug,

err = snd_pcm_plugin_build(plug, "linear format conversion",
src_format, dst_format,
sizeof(linear_t), &plugin);
sizeof(struct linear_priv), &plugin);
if (err < 0)
return err;
data = (linear_t *)plugin->extra_data;
data = (struct linear_priv *)plugin->extra_data;
data->conv = conv_index(src_format->format, dst_format->format);
plugin->transfer = linear_transfer;
*r_plugin = plugin;
Expand Down
54 changes: 27 additions & 27 deletions trunk/sound/core/oss/mulaw.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,25 @@ static int ulaw2linear(unsigned char u_val)
* Basic Mu-Law plugin
*/

typedef void (*mulaw_f)(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
typedef void (*mulaw_f)(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames);

typedef struct mulaw_private_data {
struct mulaw_priv {
mulaw_f func;
int conv;
} mulaw_t;
};

static void mulaw_decode(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static void mulaw_decode(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define PUT_S16_LABELS
#include "plugin_ops.h"
#undef PUT_S16_LABELS
mulaw_t *data = (mulaw_t *)plugin->extra_data;
struct mulaw_priv *data = (struct mulaw_priv *)plugin->extra_data;
void *put = put_s16_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
Expand Down Expand Up @@ -191,15 +191,15 @@ static void mulaw_decode(snd_pcm_plugin_t *plugin,
}
}

static void mulaw_encode(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static void mulaw_encode(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
#define GET_S16_LABELS
#include "plugin_ops.h"
#undef GET_S16_LABELS
mulaw_t *data = (mulaw_t *)plugin->extra_data;
struct mulaw_priv *data = (struct mulaw_priv *)plugin->extra_data;
void *get = get_s16_labels[data->conv];
int channel;
int nchannels = plugin->src_format.channels;
Expand Down Expand Up @@ -234,12 +234,12 @@ static void mulaw_encode(snd_pcm_plugin_t *plugin,
}
}

static snd_pcm_sframes_t mulaw_transfer(snd_pcm_plugin_t *plugin,
const snd_pcm_plugin_channel_t *src_channels,
snd_pcm_plugin_channel_t *dst_channels,
static snd_pcm_sframes_t mulaw_transfer(struct snd_pcm_plugin *plugin,
const struct snd_pcm_plugin_channel *src_channels,
struct snd_pcm_plugin_channel *dst_channels,
snd_pcm_uframes_t frames)
{
mulaw_t *data;
struct mulaw_priv *data;

snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO);
if (frames == 0)
Expand All @@ -257,20 +257,20 @@ static snd_pcm_sframes_t mulaw_transfer(snd_pcm_plugin_t *plugin,
}
}
#endif
data = (mulaw_t *)plugin->extra_data;
data = (struct mulaw_priv *)plugin->extra_data;
data->func(plugin, src_channels, dst_channels, frames);
return frames;
}

int snd_pcm_plugin_build_mulaw(snd_pcm_plug_t *plug,
snd_pcm_plugin_format_t *src_format,
snd_pcm_plugin_format_t *dst_format,
snd_pcm_plugin_t **r_plugin)
int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug,
struct snd_pcm_plugin_format *src_format,
struct snd_pcm_plugin_format *dst_format,
struct snd_pcm_plugin **r_plugin)
{
int err;
mulaw_t *data;
snd_pcm_plugin_t *plugin;
snd_pcm_plugin_format_t *format;
struct mulaw_priv *data;
struct snd_pcm_plugin *plugin;
struct snd_pcm_plugin_format *format;
mulaw_f func;

snd_assert(r_plugin != NULL, return -ENXIO);
Expand All @@ -295,10 +295,10 @@ int snd_pcm_plugin_build_mulaw(snd_pcm_plug_t *plug,

err = snd_pcm_plugin_build(plug, "Mu-Law<->linear conversion",
src_format, dst_format,
sizeof(mulaw_t), &plugin);
sizeof(struct mulaw_priv), &plugin);
if (err < 0)
return err;
data = (mulaw_t*)plugin->extra_data;
data = (struct mulaw_priv *)plugin->extra_data;
data->func = func;
data->conv = getput_index(format->format);
snd_assert(data->conv >= 0 && data->conv < 4*2*2, return -EINVAL);
Expand Down
Loading

0 comments on commit f919e57

Please sign in to comment.