-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cmdline): add syncPlayer example
Signed-off-by: pingkai <pingkai010@gmail.com>
- Loading branch information
Showing
6 changed files
with
474 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(example) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
include(../../framework/${TARGET_PLATFORM}.cmake) | ||
|
||
include(../../framework/module_config.cmake) | ||
|
||
add_executable(syncPlayer "") | ||
|
||
target_sources(syncPlayer PRIVATE | ||
syncPlayer.cpp | ||
communication/playerMessage.cpp | ||
../cicadaEventListener.cpp | ||
../NetWorkEventReceiver.cpp | ||
) | ||
|
||
if (ENABLE_SDL) | ||
target_sources(syncPlayer PRIVATE | ||
../SDLEventReceiver.cpp | ||
../SDLEventReceiver.h | ||
) | ||
endif () | ||
|
||
target_include_directories(syncPlayer PUBLIC | ||
../../mediaPlayer | ||
../) | ||
target_link_directories(syncPlayer PRIVATE | ||
../../external/install/ffmpeg/${CMAKE_SYSTEM_NAME}/x86_64/lib | ||
../../external/install/curl/${CMAKE_SYSTEM_NAME}/x86_64/lib | ||
../../external/install/openssl/${CMAKE_SYSTEM_NAME}/x86_64/lib | ||
${COMMON_LIB_DIR}) | ||
|
||
target_link_libraries(syncPlayer PRIVATE | ||
media_player | ||
demuxer | ||
data_source | ||
render | ||
videodec | ||
communication) | ||
if (ENABLE_CACHE_MODULE) | ||
target_link_libraries(syncPlayer PRIVATE | ||
cacheModule) | ||
endif () | ||
if (ENABLE_MUXER) | ||
target_link_libraries(syncPlayer PRIVATE | ||
muxer) | ||
endif () | ||
target_link_libraries(syncPlayer PRIVATE | ||
framework_filter | ||
framework_utils | ||
avfilter | ||
avformat | ||
avcodec | ||
swresample | ||
avutil | ||
curl | ||
${FRAMEWORK_LIBS}) | ||
if (ENABLE_SDL) | ||
target_link_libraries(syncPlayer PUBLIC | ||
SDL2 | ||
) | ||
endif () | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
target_link_libraries(syncPlayer PUBLIC | ||
bcrypt | ||
) | ||
else () | ||
target_link_libraries(syncPlayer PUBLIC | ||
z | ||
dl | ||
) | ||
endif () | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
target_link_libraries(syncPlayer PUBLIC | ||
bz2 | ||
) | ||
endif () | ||
|
||
if (APPLE) | ||
target_link_libraries( | ||
syncPlayer PUBLIC | ||
iconv | ||
bz2 | ||
${FRAMEWORK_LIBS} | ||
) | ||
else () | ||
target_link_libraries( | ||
syncPlayer PUBLIC | ||
dl | ||
ssl | ||
crypto | ||
pthread | ||
) | ||
endif () | ||
target_link_libraries(syncPlayer PUBLIC coverage_config) | ||
|
||
if (USEASAN) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") | ||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address") | ||
endif (USEASAN) | ||
|
||
if (USETSAN) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread") | ||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address") | ||
endif (USETSAN) | ||
|
||
if (USEUBSAN) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined, -fsanitize=integer, -fsanitize=nullability") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined, -fsanitize=integer, -fsanitize=nullability") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=undefined, -fsanitize=integer, -fsanitize=nullability") | ||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address") | ||
endif (USEUBSAN) | ||
|
||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
if (USEMSAN) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory, -fsanitize-memory-track-origins -fno-omit-frame-pointer") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory, -fsanitize-memory-track-origins -fno-omit-frame-pointer") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=memory, -fsanitize-memory-track-origins -fno-omit-frame-pointer") | ||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=address") | ||
endif (USEMSAN) | ||
endif () |
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,12 @@ | ||
// | ||
// Created by moqi on 2020/4/23. | ||
// | ||
|
||
#include "playerMessage.h" | ||
using namespace Cicada; | ||
const std::string playerMessage::prepare = "prepare"; | ||
const std::string playerMessage::pause = "pause"; | ||
const std::string playerMessage::start = "start"; | ||
const std::string playerMessage::exit = "exit"; | ||
const std::string playerMessage::fullScreen = "fullScreen"; | ||
const std::string playerMessage::clock = "clock"; |
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,21 @@ | ||
// | ||
// Created by moqi on 2020/4/23. | ||
// | ||
|
||
#ifndef CICADAMEDIA_PLAYERMESSAGE_H | ||
#define CICADAMEDIA_PLAYERMESSAGE_H | ||
#include <string> | ||
namespace Cicada { | ||
class playerMessage { | ||
public: | ||
const static std::string prepare; | ||
const static std::string start; | ||
const static std::string pause; | ||
const static std::string exit; | ||
const static std::string fullScreen; | ||
const static std::string clock; | ||
}; | ||
}// namespace Cicada | ||
|
||
|
||
#endif//CICADAMEDIA_PLAYERMESSAGE_H |
Oops, something went wrong.