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
9574d11d
Commit
9574d11d
authored
Feb 21, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/sles: new output plugin for Android
parent
3d468975
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
291 additions
and
0 deletions
+291
-0
Makefile.am
Makefile.am
+11
-0
Registry.cxx
src/output/Registry.cxx
+4
-0
AndroidSimpleBufferQueue.hxx
src/output/plugins/sles/AndroidSimpleBufferQueue.hxx
+67
-0
Engine.hxx
src/output/plugins/sles/Engine.hxx
+68
-0
Object.hxx
src/output/plugins/sles/Object.hxx
+64
-0
Play.hxx
src/output/plugins/sles/Play.hxx
+52
-0
SlesOutputPlugin.cxx
src/output/plugins/sles/SlesOutputPlugin.cxx
+0
-0
SlesOutputPlugin.hxx
src/output/plugins/sles/SlesOutputPlugin.hxx
+25
-0
No files found.
Makefile.am
View file @
9574d11d
...
...
@@ -1078,6 +1078,17 @@ liboutput_plugins_a_SOURCES += \
libmixer_plugins_a_SOURCES
+=
src/mixer/plugins/AlsaMixerPlugin.cxx
endif
if
ANDROID
liboutput_plugins_a_SOURCES
+=
\
src/output/plugins/sles/Object.hxx
\
src/output/plugins/sles/Engine.hxx
\
src/output/plugins/sles/Play.hxx
\
src/output/plugins/sles/AndroidSimpleBufferQueue.hxx
\
src/output/plugins/sles/SlesOutputPlugin.cxx
\
src/output/plugins/sles/SlesOutputPlugin.hxx
OUTPUT_LIBS
+=
-lOpenSLES
endif
if
HAVE_ROAR
liboutput_plugins_a_SOURCES
+=
\
src/output/plugins/RoarOutputPlugin.cxx
\
...
...
src/output/Registry.cxx
View file @
9574d11d
...
...
@@ -34,6 +34,7 @@
#include "plugins/RecorderOutputPlugin.hxx"
#include "plugins/RoarOutputPlugin.hxx"
#include "plugins/ShoutOutputPlugin.hxx"
#include "plugins/sles/SlesOutputPlugin.hxx"
#include "plugins/SolarisOutputPlugin.hxx"
#include "plugins/WinmmOutputPlugin.hxx"
...
...
@@ -44,6 +45,9 @@ const AudioOutputPlugin *const audio_output_plugins[] = {
&
shout_output_plugin
,
#endif
&
null_output_plugin
,
#ifdef ANDROID
&
sles_output_plugin
,
#endif
#ifdef HAVE_FIFO
&
fifo_output_plugin
,
#endif
...
...
src/output/plugins/sles/AndroidSimpleBufferQueue.hxx
0 → 100644
View file @
9574d11d
/*
* Copyright (C) 2011-2012 Max Kellermann <max@duempel.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SLES_ANDROID_SIMPLE_BUFFER_QUEUE_HPP
#define SLES_ANDROID_SIMPLE_BUFFER_QUEUE_HPP
#include <SLES/OpenSLES_Android.h>
namespace
SLES
{
/**
* OO wrapper for an OpenSL/ES SLAndroidSimpleBufferQueueItf
* variable.
*/
class
AndroidSimpleBufferQueue
{
SLAndroidSimpleBufferQueueItf
queue
;
public
:
AndroidSimpleBufferQueue
()
=
default
;
explicit
AndroidSimpleBufferQueue
(
SLAndroidSimpleBufferQueueItf
_queue
)
:
queue
(
_queue
)
{}
SLresult
Enqueue
(
const
void
*
pBuffer
,
SLuint32
size
)
{
return
(
*
queue
)
->
Enqueue
(
queue
,
pBuffer
,
size
);
}
SLresult
Clear
()
{
return
(
*
queue
)
->
Clear
(
queue
);
}
SLresult
GetState
(
SLAndroidSimpleBufferQueueState
*
pState
)
{
return
(
*
queue
)
->
GetState
(
queue
,
pState
);
}
SLresult
RegisterCallback
(
slAndroidSimpleBufferQueueCallback
callback
,
void
*
pContext
)
{
return
(
*
queue
)
->
RegisterCallback
(
queue
,
callback
,
pContext
);
}
};
}
#endif
src/output/plugins/sles/Engine.hxx
0 → 100644
View file @
9574d11d
/*
* Copyright (C) 2011-2012 Max Kellermann <max@duempel.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SLES_ENGINE_HPP
#define SLES_ENGINE_HPP
#include <SLES/OpenSLES.h>
namespace
SLES
{
/**
* OO wrapper for an OpenSL/ES SLEngineItf variable.
*/
class
Engine
{
SLEngineItf
engine
;
public
:
Engine
()
=
default
;
explicit
Engine
(
SLEngineItf
_engine
)
:
engine
(
_engine
)
{}
SLresult
CreateAudioPlayer
(
SLObjectItf
*
pPlayer
,
SLDataSource
*
pAudioSrc
,
SLDataSink
*
pAudioSnk
,
SLuint32
numInterfaces
,
const
SLInterfaceID
*
pInterfaceIds
,
const
SLboolean
*
pInterfaceRequired
)
{
return
(
*
engine
)
->
CreateAudioPlayer
(
engine
,
pPlayer
,
pAudioSrc
,
pAudioSnk
,
numInterfaces
,
pInterfaceIds
,
pInterfaceRequired
);
}
SLresult
CreateOutputMix
(
SLObjectItf
*
pMix
,
SLuint32
numInterfaces
,
const
SLInterfaceID
*
pInterfaceIds
,
const
SLboolean
*
pInterfaceRequired
)
{
return
(
*
engine
)
->
CreateOutputMix
(
engine
,
pMix
,
numInterfaces
,
pInterfaceIds
,
pInterfaceRequired
);
}
};
}
#endif
src/output/plugins/sles/Object.hxx
0 → 100644
View file @
9574d11d
/*
* Copyright (C) 2011-2012 Max Kellermann <max@duempel.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SLES_OBJECT_HPP
#define SLES_OBJECT_HPP
#include <SLES/OpenSLES.h>
namespace
SLES
{
/**
* OO wrapper for an OpenSL/ES SLObjectItf variable.
*/
class
Object
{
SLObjectItf
object
;
public
:
Object
()
=
default
;
explicit
Object
(
SLObjectItf
_object
)
:
object
(
_object
)
{}
operator
SLObjectItf
()
{
return
object
;
}
SLresult
Realize
(
bool
async
)
{
return
(
*
object
)
->
Realize
(
object
,
async
);
}
void
Destroy
()
{
(
*
object
)
->
Destroy
(
object
);
}
SLresult
GetInterface
(
const
SLInterfaceID
iid
,
void
*
pInterface
)
{
return
(
*
object
)
->
GetInterface
(
object
,
iid
,
pInterface
);
}
};
}
#endif
src/output/plugins/sles/Play.hxx
0 → 100644
View file @
9574d11d
/*
* Copyright (C) 2011-2012 Max Kellermann <max@duempel.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SLES_PLAY_HPP
#define SLES_PLAY_HPP
#include <SLES/OpenSLES.h>
namespace
SLES
{
/**
* OO wrapper for an OpenSL/ES SLPlayItf variable.
*/
class
Play
{
SLPlayItf
play
;
public
:
Play
()
=
default
;
explicit
Play
(
SLPlayItf
_play
)
:
play
(
_play
)
{}
SLresult
SetPlayState
(
SLuint32
state
)
{
return
(
*
play
)
->
SetPlayState
(
play
,
state
);
}
};
}
#endif
src/output/plugins/sles/SlesOutputPlugin.cxx
0 → 100644
View file @
9574d11d
This diff is collapsed.
Click to expand it.
src/output/plugins/sles/SlesOutputPlugin.hxx
0 → 100644
View file @
9574d11d
/*
* Copyright (C) 2003-2014 The Music Player Daemon Project
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_SLES_OUTPUT_PLUGIN_HXX
#define MPD_SLES_OUTPUT_PLUGIN_HXX
extern
const
struct
AudioOutputPlugin
sles_output_plugin
;
#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