A IP Camera Web Backend Reference Implementation
[TOC]
ipcweb-backend is designed to run on Linux platform, especially the Linux platform of Rockchip's SoCs. It is cross compiled with the following environments:
Build Host: Ubuntu
Host Web Server: Any web server that supports CGI application, like Lighttpd, Nginx, Apache, AppWeb etc.
Build System: CMake >= 3.8
Compiler: GCC >= 6 or Clang
Host Libraries(To test APIs on host environments)
sudo apt install libboost-all-dev
sudo apt install libcgicc-dev
sudo apt install nlohmann-json-dev
Target Libraries The target libraries should be provided by the Buildroot SDK, if them are not found, the CMake build system build them from source.
BR2_PACKAGE_BOOST=y
BR2_PACKAGE_BOOST_LOG=y
BR2_PACKAGE_BOOST_STACKTRACE=y
BR2_PACKAGE_BOOST_SYSTEM=y
BR2_PACKAGE_BOOST_THREAD=y
BR2_PACKAGE_LIBCGICC
BR2_PACKAGE_JSON_FOR_MODERN_CPP
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/linux-arm.cmake
make -j8
This project use Google Test as test framework. Init the googletest submodule to use it.
git submodule init
git submodule update
Build and test
cmake .. -DIPCWEB_BUILD_TESTS
make
make test
The output is like:
Running tests...
Test project /work/www/ipcweb-backend/build
Start 1: ObjectsTest.Tcpip.noArgs
1/1 Test #1: ObjectsTest.Tcpip.noArgs ......... Passed 0.00 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.00 sec
Start the web server to test CGI applications, suggest to use AppWeb.
appweb <path/of/web/root> <host>:<port>
Use tools like Postman to test the RESTful API
GET http://:/api/v1/hello.cgi?name=cody
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。