forked from rdkcentral/rdkservices
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDK-30238: System Audio Player (rdkcentral#1756)
Reason for change: System Audio Player supports Audio Casting & Beep sound Test Procedure: Test app included Risks: Low Signed-off-by: vdinak240 <[email protected]>
- Loading branch information
Showing
27 changed files
with
4,898 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
set(PLUGIN_NAME SystemAudioPlayer) | ||
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME}) | ||
|
||
find_package(${NAMESPACE}Plugins REQUIRED) | ||
|
||
add_subdirectory(test) | ||
|
||
add_library(${MODULE_NAME} SHARED | ||
Module.cpp | ||
SystemAudioPlayer.cpp | ||
SystemAudioPlayerJsonRpc.cpp | ||
ProxyStubs_SystemAudioPlayer.cpp | ||
SystemAudioPlayerImplementation.cpp | ||
impl/AudioPlayer.cpp | ||
impl/BufferQueue.cpp | ||
impl/WebSocketClient.cpp | ||
impl/logger.cpp | ||
) | ||
set_target_properties(${MODULE_NAME} PROPERTIES | ||
CXX_STANDARD 11 | ||
CXX_STANDARD_REQUIRED YES) | ||
|
||
list(APPEND CMAKE_MODULE_PATH | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/") | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(GSTREAMERBASE REQUIRED gstreamer-app-1.0) | ||
pkg_check_modules(LIBWEBSOCKETS REQUIRED libwebsockets) | ||
|
||
find_package(GSTREAMER REQUIRED) | ||
|
||
find_package(Curl) | ||
|
||
set(AUDIO_CLIENT_LIB "") | ||
if (BUILD_AMLOGIC) | ||
set(AUDIO_CLIENT_LIB "audio_client") | ||
endif() | ||
|
||
target_include_directories(${MODULE_NAME} PRIVATE ../helpers ${GSTREAMER_INCLUDES} ${GSTREAMERBASE_INCLUDE_DIRS} ${LIBWEBSOCKETS_INCLUDE_DIRS}) | ||
target_link_libraries(${MODULE_NAME} PRIVATE ${NAMESPACE}Plugins::${NAMESPACE}Plugins ${CURL_LIBRARY} ${GSTREAMER_LIBRARIES} ${GSTREAMERBASE_LIBRARIES} ${AUDIO_CLIENT_LIB} ${LIBWEBSOCKETS_LIBRARIES} trower-base64) | ||
|
||
install(TARGETS ${MODULE_NAME} | ||
DESTINATION lib/${STORAGE_DIRECTORY}/plugins) | ||
|
||
write_config( SystemAudioPlayer ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
#ifndef __ISYSTEMAUDIOPLAYER_H | ||
#define __ISYSTEMAUDIOPLAYER_H | ||
|
||
#include "Module.h" | ||
#include <interfaces/Ids.h> | ||
|
||
namespace WPEFramework { | ||
namespace Exchange { | ||
|
||
struct EXTERNAL ISystemAudioPlayer : virtual public Core::IUnknown { | ||
enum { ID = ID_BROWSER + 0x7000 }; | ||
|
||
struct INotification : virtual public Core::IUnknown { | ||
enum { ID = ISystemAudioPlayer::ID + 1}; | ||
|
||
virtual ~INotification() {} | ||
virtual void OnSAPEvents(const string &data) = 0; | ||
}; | ||
|
||
virtual ~ISystemAudioPlayer() {} | ||
|
||
virtual uint32_t Configure(PluginHost::IShell* service) = 0; | ||
virtual void Register(INotification* sink) = 0; | ||
virtual void Unregister(INotification* sink) = 0; | ||
|
||
virtual uint32_t Open(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Play(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t PlayBuffer(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Pause(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Resume(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Stop(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Close(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t SetMixerLevels(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t IsPlaying(const string &input, string &output /* @out */) = 0; | ||
virtual uint32_t Config(const string &input, string &output /* @out */) = 0; | ||
|
||
}; | ||
|
||
} // Exchange | ||
} // WPEFramework | ||
|
||
#endif //__ISYSTEMAUDIOPLAYER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
* Copyright 2019 RDK Management | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
#include "Module.h" | ||
|
||
MODULE_NAME_DECLARATION(BUILD_REFERENCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* If not stated otherwise in this file or this component's LICENSE | ||
* file the following copyright and licenses apply: | ||
* | ||
* Copyright 2019 RDK Management | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
#pragma once | ||
#ifndef MODULE_NAME | ||
#define MODULE_NAME SystemAudioPlayer | ||
#endif | ||
|
||
#include <plugins/plugins.h> | ||
#include <tracing/tracing.h> | ||
|
||
#undef EXTERNAL | ||
#define EXTERNAL |
Oops, something went wrong.