output: renamed method names
No CamelCase. Also don't declare typedefs for the methods.
This commit is contained in:
parent
40a9961bcd
commit
755d55075d
@ -67,10 +67,10 @@ int initAudioOutput(struct audio_output *ao, ConfigParam * param)
|
|||||||
WARNING("Attempt to detect audio output device\n");
|
WARNING("Attempt to detect audio output device\n");
|
||||||
|
|
||||||
audio_output_plugins_for_each(plugin, i) {
|
audio_output_plugins_for_each(plugin, i) {
|
||||||
if (plugin->testDefaultDeviceFunc) {
|
if (plugin->test_default_device) {
|
||||||
WARNING("Attempting to detect a %s audio "
|
WARNING("Attempting to detect a %s audio "
|
||||||
"device\n", plugin->name);
|
"device\n", plugin->name);
|
||||||
if (plugin->testDefaultDeviceFunc() == 0) {
|
if (plugin->test_default_device() == 0) {
|
||||||
WARNING("Successfully detected a %s "
|
WARNING("Successfully detected a %s "
|
||||||
"audio device\n", plugin->name);
|
"audio device\n", plugin->name);
|
||||||
break;
|
break;
|
||||||
@ -110,7 +110,7 @@ int initAudioOutput(struct audio_output *ao, ConfigParam * param)
|
|||||||
copyAudioFormat(&ao->outAudioFormat, &ao->reqAudioFormat);
|
copyAudioFormat(&ao->outAudioFormat, &ao->reqAudioFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin->initDriverFunc(ao, param) != 0)
|
if (plugin->init(ao, param) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -139,7 +139,7 @@ int openAudioOutput(struct audio_output *audioOutput,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!audioOutput->open)
|
if (!audioOutput->open)
|
||||||
ret = audioOutput->plugin->openDeviceFunc(audioOutput);
|
ret = audioOutput->plugin->open(audioOutput);
|
||||||
|
|
||||||
audioOutput->sameInAndOutFormats =
|
audioOutput->sameInAndOutFormats =
|
||||||
!cmpAudioFormat(&audioOutput->inAudioFormat,
|
!cmpAudioFormat(&audioOutput->inAudioFormat,
|
||||||
@ -183,7 +183,7 @@ int playAudioOutput(struct audio_output *audioOutput,
|
|||||||
convertAudioFormat(audioOutput, &playChunk, &size);
|
convertAudioFormat(audioOutput, &playChunk, &size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = audioOutput->plugin->playFunc(audioOutput, playChunk, size);
|
ret = audioOutput->plugin->play(audioOutput, playChunk, size);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -191,20 +191,20 @@ int playAudioOutput(struct audio_output *audioOutput,
|
|||||||
void dropBufferedAudioOutput(struct audio_output *audioOutput)
|
void dropBufferedAudioOutput(struct audio_output *audioOutput)
|
||||||
{
|
{
|
||||||
if (audioOutput->open)
|
if (audioOutput->open)
|
||||||
audioOutput->plugin->dropBufferedAudioFunc(audioOutput);
|
audioOutput->plugin->cancel(audioOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
void closeAudioOutput(struct audio_output *audioOutput)
|
void closeAudioOutput(struct audio_output *audioOutput)
|
||||||
{
|
{
|
||||||
if (audioOutput->open)
|
if (audioOutput->open)
|
||||||
audioOutput->plugin->closeDeviceFunc(audioOutput);
|
audioOutput->plugin->close(audioOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
void finishAudioOutput(struct audio_output *audioOutput)
|
void finishAudioOutput(struct audio_output *audioOutput)
|
||||||
{
|
{
|
||||||
closeAudioOutput(audioOutput);
|
closeAudioOutput(audioOutput);
|
||||||
if (audioOutput->plugin->finishDriverFunc)
|
if (audioOutput->plugin->finish)
|
||||||
audioOutput->plugin->finishDriverFunc(audioOutput);
|
audioOutput->plugin->finish(audioOutput);
|
||||||
if (audioOutput->convBuffer)
|
if (audioOutput->convBuffer)
|
||||||
free(audioOutput->convBuffer);
|
free(audioOutput->convBuffer);
|
||||||
}
|
}
|
||||||
@ -212,9 +212,8 @@ void finishAudioOutput(struct audio_output *audioOutput)
|
|||||||
void sendMetadataToAudioOutput(struct audio_output *audioOutput,
|
void sendMetadataToAudioOutput(struct audio_output *audioOutput,
|
||||||
const struct tag *tag)
|
const struct tag *tag)
|
||||||
{
|
{
|
||||||
if (!audioOutput->plugin->sendMetdataFunc)
|
if (audioOutput->plugin->send_tag)
|
||||||
return;
|
audioOutput->plugin->send_tag(audioOutput, tag);
|
||||||
audioOutput->plugin->sendMetdataFunc(audioOutput, tag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void printAllOutputPluginTypes(FILE * fp)
|
void printAllOutputPluginTypes(FILE * fp)
|
||||||
|
@ -32,36 +32,26 @@
|
|||||||
|
|
||||||
struct audio_output;
|
struct audio_output;
|
||||||
|
|
||||||
typedef int (*AudioOutputTestDefaultDeviceFunc) (void);
|
|
||||||
|
|
||||||
typedef int (*AudioOutputInitDriverFunc) (struct audio_output *audioOutput,
|
|
||||||
ConfigParam * param);
|
|
||||||
|
|
||||||
typedef void (*AudioOutputFinishDriverFunc) (struct audio_output *audioOutput);
|
|
||||||
|
|
||||||
typedef int (*AudioOutputOpenDeviceFunc) (struct audio_output *audioOutput);
|
|
||||||
|
|
||||||
typedef int (*AudioOutputPlayFunc) (struct audio_output *audioOutput,
|
|
||||||
const char *playChunk, size_t size);
|
|
||||||
|
|
||||||
typedef void (*AudioOutputDropBufferedAudioFunc) (struct audio_output *audioOutput);
|
|
||||||
|
|
||||||
typedef void (*AudioOutputCloseDeviceFunc) (struct audio_output *audioOutput);
|
|
||||||
|
|
||||||
typedef void (*AudioOutputSendMetadataFunc) (struct audio_output *audioOutput,
|
|
||||||
const struct tag *tag);
|
|
||||||
|
|
||||||
struct audio_output_plugin {
|
struct audio_output_plugin {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
AudioOutputTestDefaultDeviceFunc testDefaultDeviceFunc;
|
int (*test_default_device)(void);
|
||||||
AudioOutputInitDriverFunc initDriverFunc;
|
|
||||||
AudioOutputFinishDriverFunc finishDriverFunc;
|
int (*init)(struct audio_output *ao, ConfigParam *param);
|
||||||
AudioOutputOpenDeviceFunc openDeviceFunc;
|
|
||||||
AudioOutputPlayFunc playFunc;
|
void (*finish)(struct audio_output *ao);
|
||||||
AudioOutputDropBufferedAudioFunc dropBufferedAudioFunc;
|
|
||||||
AudioOutputCloseDeviceFunc closeDeviceFunc;
|
int (*open)(struct audio_output *ao);
|
||||||
AudioOutputSendMetadataFunc sendMetdataFunc;
|
|
||||||
|
int (*play)(struct audio_output *ao,
|
||||||
|
const char *playChunk, size_t size);
|
||||||
|
|
||||||
|
void (*cancel)(struct audio_output *ao);
|
||||||
|
|
||||||
|
void (*close)(struct audio_output *ao);
|
||||||
|
|
||||||
|
void (*send_tag)(struct audio_output *audioOutput,
|
||||||
|
const struct tag *tag);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct audio_output {
|
struct audio_output {
|
||||||
|
Loading…
Reference in New Issue
Block a user