From 1a5a903fbaca732c83236c99aba9f8e6d76093b7 Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Sun, 22 Sep 2024 23:55:25 +0800 Subject: [PATCH] add code. --- .vscode/c_cpp_properties.json | 3 ++- Server/MediaServer.cpp | 12 ++++++++++++ Server/MediaServer.h | 9 +++++++++ resource/build.sh | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Server/MediaServer.cpp create mode 100644 Server/MediaServer.h diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 89f699f..7be9011 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -5,7 +5,8 @@ "includePath": [ "${workspaceFolder}/**", "${workspaceFolder}/build/_deps/kylin-src/Universal", - "/opt/Libraries/boost_1_85_0/include" + "/opt/Libraries/boost_1_86_0/include", + "/opt/Libraries/ZLMediaKit/include" ], "defines": [], "compilerPath": "/usr/bin/gcc", diff --git a/Server/MediaServer.cpp b/Server/MediaServer.cpp new file mode 100644 index 0000000..cfba85b --- /dev/null +++ b/Server/MediaServer.cpp @@ -0,0 +1,12 @@ +#include "MediaServer.h" +#include "BoostLog.h" +#include + +MediaServer::MediaServer() { + uint16_t status = mk_rtsp_server_start(554, 0); + if (status == 0) { + LOG(info) << "rtsp server start failed."; + } else { + LOG(info) << "rtsp server start succeed, port: " << status; + } +} \ No newline at end of file diff --git a/Server/MediaServer.h b/Server/MediaServer.h new file mode 100644 index 0000000..b4537f0 --- /dev/null +++ b/Server/MediaServer.h @@ -0,0 +1,9 @@ +#ifndef __MEDIASERVER_H__ +#define __MEDIASERVER_H__ + +class MediaServer { +public: + MediaServer(); +}; + +#endif // __MEDIASERVER_H__ \ No newline at end of file diff --git a/resource/build.sh b/resource/build.sh index c96ce63..984b29c 100755 --- a/resource/build.sh +++ b/resource/build.sh @@ -17,7 +17,7 @@ function cmake_scan() { fi ${cmake_exe} -G Ninja -S ${base_path} -B ${build_path} \ -DCMAKE_BUILD_TYPE=Debug \ - -DBOOST_ROOT=${libraries_root}/boost_1_85_0 + -DBOOST_ROOT=${libraries_root}/boost_1_86_0 } function build() {