迁移代码。
This commit is contained in:
parent
dd97037629
commit
0684c0fbc5
6
.vscode/c_cpp_properties.json
vendored
6
.vscode/c_cpp_properties.json
vendored
@ -5,11 +5,11 @@
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/3rdparty/ds_pedestrian_mot_hisi/include",
|
||||
"/opt/Libraries/boost_1_86_0/include",
|
||||
"/opt/Libraries/libdatachannel-0.22.4",
|
||||
"/opt/aarch64-v01c01-linux-gnu-gcc/lib/boost_1_87_0/include",
|
||||
"/opt/aarch64-v01c01-linux-gnu-gcc/lib/libdatachannel-0.22.5",
|
||||
"/opt/aarch64-v01c01-linux-gnu-gcc/lib/ZLMediaKit/include",
|
||||
"/opt/aarch64-v01c01-linux-gnu-gcc/lib/LeakTracer/include",
|
||||
"build/_deps/kylin-src/Universal"
|
||||
"build/_deps/kylin-src"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
|
@ -9,15 +9,15 @@ option(CROSS_BUILD "build for embeded product." ON)
|
||||
|
||||
if(CROSS_BUILD)
|
||||
set(Libraries_ROOT /opt/aarch64-v01c01-linux-gnu-gcc/lib)
|
||||
set(OPENSSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openssl)
|
||||
set(OPENSSL_ROOT_DIR ${Libraries_ROOT}/openssl-3.4.1)
|
||||
set(OPENSSL_LIBRARY_DIRS ${OPENSSL_ROOT_DIR}/libs)
|
||||
set(SCTP_ROOT ${Libraries_ROOT}/usrsctp-0.9.5.0)
|
||||
set(SCTP_LIBRARIES ${SCTP_ROOT}/lib/libusrsctp.so)
|
||||
else()
|
||||
set(Libraries_ROOT /opt/Libraries)
|
||||
endif()
|
||||
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
|
||||
set(OPENSSL_LIBRARIES ssl crypto)
|
||||
|
||||
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0)
|
||||
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_87_0)
|
||||
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include)
|
||||
option(Boost_USE_STATIC_LIBS OFF)
|
||||
find_package(Boost REQUIRED COMPONENTS log serialization)
|
||||
@ -36,6 +36,6 @@ add_subdirectory(Tools)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(Kylin
|
||||
GIT_REPOSITORY https://gitea.amass.fun/amass/Kylin.git
|
||||
GIT_REPOSITORY ssh://git@gitea.amass.fun:2022/amass/Kylin.git
|
||||
)
|
||||
FetchContent_MakeAvailable(Kylin)
|
@ -1,7 +1,8 @@
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
add_executable(PassengerStatistics main.cpp
|
||||
DetectAlgorithm.h DetectAlgorithm.cpp
|
||||
ImageUtilities.h ImageUtilities.cpp
|
||||
Live555RtspPusher.h Live555RtspPusher.cpp
|
||||
RtspServer.h RtspServer.cpp
|
||||
VideoInput.h VideoInput.cpp
|
||||
)
|
||||
@ -22,12 +23,14 @@ target_link_directories(PassengerStatistics
|
||||
)
|
||||
|
||||
target_link_libraries(PassengerStatistics
|
||||
PRIVATE Universal
|
||||
PRIVATE ${OPENSSL_LIBRARIES}
|
||||
PRIVATE Kylin::Core
|
||||
PRIVATE OpenSSL::SSL
|
||||
PRIVATE OpenSSL::Crypto
|
||||
PRIVATE rw_mpp
|
||||
PRIVATE ds_pedestrian_mot_Hi3516DV500
|
||||
PRIVATE mk_api
|
||||
PRIVATE opencv_core
|
||||
PRIVATE opencv_imgcodecs
|
||||
PRIVATE opencv_imgproc
|
||||
PRIVATE ${SCTP_LIBRARIES}
|
||||
)
|
@ -1,5 +1,5 @@
|
||||
#include "DetectAlgorithm.h"
|
||||
#include "BoostLog.h"
|
||||
#include "Core/Logger.h"
|
||||
#include "ImageUtilities.h"
|
||||
#include <ds_pedestrian_mot_hisi.h>
|
||||
#include <filesystem>
|
||||
|
@ -1,12 +0,0 @@
|
||||
#include "Live555RtspPusher.h"
|
||||
|
||||
Live555RtspPusher::Live555RtspPusher(boost::asio::io_context &ioContext) : m_ioContext(ioContext), m_socket(ioContext) {
|
||||
using boost::asio::ip::udp;
|
||||
m_socket.open(udp::v4());
|
||||
}
|
||||
|
||||
void Live555RtspPusher::push(const uint8_t *data, uint32_t size) {
|
||||
using boost::asio::ip::udp;
|
||||
udp::endpoint point(udp::v4(), 6666);
|
||||
m_socket.send_to(boost::asio::const_buffer(data, size), point);
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
#ifndef __LIVE555RTSPPUSHER_H__
|
||||
#define __LIVE555RTSPPUSHER_H__
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/ip/udp.hpp>
|
||||
|
||||
class Live555RtspPusher {
|
||||
public:
|
||||
Live555RtspPusher(boost::asio::io_context &ioContext);
|
||||
void push(const uint8_t *data, uint32_t size);
|
||||
|
||||
private:
|
||||
boost::asio::io_context &m_ioContext;
|
||||
boost::asio::ip::udp::socket m_socket;
|
||||
};
|
||||
#endif // __LIVE555RTSPPUSHER_H__
|
@ -1,5 +1,5 @@
|
||||
#include "VideoInput.h"
|
||||
#include "BoostLog.h"
|
||||
#include "Core/Logger.h"
|
||||
#include "DetectAlgorithm.h"
|
||||
#include "rw_mpp_api.h"
|
||||
#include <chrono>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "BoostLog.h"
|
||||
#include "DateTime.h"
|
||||
#include "IoContext.h"
|
||||
#include "Live555RtspPusher.h"
|
||||
#include "Core/DateTime.h"
|
||||
#include "Core/IoContext.h"
|
||||
#include "Core/Logger.h"
|
||||
#include "Core/Singleton.h"
|
||||
#include "RtspServer.h"
|
||||
#include "VideoInput.h"
|
||||
#include "rw_mpp_api.h"
|
||||
@ -9,6 +9,7 @@
|
||||
#include <fstream>
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
using namespace Core;
|
||||
LOG(info) << "app start...";
|
||||
int status = rw_mpp__init();
|
||||
if (status != 0) {
|
||||
@ -16,8 +17,7 @@ int main(int argc, char const *argv[]) {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
auto ioContext = Amass::Singleton<IoContext>::instance<Amass::Construct>();
|
||||
auto pusher = std::make_shared<Live555RtspPusher>(*ioContext->ioContext());
|
||||
auto ioContext = Singleton<IoContext>::construct(std::thread::hardware_concurrency());
|
||||
auto rtsp = std::make_shared<RtspServer>();
|
||||
|
||||
std::shared_ptr<std::ofstream> ofs;
|
||||
@ -44,7 +44,7 @@ int main(int argc, char const *argv[]) {
|
||||
ioContext->ioContext()->stop();
|
||||
});
|
||||
|
||||
ioContext->run<IoContext::Mode::Synchronous>();
|
||||
ioContext->run(false);
|
||||
} catch (const boost::exception &e) {
|
||||
LOG(error) << "error";
|
||||
} catch (const std::exception &e) {
|
||||
|
@ -1,2 +1 @@
|
||||
add_subdirectory(LeakTracer)
|
||||
add_subdirectory(VideoRecoder)
|
||||
add_subdirectory(LeakTracer)
|
@ -16,7 +16,7 @@ target_link_directories(LeakTracer
|
||||
)
|
||||
|
||||
target_link_libraries(LeakTracer
|
||||
PUBLIC Universal
|
||||
PUBLIC Kylin::Core
|
||||
-Wl,--wrap=malloc
|
||||
-Wl,--wrap=free
|
||||
)
|
@ -1,5 +1,5 @@
|
||||
#include "MemoryAllocationStackTracer.h"
|
||||
#include "DateTime.h"
|
||||
#include "Core/DateTime.h"
|
||||
#include <boost/stacktrace/detail/addr_base.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "BoostLog.h"
|
||||
#include "Core/Logger.h"
|
||||
#include "LeakTracer.h"
|
||||
#include "MemoryAllocationStackTracer.h"
|
||||
#include <boost/stacktrace.hpp>
|
||||
|
@ -1,5 +0,0 @@
|
||||
add_executable(VideoRecoder main.cpp)
|
||||
|
||||
target_link_libraries(VideoRecoder
|
||||
PRIVATE Universal
|
||||
)
|
@ -1,6 +0,0 @@
|
||||
#include "BoostLog.h"
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
LOG(info) << "app start...";
|
||||
return 0;
|
||||
}
|
@ -17,4 +17,4 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
# set(BOOST_ROOT /opt/toolchains/Libraries/boost_1_83_0)
|
||||
# set(BOOST_ROOT /opt/aarch64-v01c01-linux-gnu-gcc/lib/boost_1_87_0)
|
Loading…
x
Reference in New Issue
Block a user