output_plugin: don't pass audio_output object to method init()
audio_output_get_name() has been removed, which was the only function left in output_api.h. The output plugin doesn't need the audio_output object at all, remove the parameter from the init() method.
This commit is contained in:
parent
0cf4f09e4f
commit
dcd84c19cd
@ -129,8 +129,7 @@ alsa_configure(struct alsa_data *ad, const struct config_param *param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
alsa_init(G_GNUC_UNUSED struct audio_output *ao,
|
alsa_init(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
/* no need for pthread_once thread-safety when reading config */
|
/* no need for pthread_once thread-safety when reading config */
|
||||||
|
@ -75,8 +75,7 @@ static void audioOutputAo_error(const char *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
audioOutputAo_initDriver(G_GNUC_UNUSED struct audio_output *ao,
|
audioOutputAo_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
ao_info *ai;
|
ao_info *ai;
|
||||||
|
@ -159,8 +159,8 @@ static bool openFifo(FifoData *fd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *fifo_initDriver(G_GNUC_UNUSED struct audio_output *ao,
|
static void *
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
fifo_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
FifoData *fd;
|
FifoData *fd;
|
||||||
|
@ -157,8 +157,7 @@ mpd_jack_info(const char *msg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
mpd_jack_init(G_GNUC_UNUSED struct audio_output *ao,
|
mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
struct jack_data *jd;
|
struct jack_data *jd;
|
||||||
|
@ -70,7 +70,6 @@ typedef struct {
|
|||||||
#define MVP_GET_AUD_REGS _IOW('a',28,aud_ctl_regs_t*)
|
#define MVP_GET_AUD_REGS _IOW('a',28,aud_ctl_regs_t*)
|
||||||
|
|
||||||
typedef struct _MvpData {
|
typedef struct _MvpData {
|
||||||
struct audio_output *audio_output;
|
|
||||||
struct audio_format audio_format;
|
struct audio_format audio_format;
|
||||||
int fd;
|
int fd;
|
||||||
} MvpData;
|
} MvpData;
|
||||||
@ -110,12 +109,11 @@ static bool mvp_testDefault(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *mvp_initDriver(G_GNUC_UNUSED struct audio_output *audio_output,
|
static void *
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
mvp_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct config_param *param)
|
G_GNUC_UNUSED const struct config_param *param)
|
||||||
{
|
{
|
||||||
MvpData *md = g_new(MvpData, 1);
|
MvpData *md = g_new(MvpData, 1);
|
||||||
md->audio_output = audio_output;
|
|
||||||
md->fd = -1;
|
md->fd = -1;
|
||||||
|
|
||||||
return md;
|
return md;
|
||||||
|
@ -30,8 +30,7 @@ struct null_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
null_init(G_GNUC_UNUSED struct audio_output *audio_output,
|
null_init(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
G_GNUC_UNUSED const struct config_param *param)
|
G_GNUC_UNUSED const struct config_param *param)
|
||||||
{
|
{
|
||||||
struct null_data *nd = g_new(struct null_data, 1);
|
struct null_data *nd = g_new(struct null_data, 1);
|
||||||
|
@ -388,8 +388,7 @@ static void *oss_open_default(const struct config_param *param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
oss_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
|
oss_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
const char *device = config_get_block_string(param, "device", NULL);
|
const char *device = config_get_block_string(param, "device", NULL);
|
||||||
|
@ -80,8 +80,7 @@ static bool osx_testDefault(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
osx_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
|
osx_initDriver(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
G_GNUC_UNUSED const struct config_param *param)
|
G_GNUC_UNUSED const struct config_param *param)
|
||||||
{
|
{
|
||||||
return newOsxData();
|
return newOsxData();
|
||||||
|
@ -53,8 +53,7 @@ static void pulse_free_data(struct pulse_data *pd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
pulse_init(G_GNUC_UNUSED struct audio_output *ao,
|
pulse_init(G_GNUC_UNUSED const struct audio_format *audio_format,
|
||||||
G_GNUC_UNUSED const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
struct pulse_data *pd;
|
struct pulse_data *pd;
|
||||||
|
@ -38,8 +38,6 @@ struct shout_buffer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct shout_data {
|
struct shout_data {
|
||||||
struct audio_output *audio_output;
|
|
||||||
|
|
||||||
shout_t *shout_conn;
|
shout_t *shout_conn;
|
||||||
shout_metadata_t *shout_meta;
|
shout_metadata_t *shout_meta;
|
||||||
|
|
||||||
@ -97,8 +95,8 @@ static void free_shout_data(struct shout_data *sd)
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *my_shout_init_driver(struct audio_output *audio_output,
|
static void *
|
||||||
const struct audio_format *audio_format,
|
my_shout_init_driver(const struct audio_format *audio_format,
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
struct shout_data *sd;
|
struct shout_data *sd;
|
||||||
@ -119,7 +117,6 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
|
|||||||
int public;
|
int public;
|
||||||
|
|
||||||
sd = new_shout_data();
|
sd = new_shout_data();
|
||||||
sd->audio_output = audio_output;
|
|
||||||
|
|
||||||
if (shout_init_count == 0)
|
if (shout_init_count == 0)
|
||||||
shout_init();
|
shout_init();
|
||||||
|
@ -109,7 +109,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param)
|
|||||||
notify_init(&ao->notify);
|
notify_init(&ao->notify);
|
||||||
ao->command = AO_COMMAND_NONE;
|
ao->command = AO_COMMAND_NONE;
|
||||||
|
|
||||||
ao->data = ao_plugin_init(plugin, ao,
|
ao->data = ao_plugin_init(plugin,
|
||||||
format ? &ao->config_audio_format : NULL,
|
format ? &ao->config_audio_format : NULL,
|
||||||
param);
|
param);
|
||||||
if (ao->data == NULL)
|
if (ao->data == NULL)
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
struct audio_output;
|
|
||||||
struct config_param;
|
struct config_param;
|
||||||
struct audio_format;
|
struct audio_format;
|
||||||
struct tag;
|
struct tag;
|
||||||
@ -54,8 +53,7 @@ struct audio_output_plugin {
|
|||||||
* @return NULL on error, or an opaque pointer to the plugin's
|
* @return NULL on error, or an opaque pointer to the plugin's
|
||||||
* data
|
* data
|
||||||
*/
|
*/
|
||||||
void *(*init)(struct audio_output *ao,
|
void *(*init)(const struct audio_format *audio_format,
|
||||||
const struct audio_format *audio_format,
|
|
||||||
const struct config_param *param);
|
const struct config_param *param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,11 +125,10 @@ ao_plugin_test_default_device(const struct audio_output_plugin *plugin)
|
|||||||
|
|
||||||
static inline void *
|
static inline void *
|
||||||
ao_plugin_init(const struct audio_output_plugin *plugin,
|
ao_plugin_init(const struct audio_output_plugin *plugin,
|
||||||
struct audio_output *ao,
|
|
||||||
const struct audio_format *audio_format,
|
const struct audio_format *audio_format,
|
||||||
const struct config_param *param)
|
const struct config_param *param)
|
||||||
{
|
{
|
||||||
return plugin->init(ao, audio_format, param);
|
return plugin->init(audio_format, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
Loading…
Reference in New Issue
Block a user