Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bed2a49f
Commit
bed2a49f
authored
Sep 07, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: added output_api.h
Just like decoder_api.h, output_api.h provides the audio output API which is used by the plugins.
parent
dc7c6bd1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
115 additions
and
90 deletions
+115
-90
Makefile.am
src/Makefile.am
+1
-0
audio.c
src/audio.c
+1
-0
audioOutput.c
src/audioOutput.c
+1
-0
audioOutput.h
src/audioOutput.h
+3
-64
audioOutput_alsa.c
src/audioOutputs/audioOutput_alsa.c
+2
-3
audioOutput_ao.c
src/audioOutputs/audioOutput_ao.c
+2
-3
audioOutput_fifo.c
src/audioOutputs/audioOutput_fifo.c
+1
-3
audioOutput_jack.c
src/audioOutputs/audioOutput_jack.c
+2
-3
audioOutput_mvp.c
src/audioOutputs/audioOutput_mvp.c
+2
-3
audioOutput_null.c
src/audioOutputs/audioOutput_null.c
+1
-1
audioOutput_oss.c
src/audioOutputs/audioOutput_oss.c
+2
-3
audioOutput_osx.c
src/audioOutputs/audioOutput_osx.c
+2
-1
audioOutput_pulse.c
src/audioOutputs/audioOutput_pulse.c
+2
-3
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+2
-3
output_api.h
src/output_api.h
+91
-0
No files found.
src/Makefile.am
View file @
bed2a49f
...
...
@@ -33,6 +33,7 @@ mpd_headers = \
ack.h
\
audio.h
\
audioOutput.h
\
output_api.h
\
buffer2array.h
\
charConv.h
\
command.h
\
...
...
src/audio.c
View file @
bed2a49f
...
...
@@ -22,6 +22,7 @@
#include "log.h"
#include "path.h"
#include "client.h"
#include "utils.h"
#include "os_compat.h"
#define AUDIO_DEVICE_STATE "audio_device_state:"
...
...
src/audioOutput.c
View file @
bed2a49f
...
...
@@ -21,6 +21,7 @@
#include "list.h"
#include "log.h"
#include "pcm_utils.h"
#include "utils.h"
#include "os_compat.h"
#include "audio.h"
...
...
src/audioOutput.h
View file @
bed2a49f
...
...
@@ -19,75 +19,14 @@
#ifndef AUDIO_OUTPUT_H
#define AUDIO_OUTPUT_H
#include "output_api.h"
#include "../config.h"
#include "pcm_utils.h"
#include "mpd_types.h"
#include "audio_format.h"
#include "tag.h"
#include "conf.h"
#include "utils.h"
#include "os_compat.h"
#define DISABLED_AUDIO_OUTPUT_PLUGIN(plugin) AudioOutputPlugin plugin;
typedef
struct
_AudioOutput
AudioOutput
;
typedef
int
(
*
AudioOutputTestDefaultDeviceFunc
)
(
void
);
typedef
int
(
*
AudioOutputInitDriverFunc
)
(
AudioOutput
*
audioOutput
,
ConfigParam
*
param
);
typedef
void
(
*
AudioOutputFinishDriverFunc
)
(
AudioOutput
*
audioOutput
);
typedef
int
(
*
AudioOutputOpenDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
int
(
*
AudioOutputPlayFunc
)
(
AudioOutput
*
audioOutput
,
const
char
*
playChunk
,
size_t
size
);
typedef
void
(
*
AudioOutputDropBufferedAudioFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputCloseDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputSendMetadataFunc
)
(
AudioOutput
*
audioOutput
,
const
struct
tag
*
tag
);
struct
_AudioOutput
{
int
open
;
const
char
*
name
;
const
char
*
type
;
AudioOutputFinishDriverFunc
finishDriverFunc
;
AudioOutputOpenDeviceFunc
openDeviceFunc
;
AudioOutputPlayFunc
playFunc
;
AudioOutputDropBufferedAudioFunc
dropBufferedAudioFunc
;
AudioOutputCloseDeviceFunc
closeDeviceFunc
;
AudioOutputSendMetadataFunc
sendMetdataFunc
;
int
convertAudioFormat
;
struct
audio_format
inAudioFormat
;
struct
audio_format
outAudioFormat
;
struct
audio_format
reqAudioFormat
;
ConvState
convState
;
char
*
convBuffer
;
size_t
convBufferLen
;
int
sameInAndOutFormats
;
void
*
data
;
};
typedef
struct
_AudioOutputPlugin
{
const
char
*
name
;
AudioOutputTestDefaultDeviceFunc
testDefaultDeviceFunc
;
AudioOutputInitDriverFunc
initDriverFunc
;
AudioOutputFinishDriverFunc
finishDriverFunc
;
AudioOutputOpenDeviceFunc
openDeviceFunc
;
AudioOutputPlayFunc
playFunc
;
AudioOutputDropBufferedAudioFunc
dropBufferedAudioFunc
;
AudioOutputCloseDeviceFunc
closeDeviceFunc
;
AudioOutputSendMetadataFunc
sendMetdataFunc
;
}
AudioOutputPlugin
;
struct
audio_format
;
struct
tag
;
void
initAudioOutputPlugins
(
void
);
void
finishAudioOutputPlugins
(
void
);
...
...
src/audioOutputs/audioOutput_alsa.c
View file @
bed2a49f
...
...
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_ALSA
...
...
@@ -30,9 +30,8 @@
#define MPD_ALSA_PERIOD_TIME_US 50000
#define MPD_ALSA_RETRY_NR 5
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
#include "../os_compat.h"
#include <alsa/asoundlib.h>
...
...
src/audioOutputs/audioOutput_ao.c
View file @
bed2a49f
...
...
@@ -16,13 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_AO
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
#include "../os_compat.h"
#include <ao/ao.h>
...
...
src/audioOutputs/audioOutput_fifo.c
View file @
bed2a49f
...
...
@@ -16,13 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../audioOutput.h"
#include "../os_compat.h"
#include "../output_api.h"
#ifdef HAVE_FIFO
#include "../log.h"
#include "../conf.h"
#include "../utils.h"
#include "../timer.h"
...
...
src/audioOutputs/audioOutput_jack.c
View file @
bed2a49f
...
...
@@ -15,12 +15,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_JACK
#include "../os_compat.h"
#include "../conf.h"
#include "../utils.h"
#include "../log.h"
#include <jack/jack.h>
...
...
src/audioOutputs/audioOutput_mvp.c
View file @
bed2a49f
...
...
@@ -19,12 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../audioOutput.h"
#include "../os_compat.h"
#include "../output_api.h"
#ifdef HAVE_MVP
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
typedef
struct
{
...
...
src/audioOutputs/audioOutput_null.c
View file @
bed2a49f
...
...
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#include "../timer.h"
static
int
null_initDriver
(
AudioOutput
*
audioOutput
,
...
...
src/audioOutputs/audioOutput_oss.c
View file @
bed2a49f
...
...
@@ -19,12 +19,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../audioOutput.h"
#include "../os_compat.h"
#include "../output_api.h"
#ifdef HAVE_OSS
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
#if defined(__OpenBSD__) || defined(__NetBSD__)
...
...
src/audioOutputs/audioOutput_osx.c
View file @
bed2a49f
...
...
@@ -16,12 +16,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_OSX
#include <AudioUnit/AudioUnit.h>
#include "../utils.h"
#include "../log.h"
typedef
struct
_OsxData
{
...
...
src/audioOutputs/audioOutput_pulse.c
View file @
bed2a49f
...
...
@@ -16,13 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_PULSE
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
#include "../os_compat.h"
#include <pulse/simple.h>
#include <pulse/error.h>
...
...
src/audioOutputs/audioOutput_shout.c
View file @
bed2a49f
...
...
@@ -16,13 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../
audioOutput
.h"
#include "../
output_api
.h"
#ifdef HAVE_SHOUT
#include "../
conf
.h"
#include "../
utils
.h"
#include "../log.h"
#include "../pcm_utils.h"
#include "../timer.h"
#include <shout/shout.h>
...
...
src/output_api.h
0 → 100644
View file @
bed2a49f
/* the Music Player Daemon (MPD)
* Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
* Copyright (C) 2008 Max Kellermann <max@duempel.org>
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OUTPUT_API_H
#define OUTPUT_API_H
#include "../config.h"
#include "pcm_utils.h"
#include "audio_format.h"
#include "tag.h"
#include "conf.h"
#include "log.h"
#include "os_compat.h"
#define DISABLED_AUDIO_OUTPUT_PLUGIN(plugin) AudioOutputPlugin plugin;
typedef
struct
_AudioOutput
AudioOutput
;
typedef
int
(
*
AudioOutputTestDefaultDeviceFunc
)
(
void
);
typedef
int
(
*
AudioOutputInitDriverFunc
)
(
AudioOutput
*
audioOutput
,
ConfigParam
*
param
);
typedef
void
(
*
AudioOutputFinishDriverFunc
)
(
AudioOutput
*
audioOutput
);
typedef
int
(
*
AudioOutputOpenDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
int
(
*
AudioOutputPlayFunc
)
(
AudioOutput
*
audioOutput
,
const
char
*
playChunk
,
size_t
size
);
typedef
void
(
*
AudioOutputDropBufferedAudioFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputCloseDeviceFunc
)
(
AudioOutput
*
audioOutput
);
typedef
void
(
*
AudioOutputSendMetadataFunc
)
(
AudioOutput
*
audioOutput
,
const
struct
tag
*
tag
);
typedef
struct
_AudioOutputPlugin
{
const
char
*
name
;
AudioOutputTestDefaultDeviceFunc
testDefaultDeviceFunc
;
AudioOutputInitDriverFunc
initDriverFunc
;
AudioOutputFinishDriverFunc
finishDriverFunc
;
AudioOutputOpenDeviceFunc
openDeviceFunc
;
AudioOutputPlayFunc
playFunc
;
AudioOutputDropBufferedAudioFunc
dropBufferedAudioFunc
;
AudioOutputCloseDeviceFunc
closeDeviceFunc
;
AudioOutputSendMetadataFunc
sendMetdataFunc
;
}
AudioOutputPlugin
;
struct
_AudioOutput
{
int
open
;
const
char
*
name
;
const
char
*
type
;
AudioOutputFinishDriverFunc
finishDriverFunc
;
AudioOutputOpenDeviceFunc
openDeviceFunc
;
AudioOutputPlayFunc
playFunc
;
AudioOutputDropBufferedAudioFunc
dropBufferedAudioFunc
;
AudioOutputCloseDeviceFunc
closeDeviceFunc
;
AudioOutputSendMetadataFunc
sendMetdataFunc
;
int
convertAudioFormat
;
struct
audio_format
inAudioFormat
;
struct
audio_format
outAudioFormat
;
struct
audio_format
reqAudioFormat
;
ConvState
convState
;
char
*
convBuffer
;
size_t
convBufferLen
;
int
sameInAndOutFormats
;
void
*
data
;
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment