output/pipe: add static method Create()
This commit is contained in:
parent
0e28b53242
commit
5c0bc612fe
|
@ -39,6 +39,8 @@ struct PipeOutput {
|
||||||
|
|
||||||
bool Configure(const config_param ¶m, Error &error);
|
bool Configure(const config_param ¶m, Error &error);
|
||||||
|
|
||||||
|
static AudioOutput *Create(const config_param ¶m, Error &error);
|
||||||
|
|
||||||
bool Open(AudioFormat &audio_format, Error &error);
|
bool Open(AudioFormat &audio_format, Error &error);
|
||||||
|
|
||||||
void Close() {
|
void Close() {
|
||||||
|
@ -67,17 +69,23 @@ PipeOutput::Configure(const config_param ¶m, Error &error)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static AudioOutput *
|
inline AudioOutput *
|
||||||
pipe_output_init(const config_param ¶m, Error &error)
|
PipeOutput::Create(const config_param ¶m, Error &error)
|
||||||
{
|
{
|
||||||
PipeOutput *pd = new PipeOutput();
|
PipeOutput *po = new PipeOutput();
|
||||||
|
|
||||||
if (!pd->Configure(param, error)) {
|
if (!po->Configure(param, error)) {
|
||||||
delete pd;
|
delete po;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &pd->base;
|
return &po->base;
|
||||||
|
}
|
||||||
|
|
||||||
|
static AudioOutput *
|
||||||
|
pipe_output_init(const config_param ¶m, Error &error)
|
||||||
|
{
|
||||||
|
return PipeOutput::Create(param, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue