mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-10 21:59:54 -05:00
Merge branch 'dev'
This commit is contained in:
2
components/3rd_party/lvgl/conf/lv_conf.h
vendored
2
components/3rd_party/lvgl/conf/lv_conf.h
vendored
@@ -72,7 +72,7 @@ extern void lv_ui_mutex_unlock();
|
||||
|
||||
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
|
||||
*(Not so important, you can adjust it to modify default sizes and spaces)*/
|
||||
#define LV_DPI_DEF 260 /*[px/inch]*/
|
||||
#define LV_DPI_DEF 180 /*[px/inch]*/
|
||||
|
||||
/*=================
|
||||
* OPERATING SYSTEM
|
||||
|
||||
Binary file not shown.
@@ -13,6 +13,7 @@
|
||||
#include "maix_nn_F.hpp"
|
||||
#include "maix_nn_object.hpp"
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
|
||||
// Platform-specific optimization
|
||||
#if PLATFORM_MAIXCAM2
|
||||
@@ -261,16 +262,30 @@ namespace maix::nn
|
||||
std::vector<nn::LayerInfo> outputs = _model->outputs_info();
|
||||
err::check_bool_raise(outputs.size() >= 6, "need at least 6 outputs");
|
||||
|
||||
struct OutputInfo { std::string name; int h, w, c; };
|
||||
std::vector<OutputInfo> bbox_outputs, cls_outputs;
|
||||
struct OutputInfo { std::string name; int h, w, c; int idx; };
|
||||
std::vector<OutputInfo> parsed_outputs, bbox_outputs, cls_outputs;
|
||||
|
||||
auto has_token = [](const std::string &name, std::initializer_list<const char *> tokens) {
|
||||
std::string lower = name;
|
||||
std::transform(lower.begin(), lower.end(), lower.begin(),
|
||||
[](unsigned char ch) { return std::tolower(ch); });
|
||||
for (const char *token : tokens)
|
||||
{
|
||||
if (lower.find(token) != std::string::npos)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Classify outputs by channel count
|
||||
for (const auto &output : outputs)
|
||||
for (size_t output_idx = 0; output_idx < outputs.size(); ++output_idx)
|
||||
{
|
||||
const auto &output = outputs[output_idx];
|
||||
if (output.shape.size() != 4) continue;
|
||||
|
||||
OutputInfo info;
|
||||
info.name = output.name;
|
||||
info.idx = output_idx;
|
||||
|
||||
#if PLATFORM_MAIXCAM2
|
||||
// MaixCAM2: Always NHWC format
|
||||
@@ -315,10 +330,64 @@ namespace maix::nn
|
||||
}
|
||||
#endif
|
||||
|
||||
if (info.c == 4)
|
||||
bbox_outputs.push_back(info);
|
||||
else if (info.c == (int)labels.size() || info.c == 80)
|
||||
cls_outputs.push_back(info);
|
||||
if (info.c == 4 || info.c == (int)labels.size() || info.c == 80)
|
||||
parsed_outputs.push_back(info);
|
||||
}
|
||||
|
||||
std::sort(parsed_outputs.begin(), parsed_outputs.end(), [](const OutputInfo &a, const OutputInfo &b) {
|
||||
if (a.h != b.h) return a.h > b.h;
|
||||
if (a.w != b.w) return a.w > b.w;
|
||||
return a.idx < b.idx;
|
||||
});
|
||||
|
||||
for (size_t i = 0; i < parsed_outputs.size();)
|
||||
{
|
||||
std::vector<OutputInfo> group;
|
||||
const int h = parsed_outputs[i].h;
|
||||
const int w = parsed_outputs[i].w;
|
||||
while (i < parsed_outputs.size() && parsed_outputs[i].h == h && parsed_outputs[i].w == w)
|
||||
{
|
||||
group.push_back(parsed_outputs[i]);
|
||||
++i;
|
||||
}
|
||||
|
||||
if (group.size() != 2)
|
||||
continue;
|
||||
|
||||
int bbox_idx = -1;
|
||||
int cls_idx = -1;
|
||||
|
||||
for (size_t j = 0; j < group.size(); ++j)
|
||||
{
|
||||
if (has_token(group[j].name, {"bbox", "box", "reg", "loc"}))
|
||||
bbox_idx = j;
|
||||
if (has_token(group[j].name, {"cls", "class", "score"}))
|
||||
cls_idx = j;
|
||||
}
|
||||
|
||||
if (bbox_idx < 0 || cls_idx < 0 || bbox_idx == cls_idx)
|
||||
{
|
||||
if (group[0].c == 4 && group[1].c != 4)
|
||||
{
|
||||
bbox_idx = 0;
|
||||
cls_idx = 1;
|
||||
}
|
||||
else if (group[1].c == 4 && group[0].c != 4)
|
||||
{
|
||||
bbox_idx = 1;
|
||||
cls_idx = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// When num_classes == 4, bbox/cls both have 4 channels.
|
||||
// Fall back to stable output order within the same grid.
|
||||
bbox_idx = 0;
|
||||
cls_idx = 1;
|
||||
}
|
||||
}
|
||||
|
||||
bbox_outputs.push_back(group[bbox_idx]);
|
||||
cls_outputs.push_back(group[cls_idx]);
|
||||
}
|
||||
|
||||
err::check_bool_raise(bbox_outputs.size() == 3 && cls_outputs.size() == 3,
|
||||
@@ -550,7 +619,7 @@ namespace maix::nn
|
||||
int ay = i / fw;
|
||||
|
||||
// Get class scores (handle NCHW vs NHWC)
|
||||
float class_scores[80];
|
||||
std::vector<float> class_scores(num_class);
|
||||
const float *c;
|
||||
|
||||
if (_is_nchw)
|
||||
@@ -559,7 +628,7 @@ namespace maix::nn
|
||||
{
|
||||
class_scores[j] = cls[j * fh * fw + ay * fw + ax];
|
||||
}
|
||||
c = class_scores;
|
||||
c = class_scores.data();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -861,4 +930,4 @@ namespace maix::nn
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace maix::nn
|
||||
} // namespace maix::nn
|
||||
|
||||
Binary file not shown.
@@ -56,7 +56,7 @@ namespace maix::peripheral::spi
|
||||
transfer.bits_per_word = bits;
|
||||
transfer.cs_change = used_soft_cs;
|
||||
// log::info("[__spi_transfer] cs_change = %d", transfer.cs_change);
|
||||
|
||||
#if PLATFORM_MAIXCAM2
|
||||
if (txbuf) {
|
||||
auto data_size = len;
|
||||
auto p_data = (uint8_t *)txbuf;
|
||||
@@ -106,7 +106,10 @@ namespace maix::peripheral::spi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
if (::ioctl(fd, SPI_IOC_MESSAGE(1), &transfer) < 1)
|
||||
return -1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -701,7 +701,7 @@ namespace maix::camera
|
||||
err::check_raise(err::ERR_BUFF_EMPTY, "read camera failed");
|
||||
}
|
||||
|
||||
auto img = new image::Image(frame->w, frame->h, image::FMT_RGGB10, (uint8_t *)frame->data, frame->len, false);
|
||||
auto img = new image::Image(frame->w, frame->h, image::FMT_RGGB10, (uint8_t *)frame->data, frame->len, true);
|
||||
delete frame;
|
||||
return img;
|
||||
}
|
||||
|
||||
9
examples/camera_onvif_server/.gitignore
vendored
Normal file
9
examples/camera_onvif_server/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
build
|
||||
dist
|
||||
.config.mk
|
||||
.flash.conf.json
|
||||
data
|
||||
|
||||
/CMakeLists.txt
|
||||
|
||||
__pycache__
|
||||
28
examples/camera_onvif_server/README.md
Normal file
28
examples/camera_onvif_server/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# ONVIF Camera Server
|
||||
|
||||
这个工程基于开源项目[onvif_srvd](https://github.com/KoynovStas/onvif_srvd)开发, 用于在MaixCAM2上运行支持ONVIF服务的IPC摄像头
|
||||
|
||||
This project is based on the open source project [onvif_srvd](https://github.com/KoynovStas/onvif_srvd), which is used to run an ONVIF service IPC camera on MaixCAM2
|
||||
|
||||
|
||||
运行命令参考:
|
||||
```shell
|
||||
./onvif_server --ifs wlan0 \
|
||||
--scope onvif://www.onvif.org/name/MaixCAM2 \
|
||||
--scope onvif://www.onvif.org/Profile/M \
|
||||
--manufacturer sipeed \
|
||||
--firmware_ver v4.12.5 \
|
||||
--model MaixCAM2 \
|
||||
--serial_num 12345678 \
|
||||
--hardware_id 11:22:33:44:55 \
|
||||
--name RTSP \
|
||||
--width 800 \
|
||||
--height 600 \
|
||||
--url rtsp://192.168.10.79:8554/live \
|
||||
--type JPEG \
|
||||
--log_file out.log \
|
||||
--no_fork \
|
||||
--port 8080
|
||||
```
|
||||
|
||||
关于generated文件, 该文件是基于onvif_srvd生成的, 请勿修改
|
||||
10
examples/camera_onvif_server/app.yaml
Normal file
10
examples/camera_onvif_server/app.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
id: camera_onvif_server
|
||||
name: ONVIF Camera Server
|
||||
name[zh]: ONVIF 摄像头服务
|
||||
version: 1.0.0
|
||||
author: Sipeed Ltd
|
||||
desc: Adapted for ONVIF protocol camera
|
||||
desc[zh]: 适用于ONVIF协议的摄像头服务
|
||||
files:
|
||||
# assets: assets
|
||||
|
||||
29
examples/camera_onvif_server/generated/DeviceBinding.nsmap
Normal file
29
examples/camera_onvif_server/generated/DeviceBinding.nsmap
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#include "stdsoap2.h"
|
||||
/* This defines the global XML namespaces[] table to #include and compile */
|
||||
SOAP_NMAC struct Namespace namespaces[] = {
|
||||
{ "SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL },
|
||||
{ "SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL },
|
||||
{ "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL },
|
||||
{ "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL },
|
||||
{ "chan", "http://schemas.microsoft.com/ws/2005/02/duplex", NULL, NULL },
|
||||
{ "wsa5", "http://www.w3.org/2005/08/addressing", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL },
|
||||
{ "wsnt", "http://docs.oasis-open.org/wsn/b-2", NULL, NULL },
|
||||
{ "wsrfbf", "http://docs.oasis-open.org/wsrf/bf-2", NULL, NULL },
|
||||
{ "xmime", "http://tempuri.org/xmime.xsd", NULL, NULL },
|
||||
{ "xop", "http://www.w3.org/2004/08/xop/include", NULL, NULL },
|
||||
{ "tt", "http://www.onvif.org/ver10/schema", NULL, NULL },
|
||||
{ "wstop", "http://docs.oasis-open.org/wsn/t-1", NULL, NULL },
|
||||
{ "tds", "http://www.onvif.org/ver10/device/wsdl", NULL, NULL },
|
||||
{ "tptz", "http://www.onvif.org/ver20/ptz/wsdl", NULL, NULL },
|
||||
{ "trt", "http://www.onvif.org/ver10/media/wsdl", NULL, NULL },
|
||||
{ "c14n", "http://www.w3.org/2001/10/xml-exc-c14n#", NULL, NULL },
|
||||
{ "ds", "http://www.w3.org/2000/09/xmldsig#", NULL, NULL },
|
||||
{ "saml1", "urn:oasis:names:tc:SAML:1.0:assertion", NULL, NULL },
|
||||
{ "saml2", "urn:oasis:names:tc:SAML:2.0:assertion", NULL, NULL },
|
||||
{ "wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", NULL, NULL },
|
||||
{ "xenc", "http://www.w3.org/2001/04/xmlenc#", NULL, NULL },
|
||||
{ "wsc", "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512", "http://schemas.xmlsoap.org/ws/2005/02/sc", NULL },
|
||||
{ "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", NULL },
|
||||
{ NULL, NULL, NULL, NULL}
|
||||
};
|
||||
29
examples/camera_onvif_server/generated/MediaBinding.nsmap
Normal file
29
examples/camera_onvif_server/generated/MediaBinding.nsmap
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#include "stdsoap2.h"
|
||||
/* This defines the global XML namespaces[] table to #include and compile */
|
||||
SOAP_NMAC struct Namespace namespaces[] = {
|
||||
{ "SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL },
|
||||
{ "SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL },
|
||||
{ "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL },
|
||||
{ "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL },
|
||||
{ "chan", "http://schemas.microsoft.com/ws/2005/02/duplex", NULL, NULL },
|
||||
{ "wsa5", "http://www.w3.org/2005/08/addressing", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL },
|
||||
{ "wsnt", "http://docs.oasis-open.org/wsn/b-2", NULL, NULL },
|
||||
{ "wsrfbf", "http://docs.oasis-open.org/wsrf/bf-2", NULL, NULL },
|
||||
{ "xmime", "http://tempuri.org/xmime.xsd", NULL, NULL },
|
||||
{ "xop", "http://www.w3.org/2004/08/xop/include", NULL, NULL },
|
||||
{ "tt", "http://www.onvif.org/ver10/schema", NULL, NULL },
|
||||
{ "wstop", "http://docs.oasis-open.org/wsn/t-1", NULL, NULL },
|
||||
{ "tds", "http://www.onvif.org/ver10/device/wsdl", NULL, NULL },
|
||||
{ "tptz", "http://www.onvif.org/ver20/ptz/wsdl", NULL, NULL },
|
||||
{ "trt", "http://www.onvif.org/ver10/media/wsdl", NULL, NULL },
|
||||
{ "c14n", "http://www.w3.org/2001/10/xml-exc-c14n#", NULL, NULL },
|
||||
{ "ds", "http://www.w3.org/2000/09/xmldsig#", NULL, NULL },
|
||||
{ "saml1", "urn:oasis:names:tc:SAML:1.0:assertion", NULL, NULL },
|
||||
{ "saml2", "urn:oasis:names:tc:SAML:2.0:assertion", NULL, NULL },
|
||||
{ "wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", NULL, NULL },
|
||||
{ "xenc", "http://www.w3.org/2001/04/xmlenc#", NULL, NULL },
|
||||
{ "wsc", "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512", "http://schemas.xmlsoap.org/ws/2005/02/sc", NULL },
|
||||
{ "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", NULL },
|
||||
{ NULL, NULL, NULL, NULL}
|
||||
};
|
||||
29
examples/camera_onvif_server/generated/PTZBinding.nsmap
Normal file
29
examples/camera_onvif_server/generated/PTZBinding.nsmap
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#include "stdsoap2.h"
|
||||
/* This defines the global XML namespaces[] table to #include and compile */
|
||||
SOAP_NMAC struct Namespace namespaces[] = {
|
||||
{ "SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL },
|
||||
{ "SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL },
|
||||
{ "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL },
|
||||
{ "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL },
|
||||
{ "chan", "http://schemas.microsoft.com/ws/2005/02/duplex", NULL, NULL },
|
||||
{ "wsa5", "http://www.w3.org/2005/08/addressing", "http://schemas.xmlsoap.org/ws/2004/08/addressing", NULL },
|
||||
{ "wsnt", "http://docs.oasis-open.org/wsn/b-2", NULL, NULL },
|
||||
{ "wsrfbf", "http://docs.oasis-open.org/wsrf/bf-2", NULL, NULL },
|
||||
{ "xmime", "http://tempuri.org/xmime.xsd", NULL, NULL },
|
||||
{ "xop", "http://www.w3.org/2004/08/xop/include", NULL, NULL },
|
||||
{ "tt", "http://www.onvif.org/ver10/schema", NULL, NULL },
|
||||
{ "wstop", "http://docs.oasis-open.org/wsn/t-1", NULL, NULL },
|
||||
{ "tds", "http://www.onvif.org/ver10/device/wsdl", NULL, NULL },
|
||||
{ "tptz", "http://www.onvif.org/ver20/ptz/wsdl", NULL, NULL },
|
||||
{ "trt", "http://www.onvif.org/ver10/media/wsdl", NULL, NULL },
|
||||
{ "c14n", "http://www.w3.org/2001/10/xml-exc-c14n#", NULL, NULL },
|
||||
{ "ds", "http://www.w3.org/2000/09/xmldsig#", NULL, NULL },
|
||||
{ "saml1", "urn:oasis:names:tc:SAML:1.0:assertion", NULL, NULL },
|
||||
{ "saml2", "urn:oasis:names:tc:SAML:2.0:assertion", NULL, NULL },
|
||||
{ "wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", NULL, NULL },
|
||||
{ "xenc", "http://www.w3.org/2001/04/xmlenc#", NULL, NULL },
|
||||
{ "wsc", "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512", "http://schemas.xmlsoap.org/ws/2005/02/sc", NULL },
|
||||
{ "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", NULL },
|
||||
{ NULL, NULL, NULL, NULL}
|
||||
};
|
||||
57517
examples/camera_onvif_server/generated/onvif.h
Normal file
57517
examples/camera_onvif_server/generated/onvif.h
Normal file
File diff suppressed because it is too large
Load Diff
288780
examples/camera_onvif_server/generated/soapC.cpp
Normal file
288780
examples/camera_onvif_server/generated/soapC.cpp
Normal file
File diff suppressed because it is too large
Load Diff
4234
examples/camera_onvif_server/generated/soapDeviceBindingService.cpp
Normal file
4234
examples/camera_onvif_server/generated/soapDeviceBindingService.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,370 @@
|
||||
/* soapDeviceBindingService.h
|
||||
Generated by gSOAP 2.8.92 for /home/sipeed/onvif_srvd/generated/onvif.h
|
||||
|
||||
gSOAP XML Web services tools
|
||||
Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved.
|
||||
The soapcpp2 tool and its generated software are released under the GPL.
|
||||
This program is released under the GPL with the additional exemption that
|
||||
compiling, linking, and/or using OpenSSL is allowed.
|
||||
--------------------------------------------------------------------------------
|
||||
A commercial use license is available from Genivia Inc., contact@genivia.com
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef soapDeviceBindingService_H
|
||||
#define soapDeviceBindingService_H
|
||||
#include "soapH.h"
|
||||
|
||||
class SOAP_CMAC DeviceBindingService {
|
||||
public:
|
||||
/// Context to manage service IO and data
|
||||
struct soap *soap;
|
||||
/// flag indicating that this context is owned by this service and should be deleted by the destructor
|
||||
bool soap_own;
|
||||
/// Variables globally declared in /home/sipeed/onvif_srvd/generated/onvif.h, if any
|
||||
/// Construct a service with new managing context
|
||||
DeviceBindingService();
|
||||
/// Copy constructor
|
||||
DeviceBindingService(const DeviceBindingService&);
|
||||
/// Construct service given a shared managing context
|
||||
DeviceBindingService(struct soap*);
|
||||
/// Constructor taking input+output mode flags for the new managing context
|
||||
DeviceBindingService(soap_mode iomode);
|
||||
/// Constructor taking input and output mode flags for the new managing context
|
||||
DeviceBindingService(soap_mode imode, soap_mode omode);
|
||||
/// Destructor deletes deserialized data and its managing context, when the context was allocated by the constructor
|
||||
virtual ~DeviceBindingService();
|
||||
/// Delete all deserialized data (with soap_destroy() and soap_end())
|
||||
virtual void destroy();
|
||||
/// Delete all deserialized data and reset to defaults
|
||||
virtual void reset();
|
||||
/// Initializer used by constructors
|
||||
virtual void DeviceBindingService_init(soap_mode imode, soap_mode omode);
|
||||
/// Return a copy that has a new managing context with the same engine state
|
||||
virtual DeviceBindingService *copy() SOAP_PURE_VIRTUAL_COPY;
|
||||
/// Copy assignment
|
||||
DeviceBindingService& operator=(const DeviceBindingService&);
|
||||
/// Close connection (normally automatic)
|
||||
virtual int soap_close_socket();
|
||||
/// Force close connection (can kill a thread blocked on IO)
|
||||
virtual int soap_force_close_socket();
|
||||
/// Return sender-related fault to sender
|
||||
virtual int soap_senderfault(const char *string, const char *detailXML);
|
||||
/// Return sender-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault to sender
|
||||
virtual int soap_receiverfault(const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Print fault
|
||||
virtual void soap_print_fault(FILE*);
|
||||
#ifndef WITH_LEAN
|
||||
#ifndef WITH_COMPAT
|
||||
/// Print fault to stream
|
||||
virtual void soap_stream_fault(std::ostream&);
|
||||
#endif
|
||||
/// Write fault to buffer
|
||||
virtual char *soap_sprint_fault(char *buf, size_t len);
|
||||
#endif
|
||||
/// Disables and removes SOAP Header from message by setting soap->header = NULL
|
||||
virtual void soap_noheader();
|
||||
/// Add SOAP Header to message
|
||||
virtual void soap_header(char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action, struct chan__ChannelInstanceType *chan__ChannelInstance, struct _wsse__Security *wsse__Security);
|
||||
/// Get SOAP Header structure (i.e. soap->header, which is NULL when absent)
|
||||
virtual ::SOAP_ENV__Header *soap_header();
|
||||
#ifndef WITH_NOIO
|
||||
/// Run simple single-thread (iterative, non-SSL) service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int run(int port, int backlog = 1);
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// Run simple single-thread SSL service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int ssl_run(int port, int backlog = 1);
|
||||
#endif
|
||||
/// Bind service to port (returns master socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET bind(const char *host, int port, int backlog);
|
||||
/// Accept next request (returns socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET accept();
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// When SSL is used, after accept() should perform and accept SSL handshake
|
||||
virtual int ssl_accept();
|
||||
#endif
|
||||
#endif
|
||||
/// After accept() serve the pending request (returns SOAP_OK or error code)
|
||||
virtual int serve();
|
||||
/// Used by serve() to dispatch a pending request (returns SOAP_OK or error code)
|
||||
virtual int dispatch();
|
||||
virtual int dispatch(struct soap *soap);
|
||||
//
|
||||
// Service operations are listed below: you should define these
|
||||
// Note: compile with -DWITH_PURE_VIRTUAL to declare pure virtual methods
|
||||
//
|
||||
/// Web service operation 'GetServices' implementation, should return SOAP_OK or error code
|
||||
virtual int GetServices(_tds__GetServices *tds__GetServices, _tds__GetServicesResponse &tds__GetServicesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetServiceCapabilities' implementation, should return SOAP_OK or error code
|
||||
virtual int GetServiceCapabilities(_tds__GetServiceCapabilities *tds__GetServiceCapabilities, _tds__GetServiceCapabilitiesResponse &tds__GetServiceCapabilitiesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDeviceInformation' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDeviceInformation(_tds__GetDeviceInformation *tds__GetDeviceInformation, _tds__GetDeviceInformationResponse &tds__GetDeviceInformationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetSystemDateAndTime' implementation, should return SOAP_OK or error code
|
||||
virtual int SetSystemDateAndTime(_tds__SetSystemDateAndTime *tds__SetSystemDateAndTime, _tds__SetSystemDateAndTimeResponse &tds__SetSystemDateAndTimeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSystemDateAndTime' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSystemDateAndTime(_tds__GetSystemDateAndTime *tds__GetSystemDateAndTime, _tds__GetSystemDateAndTimeResponse &tds__GetSystemDateAndTimeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetSystemFactoryDefault' implementation, should return SOAP_OK or error code
|
||||
virtual int SetSystemFactoryDefault(_tds__SetSystemFactoryDefault *tds__SetSystemFactoryDefault, _tds__SetSystemFactoryDefaultResponse &tds__SetSystemFactoryDefaultResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'UpgradeSystemFirmware' implementation, should return SOAP_OK or error code
|
||||
virtual int UpgradeSystemFirmware(_tds__UpgradeSystemFirmware *tds__UpgradeSystemFirmware, _tds__UpgradeSystemFirmwareResponse &tds__UpgradeSystemFirmwareResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SystemReboot' implementation, should return SOAP_OK or error code
|
||||
virtual int SystemReboot(_tds__SystemReboot *tds__SystemReboot, _tds__SystemRebootResponse &tds__SystemRebootResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RestoreSystem' implementation, should return SOAP_OK or error code
|
||||
virtual int RestoreSystem(_tds__RestoreSystem *tds__RestoreSystem, _tds__RestoreSystemResponse &tds__RestoreSystemResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSystemBackup' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSystemBackup(_tds__GetSystemBackup *tds__GetSystemBackup, _tds__GetSystemBackupResponse &tds__GetSystemBackupResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSystemLog' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSystemLog(_tds__GetSystemLog *tds__GetSystemLog, _tds__GetSystemLogResponse &tds__GetSystemLogResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSystemSupportInformation' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSystemSupportInformation(_tds__GetSystemSupportInformation *tds__GetSystemSupportInformation, _tds__GetSystemSupportInformationResponse &tds__GetSystemSupportInformationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetScopes' implementation, should return SOAP_OK or error code
|
||||
virtual int GetScopes(_tds__GetScopes *tds__GetScopes, _tds__GetScopesResponse &tds__GetScopesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetScopes' implementation, should return SOAP_OK or error code
|
||||
virtual int SetScopes(_tds__SetScopes *tds__SetScopes, _tds__SetScopesResponse &tds__SetScopesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddScopes' implementation, should return SOAP_OK or error code
|
||||
virtual int AddScopes(_tds__AddScopes *tds__AddScopes, _tds__AddScopesResponse &tds__AddScopesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveScopes' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveScopes(_tds__RemoveScopes *tds__RemoveScopes, _tds__RemoveScopesResponse &tds__RemoveScopesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDiscoveryMode' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDiscoveryMode(_tds__GetDiscoveryMode *tds__GetDiscoveryMode, _tds__GetDiscoveryModeResponse &tds__GetDiscoveryModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetDiscoveryMode' implementation, should return SOAP_OK or error code
|
||||
virtual int SetDiscoveryMode(_tds__SetDiscoveryMode *tds__SetDiscoveryMode, _tds__SetDiscoveryModeResponse &tds__SetDiscoveryModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetRemoteDiscoveryMode' implementation, should return SOAP_OK or error code
|
||||
virtual int GetRemoteDiscoveryMode(_tds__GetRemoteDiscoveryMode *tds__GetRemoteDiscoveryMode, _tds__GetRemoteDiscoveryModeResponse &tds__GetRemoteDiscoveryModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetRemoteDiscoveryMode' implementation, should return SOAP_OK or error code
|
||||
virtual int SetRemoteDiscoveryMode(_tds__SetRemoteDiscoveryMode *tds__SetRemoteDiscoveryMode, _tds__SetRemoteDiscoveryModeResponse &tds__SetRemoteDiscoveryModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDPAddresses' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDPAddresses(_tds__GetDPAddresses *tds__GetDPAddresses, _tds__GetDPAddressesResponse &tds__GetDPAddressesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetEndpointReference' implementation, should return SOAP_OK or error code
|
||||
virtual int GetEndpointReference(_tds__GetEndpointReference *tds__GetEndpointReference, _tds__GetEndpointReferenceResponse &tds__GetEndpointReferenceResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetRemoteUser' implementation, should return SOAP_OK or error code
|
||||
virtual int GetRemoteUser(_tds__GetRemoteUser *tds__GetRemoteUser, _tds__GetRemoteUserResponse &tds__GetRemoteUserResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetRemoteUser' implementation, should return SOAP_OK or error code
|
||||
virtual int SetRemoteUser(_tds__SetRemoteUser *tds__SetRemoteUser, _tds__SetRemoteUserResponse &tds__SetRemoteUserResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetUsers' implementation, should return SOAP_OK or error code
|
||||
virtual int GetUsers(_tds__GetUsers *tds__GetUsers, _tds__GetUsersResponse &tds__GetUsersResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateUsers' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateUsers(_tds__CreateUsers *tds__CreateUsers, _tds__CreateUsersResponse &tds__CreateUsersResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteUsers' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteUsers(_tds__DeleteUsers *tds__DeleteUsers, _tds__DeleteUsersResponse &tds__DeleteUsersResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetUser' implementation, should return SOAP_OK or error code
|
||||
virtual int SetUser(_tds__SetUser *tds__SetUser, _tds__SetUserResponse &tds__SetUserResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetWsdlUrl' implementation, should return SOAP_OK or error code
|
||||
virtual int GetWsdlUrl(_tds__GetWsdlUrl *tds__GetWsdlUrl, _tds__GetWsdlUrlResponse &tds__GetWsdlUrlResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCapabilities' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCapabilities(_tds__GetCapabilities *tds__GetCapabilities, _tds__GetCapabilitiesResponse &tds__GetCapabilitiesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetDPAddresses' implementation, should return SOAP_OK or error code
|
||||
virtual int SetDPAddresses(_tds__SetDPAddresses *tds__SetDPAddresses, _tds__SetDPAddressesResponse &tds__SetDPAddressesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetHostname' implementation, should return SOAP_OK or error code
|
||||
virtual int GetHostname(_tds__GetHostname *tds__GetHostname, _tds__GetHostnameResponse &tds__GetHostnameResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetHostname' implementation, should return SOAP_OK or error code
|
||||
virtual int SetHostname(_tds__SetHostname *tds__SetHostname, _tds__SetHostnameResponse &tds__SetHostnameResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetHostnameFromDHCP' implementation, should return SOAP_OK or error code
|
||||
virtual int SetHostnameFromDHCP(_tds__SetHostnameFromDHCP *tds__SetHostnameFromDHCP, _tds__SetHostnameFromDHCPResponse &tds__SetHostnameFromDHCPResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDNS' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDNS(_tds__GetDNS *tds__GetDNS, _tds__GetDNSResponse &tds__GetDNSResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetDNS' implementation, should return SOAP_OK or error code
|
||||
virtual int SetDNS(_tds__SetDNS *tds__SetDNS, _tds__SetDNSResponse &tds__SetDNSResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNTP' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNTP(_tds__GetNTP *tds__GetNTP, _tds__GetNTPResponse &tds__GetNTPResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetNTP' implementation, should return SOAP_OK or error code
|
||||
virtual int SetNTP(_tds__SetNTP *tds__SetNTP, _tds__SetNTPResponse &tds__SetNTPResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDynamicDNS' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDynamicDNS(_tds__GetDynamicDNS *tds__GetDynamicDNS, _tds__GetDynamicDNSResponse &tds__GetDynamicDNSResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetDynamicDNS' implementation, should return SOAP_OK or error code
|
||||
virtual int SetDynamicDNS(_tds__SetDynamicDNS *tds__SetDynamicDNS, _tds__SetDynamicDNSResponse &tds__SetDynamicDNSResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNetworkInterfaces' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNetworkInterfaces(_tds__GetNetworkInterfaces *tds__GetNetworkInterfaces, _tds__GetNetworkInterfacesResponse &tds__GetNetworkInterfacesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetNetworkInterfaces' implementation, should return SOAP_OK or error code
|
||||
virtual int SetNetworkInterfaces(_tds__SetNetworkInterfaces *tds__SetNetworkInterfaces, _tds__SetNetworkInterfacesResponse &tds__SetNetworkInterfacesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNetworkProtocols' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNetworkProtocols(_tds__GetNetworkProtocols *tds__GetNetworkProtocols, _tds__GetNetworkProtocolsResponse &tds__GetNetworkProtocolsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetNetworkProtocols' implementation, should return SOAP_OK or error code
|
||||
virtual int SetNetworkProtocols(_tds__SetNetworkProtocols *tds__SetNetworkProtocols, _tds__SetNetworkProtocolsResponse &tds__SetNetworkProtocolsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNetworkDefaultGateway' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNetworkDefaultGateway(_tds__GetNetworkDefaultGateway *tds__GetNetworkDefaultGateway, _tds__GetNetworkDefaultGatewayResponse &tds__GetNetworkDefaultGatewayResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetNetworkDefaultGateway' implementation, should return SOAP_OK or error code
|
||||
virtual int SetNetworkDefaultGateway(_tds__SetNetworkDefaultGateway *tds__SetNetworkDefaultGateway, _tds__SetNetworkDefaultGatewayResponse &tds__SetNetworkDefaultGatewayResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetZeroConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetZeroConfiguration(_tds__GetZeroConfiguration *tds__GetZeroConfiguration, _tds__GetZeroConfigurationResponse &tds__GetZeroConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetZeroConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetZeroConfiguration(_tds__SetZeroConfiguration *tds__SetZeroConfiguration, _tds__SetZeroConfigurationResponse &tds__SetZeroConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetIPAddressFilter' implementation, should return SOAP_OK or error code
|
||||
virtual int GetIPAddressFilter(_tds__GetIPAddressFilter *tds__GetIPAddressFilter, _tds__GetIPAddressFilterResponse &tds__GetIPAddressFilterResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetIPAddressFilter' implementation, should return SOAP_OK or error code
|
||||
virtual int SetIPAddressFilter(_tds__SetIPAddressFilter *tds__SetIPAddressFilter, _tds__SetIPAddressFilterResponse &tds__SetIPAddressFilterResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddIPAddressFilter' implementation, should return SOAP_OK or error code
|
||||
virtual int AddIPAddressFilter(_tds__AddIPAddressFilter *tds__AddIPAddressFilter, _tds__AddIPAddressFilterResponse &tds__AddIPAddressFilterResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveIPAddressFilter' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveIPAddressFilter(_tds__RemoveIPAddressFilter *tds__RemoveIPAddressFilter, _tds__RemoveIPAddressFilterResponse &tds__RemoveIPAddressFilterResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAccessPolicy' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAccessPolicy(_tds__GetAccessPolicy *tds__GetAccessPolicy, _tds__GetAccessPolicyResponse &tds__GetAccessPolicyResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetAccessPolicy' implementation, should return SOAP_OK or error code
|
||||
virtual int SetAccessPolicy(_tds__SetAccessPolicy *tds__SetAccessPolicy, _tds__SetAccessPolicyResponse &tds__SetAccessPolicyResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateCertificate' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateCertificate(_tds__CreateCertificate *tds__CreateCertificate, _tds__CreateCertificateResponse &tds__CreateCertificateResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCertificates' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCertificates(_tds__GetCertificates *tds__GetCertificates, _tds__GetCertificatesResponse &tds__GetCertificatesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCertificatesStatus' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCertificatesStatus(_tds__GetCertificatesStatus *tds__GetCertificatesStatus, _tds__GetCertificatesStatusResponse &tds__GetCertificatesStatusResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetCertificatesStatus' implementation, should return SOAP_OK or error code
|
||||
virtual int SetCertificatesStatus(_tds__SetCertificatesStatus *tds__SetCertificatesStatus, _tds__SetCertificatesStatusResponse &tds__SetCertificatesStatusResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteCertificates' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteCertificates(_tds__DeleteCertificates *tds__DeleteCertificates, _tds__DeleteCertificatesResponse &tds__DeleteCertificatesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetPkcs10Request' implementation, should return SOAP_OK or error code
|
||||
virtual int GetPkcs10Request(_tds__GetPkcs10Request *tds__GetPkcs10Request, _tds__GetPkcs10RequestResponse &tds__GetPkcs10RequestResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'LoadCertificates' implementation, should return SOAP_OK or error code
|
||||
virtual int LoadCertificates(_tds__LoadCertificates *tds__LoadCertificates, _tds__LoadCertificatesResponse &tds__LoadCertificatesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetClientCertificateMode' implementation, should return SOAP_OK or error code
|
||||
virtual int GetClientCertificateMode(_tds__GetClientCertificateMode *tds__GetClientCertificateMode, _tds__GetClientCertificateModeResponse &tds__GetClientCertificateModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetClientCertificateMode' implementation, should return SOAP_OK or error code
|
||||
virtual int SetClientCertificateMode(_tds__SetClientCertificateMode *tds__SetClientCertificateMode, _tds__SetClientCertificateModeResponse &tds__SetClientCertificateModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetRelayOutputs' implementation, should return SOAP_OK or error code
|
||||
virtual int GetRelayOutputs(_tds__GetRelayOutputs *tds__GetRelayOutputs, _tds__GetRelayOutputsResponse &tds__GetRelayOutputsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetRelayOutputSettings' implementation, should return SOAP_OK or error code
|
||||
virtual int SetRelayOutputSettings(_tds__SetRelayOutputSettings *tds__SetRelayOutputSettings, _tds__SetRelayOutputSettingsResponse &tds__SetRelayOutputSettingsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetRelayOutputState' implementation, should return SOAP_OK or error code
|
||||
virtual int SetRelayOutputState(_tds__SetRelayOutputState *tds__SetRelayOutputState, _tds__SetRelayOutputStateResponse &tds__SetRelayOutputStateResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SendAuxiliaryCommand' implementation, should return SOAP_OK or error code
|
||||
virtual int SendAuxiliaryCommand(_tds__SendAuxiliaryCommand *tds__SendAuxiliaryCommand, _tds__SendAuxiliaryCommandResponse &tds__SendAuxiliaryCommandResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCACertificates' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCACertificates(_tds__GetCACertificates *tds__GetCACertificates, _tds__GetCACertificatesResponse &tds__GetCACertificatesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'LoadCertificateWithPrivateKey' implementation, should return SOAP_OK or error code
|
||||
virtual int LoadCertificateWithPrivateKey(_tds__LoadCertificateWithPrivateKey *tds__LoadCertificateWithPrivateKey, _tds__LoadCertificateWithPrivateKeyResponse &tds__LoadCertificateWithPrivateKeyResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCertificateInformation' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCertificateInformation(_tds__GetCertificateInformation *tds__GetCertificateInformation, _tds__GetCertificateInformationResponse &tds__GetCertificateInformationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'LoadCACertificates' implementation, should return SOAP_OK or error code
|
||||
virtual int LoadCACertificates(_tds__LoadCACertificates *tds__LoadCACertificates, _tds__LoadCACertificatesResponse &tds__LoadCACertificatesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateDot1XConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateDot1XConfiguration(_tds__CreateDot1XConfiguration *tds__CreateDot1XConfiguration, _tds__CreateDot1XConfigurationResponse &tds__CreateDot1XConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetDot1XConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetDot1XConfiguration(_tds__SetDot1XConfiguration *tds__SetDot1XConfiguration, _tds__SetDot1XConfigurationResponse &tds__SetDot1XConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDot1XConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDot1XConfiguration(_tds__GetDot1XConfiguration *tds__GetDot1XConfiguration, _tds__GetDot1XConfigurationResponse &tds__GetDot1XConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDot1XConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDot1XConfigurations(_tds__GetDot1XConfigurations *tds__GetDot1XConfigurations, _tds__GetDot1XConfigurationsResponse &tds__GetDot1XConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteDot1XConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteDot1XConfiguration(_tds__DeleteDot1XConfiguration *tds__DeleteDot1XConfiguration, _tds__DeleteDot1XConfigurationResponse &tds__DeleteDot1XConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDot11Capabilities' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDot11Capabilities(_tds__GetDot11Capabilities *tds__GetDot11Capabilities, _tds__GetDot11CapabilitiesResponse &tds__GetDot11CapabilitiesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetDot11Status' implementation, should return SOAP_OK or error code
|
||||
virtual int GetDot11Status(_tds__GetDot11Status *tds__GetDot11Status, _tds__GetDot11StatusResponse &tds__GetDot11StatusResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'ScanAvailableDot11Networks' implementation, should return SOAP_OK or error code
|
||||
virtual int ScanAvailableDot11Networks(_tds__ScanAvailableDot11Networks *tds__ScanAvailableDot11Networks, _tds__ScanAvailableDot11NetworksResponse &tds__ScanAvailableDot11NetworksResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSystemUris' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSystemUris(_tds__GetSystemUris *tds__GetSystemUris, _tds__GetSystemUrisResponse &tds__GetSystemUrisResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'StartFirmwareUpgrade' implementation, should return SOAP_OK or error code
|
||||
virtual int StartFirmwareUpgrade(_tds__StartFirmwareUpgrade *tds__StartFirmwareUpgrade, _tds__StartFirmwareUpgradeResponse &tds__StartFirmwareUpgradeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'StartSystemRestore' implementation, should return SOAP_OK or error code
|
||||
virtual int StartSystemRestore(_tds__StartSystemRestore *tds__StartSystemRestore, _tds__StartSystemRestoreResponse &tds__StartSystemRestoreResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetStorageConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetStorageConfigurations(_tds__GetStorageConfigurations *tds__GetStorageConfigurations, _tds__GetStorageConfigurationsResponse &tds__GetStorageConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateStorageConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateStorageConfiguration(_tds__CreateStorageConfiguration *tds__CreateStorageConfiguration, _tds__CreateStorageConfigurationResponse &tds__CreateStorageConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetStorageConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetStorageConfiguration(_tds__GetStorageConfiguration *tds__GetStorageConfiguration, _tds__GetStorageConfigurationResponse &tds__GetStorageConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetStorageConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetStorageConfiguration(_tds__SetStorageConfiguration *tds__SetStorageConfiguration, _tds__SetStorageConfigurationResponse &tds__SetStorageConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteStorageConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteStorageConfiguration(_tds__DeleteStorageConfiguration *tds__DeleteStorageConfiguration, _tds__DeleteStorageConfigurationResponse &tds__DeleteStorageConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetGeoLocation' implementation, should return SOAP_OK or error code
|
||||
virtual int GetGeoLocation(_tds__GetGeoLocation *tds__GetGeoLocation, _tds__GetGeoLocationResponse &tds__GetGeoLocationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetGeoLocation' implementation, should return SOAP_OK or error code
|
||||
virtual int SetGeoLocation(_tds__SetGeoLocation *tds__SetGeoLocation, _tds__SetGeoLocationResponse &tds__SetGeoLocationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteGeoLocation' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteGeoLocation(_tds__DeleteGeoLocation *tds__DeleteGeoLocation, _tds__DeleteGeoLocationResponse &tds__DeleteGeoLocationResponse) SOAP_PURE_VIRTUAL;
|
||||
};
|
||||
#endif
|
||||
155284
examples/camera_onvif_server/generated/soapH.h
Normal file
155284
examples/camera_onvif_server/generated/soapH.h
Normal file
File diff suppressed because it is too large
Load Diff
3750
examples/camera_onvif_server/generated/soapMediaBindingService.cpp
Normal file
3750
examples/camera_onvif_server/generated/soapMediaBindingService.cpp
Normal file
File diff suppressed because it is too large
Load Diff
337
examples/camera_onvif_server/generated/soapMediaBindingService.h
Normal file
337
examples/camera_onvif_server/generated/soapMediaBindingService.h
Normal file
@@ -0,0 +1,337 @@
|
||||
/* soapMediaBindingService.h
|
||||
Generated by gSOAP 2.8.92 for /home/sipeed/onvif_srvd/generated/onvif.h
|
||||
|
||||
gSOAP XML Web services tools
|
||||
Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved.
|
||||
The soapcpp2 tool and its generated software are released under the GPL.
|
||||
This program is released under the GPL with the additional exemption that
|
||||
compiling, linking, and/or using OpenSSL is allowed.
|
||||
--------------------------------------------------------------------------------
|
||||
A commercial use license is available from Genivia Inc., contact@genivia.com
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef soapMediaBindingService_H
|
||||
#define soapMediaBindingService_H
|
||||
#include "soapH.h"
|
||||
|
||||
class SOAP_CMAC MediaBindingService {
|
||||
public:
|
||||
/// Context to manage service IO and data
|
||||
struct soap *soap;
|
||||
/// flag indicating that this context is owned by this service and should be deleted by the destructor
|
||||
bool soap_own;
|
||||
/// Variables globally declared in /home/sipeed/onvif_srvd/generated/onvif.h, if any
|
||||
/// Construct a service with new managing context
|
||||
MediaBindingService();
|
||||
/// Copy constructor
|
||||
MediaBindingService(const MediaBindingService&);
|
||||
/// Construct service given a shared managing context
|
||||
MediaBindingService(struct soap*);
|
||||
/// Constructor taking input+output mode flags for the new managing context
|
||||
MediaBindingService(soap_mode iomode);
|
||||
/// Constructor taking input and output mode flags for the new managing context
|
||||
MediaBindingService(soap_mode imode, soap_mode omode);
|
||||
/// Destructor deletes deserialized data and its managing context, when the context was allocated by the constructor
|
||||
virtual ~MediaBindingService();
|
||||
/// Delete all deserialized data (with soap_destroy() and soap_end())
|
||||
virtual void destroy();
|
||||
/// Delete all deserialized data and reset to defaults
|
||||
virtual void reset();
|
||||
/// Initializer used by constructors
|
||||
virtual void MediaBindingService_init(soap_mode imode, soap_mode omode);
|
||||
/// Return a copy that has a new managing context with the same engine state
|
||||
virtual MediaBindingService *copy() SOAP_PURE_VIRTUAL_COPY;
|
||||
/// Copy assignment
|
||||
MediaBindingService& operator=(const MediaBindingService&);
|
||||
/// Close connection (normally automatic)
|
||||
virtual int soap_close_socket();
|
||||
/// Force close connection (can kill a thread blocked on IO)
|
||||
virtual int soap_force_close_socket();
|
||||
/// Return sender-related fault to sender
|
||||
virtual int soap_senderfault(const char *string, const char *detailXML);
|
||||
/// Return sender-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault to sender
|
||||
virtual int soap_receiverfault(const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Print fault
|
||||
virtual void soap_print_fault(FILE*);
|
||||
#ifndef WITH_LEAN
|
||||
#ifndef WITH_COMPAT
|
||||
/// Print fault to stream
|
||||
virtual void soap_stream_fault(std::ostream&);
|
||||
#endif
|
||||
/// Write fault to buffer
|
||||
virtual char *soap_sprint_fault(char *buf, size_t len);
|
||||
#endif
|
||||
/// Disables and removes SOAP Header from message by setting soap->header = NULL
|
||||
virtual void soap_noheader();
|
||||
/// Add SOAP Header to message
|
||||
virtual void soap_header(char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action, struct chan__ChannelInstanceType *chan__ChannelInstance, struct _wsse__Security *wsse__Security);
|
||||
/// Get SOAP Header structure (i.e. soap->header, which is NULL when absent)
|
||||
virtual ::SOAP_ENV__Header *soap_header();
|
||||
#ifndef WITH_NOIO
|
||||
/// Run simple single-thread (iterative, non-SSL) service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int run(int port, int backlog = 1);
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// Run simple single-thread SSL service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int ssl_run(int port, int backlog = 1);
|
||||
#endif
|
||||
/// Bind service to port (returns master socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET bind(const char *host, int port, int backlog);
|
||||
/// Accept next request (returns socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET accept();
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// When SSL is used, after accept() should perform and accept SSL handshake
|
||||
virtual int ssl_accept();
|
||||
#endif
|
||||
#endif
|
||||
/// After accept() serve the pending request (returns SOAP_OK or error code)
|
||||
virtual int serve();
|
||||
/// Used by serve() to dispatch a pending request (returns SOAP_OK or error code)
|
||||
virtual int dispatch();
|
||||
virtual int dispatch(struct soap *soap);
|
||||
//
|
||||
// Service operations are listed below: you should define these
|
||||
// Note: compile with -DWITH_PURE_VIRTUAL to declare pure virtual methods
|
||||
//
|
||||
/// Web service operation 'GetServiceCapabilities' implementation, should return SOAP_OK or error code
|
||||
virtual int GetServiceCapabilities(_trt__GetServiceCapabilities *trt__GetServiceCapabilities, _trt__GetServiceCapabilitiesResponse &trt__GetServiceCapabilitiesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoSources' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoSources(_trt__GetVideoSources *trt__GetVideoSources, _trt__GetVideoSourcesResponse &trt__GetVideoSourcesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioSources' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioSources(_trt__GetAudioSources *trt__GetAudioSources, _trt__GetAudioSourcesResponse &trt__GetAudioSourcesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioOutputs' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioOutputs(_trt__GetAudioOutputs *trt__GetAudioOutputs, _trt__GetAudioOutputsResponse &trt__GetAudioOutputsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateProfile' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateProfile(_trt__CreateProfile *trt__CreateProfile, _trt__CreateProfileResponse &trt__CreateProfileResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetProfile' implementation, should return SOAP_OK or error code
|
||||
virtual int GetProfile(_trt__GetProfile *trt__GetProfile, _trt__GetProfileResponse &trt__GetProfileResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetProfiles' implementation, should return SOAP_OK or error code
|
||||
virtual int GetProfiles(_trt__GetProfiles *trt__GetProfiles, _trt__GetProfilesResponse &trt__GetProfilesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddVideoEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddVideoEncoderConfiguration(_trt__AddVideoEncoderConfiguration *trt__AddVideoEncoderConfiguration, _trt__AddVideoEncoderConfigurationResponse &trt__AddVideoEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddVideoSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddVideoSourceConfiguration(_trt__AddVideoSourceConfiguration *trt__AddVideoSourceConfiguration, _trt__AddVideoSourceConfigurationResponse &trt__AddVideoSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddAudioEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddAudioEncoderConfiguration(_trt__AddAudioEncoderConfiguration *trt__AddAudioEncoderConfiguration, _trt__AddAudioEncoderConfigurationResponse &trt__AddAudioEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddAudioSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddAudioSourceConfiguration(_trt__AddAudioSourceConfiguration *trt__AddAudioSourceConfiguration, _trt__AddAudioSourceConfigurationResponse &trt__AddAudioSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddPTZConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddPTZConfiguration(_trt__AddPTZConfiguration *trt__AddPTZConfiguration, _trt__AddPTZConfigurationResponse &trt__AddPTZConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddVideoAnalyticsConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddVideoAnalyticsConfiguration(_trt__AddVideoAnalyticsConfiguration *trt__AddVideoAnalyticsConfiguration, _trt__AddVideoAnalyticsConfigurationResponse &trt__AddVideoAnalyticsConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddMetadataConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddMetadataConfiguration(_trt__AddMetadataConfiguration *trt__AddMetadataConfiguration, _trt__AddMetadataConfigurationResponse &trt__AddMetadataConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddAudioOutputConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddAudioOutputConfiguration(_trt__AddAudioOutputConfiguration *trt__AddAudioOutputConfiguration, _trt__AddAudioOutputConfigurationResponse &trt__AddAudioOutputConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AddAudioDecoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int AddAudioDecoderConfiguration(_trt__AddAudioDecoderConfiguration *trt__AddAudioDecoderConfiguration, _trt__AddAudioDecoderConfigurationResponse &trt__AddAudioDecoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveVideoEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveVideoEncoderConfiguration(_trt__RemoveVideoEncoderConfiguration *trt__RemoveVideoEncoderConfiguration, _trt__RemoveVideoEncoderConfigurationResponse &trt__RemoveVideoEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveVideoSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveVideoSourceConfiguration(_trt__RemoveVideoSourceConfiguration *trt__RemoveVideoSourceConfiguration, _trt__RemoveVideoSourceConfigurationResponse &trt__RemoveVideoSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveAudioEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveAudioEncoderConfiguration(_trt__RemoveAudioEncoderConfiguration *trt__RemoveAudioEncoderConfiguration, _trt__RemoveAudioEncoderConfigurationResponse &trt__RemoveAudioEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveAudioSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveAudioSourceConfiguration(_trt__RemoveAudioSourceConfiguration *trt__RemoveAudioSourceConfiguration, _trt__RemoveAudioSourceConfigurationResponse &trt__RemoveAudioSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemovePTZConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemovePTZConfiguration(_trt__RemovePTZConfiguration *trt__RemovePTZConfiguration, _trt__RemovePTZConfigurationResponse &trt__RemovePTZConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveVideoAnalyticsConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveVideoAnalyticsConfiguration(_trt__RemoveVideoAnalyticsConfiguration *trt__RemoveVideoAnalyticsConfiguration, _trt__RemoveVideoAnalyticsConfigurationResponse &trt__RemoveVideoAnalyticsConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveMetadataConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveMetadataConfiguration(_trt__RemoveMetadataConfiguration *trt__RemoveMetadataConfiguration, _trt__RemoveMetadataConfigurationResponse &trt__RemoveMetadataConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveAudioOutputConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveAudioOutputConfiguration(_trt__RemoveAudioOutputConfiguration *trt__RemoveAudioOutputConfiguration, _trt__RemoveAudioOutputConfigurationResponse &trt__RemoveAudioOutputConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemoveAudioDecoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int RemoveAudioDecoderConfiguration(_trt__RemoveAudioDecoderConfiguration *trt__RemoveAudioDecoderConfiguration, _trt__RemoveAudioDecoderConfigurationResponse &trt__RemoveAudioDecoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteProfile' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteProfile(_trt__DeleteProfile *trt__DeleteProfile, _trt__DeleteProfileResponse &trt__DeleteProfileResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoSourceConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoSourceConfigurations(_trt__GetVideoSourceConfigurations *trt__GetVideoSourceConfigurations, _trt__GetVideoSourceConfigurationsResponse &trt__GetVideoSourceConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoEncoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoEncoderConfigurations(_trt__GetVideoEncoderConfigurations *trt__GetVideoEncoderConfigurations, _trt__GetVideoEncoderConfigurationsResponse &trt__GetVideoEncoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioSourceConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioSourceConfigurations(_trt__GetAudioSourceConfigurations *trt__GetAudioSourceConfigurations, _trt__GetAudioSourceConfigurationsResponse &trt__GetAudioSourceConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioEncoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioEncoderConfigurations(_trt__GetAudioEncoderConfigurations *trt__GetAudioEncoderConfigurations, _trt__GetAudioEncoderConfigurationsResponse &trt__GetAudioEncoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoAnalyticsConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoAnalyticsConfigurations(_trt__GetVideoAnalyticsConfigurations *trt__GetVideoAnalyticsConfigurations, _trt__GetVideoAnalyticsConfigurationsResponse &trt__GetVideoAnalyticsConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetMetadataConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetMetadataConfigurations(_trt__GetMetadataConfigurations *trt__GetMetadataConfigurations, _trt__GetMetadataConfigurationsResponse &trt__GetMetadataConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioOutputConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioOutputConfigurations(_trt__GetAudioOutputConfigurations *trt__GetAudioOutputConfigurations, _trt__GetAudioOutputConfigurationsResponse &trt__GetAudioOutputConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioDecoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioDecoderConfigurations(_trt__GetAudioDecoderConfigurations *trt__GetAudioDecoderConfigurations, _trt__GetAudioDecoderConfigurationsResponse &trt__GetAudioDecoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoSourceConfiguration(_trt__GetVideoSourceConfiguration *trt__GetVideoSourceConfiguration, _trt__GetVideoSourceConfigurationResponse &trt__GetVideoSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoEncoderConfiguration(_trt__GetVideoEncoderConfiguration *trt__GetVideoEncoderConfiguration, _trt__GetVideoEncoderConfigurationResponse &trt__GetVideoEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioSourceConfiguration(_trt__GetAudioSourceConfiguration *trt__GetAudioSourceConfiguration, _trt__GetAudioSourceConfigurationResponse &trt__GetAudioSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioEncoderConfiguration(_trt__GetAudioEncoderConfiguration *trt__GetAudioEncoderConfiguration, _trt__GetAudioEncoderConfigurationResponse &trt__GetAudioEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoAnalyticsConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoAnalyticsConfiguration(_trt__GetVideoAnalyticsConfiguration *trt__GetVideoAnalyticsConfiguration, _trt__GetVideoAnalyticsConfigurationResponse &trt__GetVideoAnalyticsConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetMetadataConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetMetadataConfiguration(_trt__GetMetadataConfiguration *trt__GetMetadataConfiguration, _trt__GetMetadataConfigurationResponse &trt__GetMetadataConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioOutputConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioOutputConfiguration(_trt__GetAudioOutputConfiguration *trt__GetAudioOutputConfiguration, _trt__GetAudioOutputConfigurationResponse &trt__GetAudioOutputConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioDecoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioDecoderConfiguration(_trt__GetAudioDecoderConfiguration *trt__GetAudioDecoderConfiguration, _trt__GetAudioDecoderConfigurationResponse &trt__GetAudioDecoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleVideoEncoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleVideoEncoderConfigurations(_trt__GetCompatibleVideoEncoderConfigurations *trt__GetCompatibleVideoEncoderConfigurations, _trt__GetCompatibleVideoEncoderConfigurationsResponse &trt__GetCompatibleVideoEncoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleVideoSourceConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleVideoSourceConfigurations(_trt__GetCompatibleVideoSourceConfigurations *trt__GetCompatibleVideoSourceConfigurations, _trt__GetCompatibleVideoSourceConfigurationsResponse &trt__GetCompatibleVideoSourceConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleAudioEncoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleAudioEncoderConfigurations(_trt__GetCompatibleAudioEncoderConfigurations *trt__GetCompatibleAudioEncoderConfigurations, _trt__GetCompatibleAudioEncoderConfigurationsResponse &trt__GetCompatibleAudioEncoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleAudioSourceConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleAudioSourceConfigurations(_trt__GetCompatibleAudioSourceConfigurations *trt__GetCompatibleAudioSourceConfigurations, _trt__GetCompatibleAudioSourceConfigurationsResponse &trt__GetCompatibleAudioSourceConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleVideoAnalyticsConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleVideoAnalyticsConfigurations(_trt__GetCompatibleVideoAnalyticsConfigurations *trt__GetCompatibleVideoAnalyticsConfigurations, _trt__GetCompatibleVideoAnalyticsConfigurationsResponse &trt__GetCompatibleVideoAnalyticsConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleMetadataConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleMetadataConfigurations(_trt__GetCompatibleMetadataConfigurations *trt__GetCompatibleMetadataConfigurations, _trt__GetCompatibleMetadataConfigurationsResponse &trt__GetCompatibleMetadataConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleAudioOutputConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleAudioOutputConfigurations(_trt__GetCompatibleAudioOutputConfigurations *trt__GetCompatibleAudioOutputConfigurations, _trt__GetCompatibleAudioOutputConfigurationsResponse &trt__GetCompatibleAudioOutputConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleAudioDecoderConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleAudioDecoderConfigurations(_trt__GetCompatibleAudioDecoderConfigurations *trt__GetCompatibleAudioDecoderConfigurations, _trt__GetCompatibleAudioDecoderConfigurationsResponse &trt__GetCompatibleAudioDecoderConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetVideoSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetVideoSourceConfiguration(_trt__SetVideoSourceConfiguration *trt__SetVideoSourceConfiguration, _trt__SetVideoSourceConfigurationResponse &trt__SetVideoSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetVideoEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetVideoEncoderConfiguration(_trt__SetVideoEncoderConfiguration *trt__SetVideoEncoderConfiguration, _trt__SetVideoEncoderConfigurationResponse &trt__SetVideoEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetAudioSourceConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetAudioSourceConfiguration(_trt__SetAudioSourceConfiguration *trt__SetAudioSourceConfiguration, _trt__SetAudioSourceConfigurationResponse &trt__SetAudioSourceConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetAudioEncoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetAudioEncoderConfiguration(_trt__SetAudioEncoderConfiguration *trt__SetAudioEncoderConfiguration, _trt__SetAudioEncoderConfigurationResponse &trt__SetAudioEncoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetVideoAnalyticsConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetVideoAnalyticsConfiguration(_trt__SetVideoAnalyticsConfiguration *trt__SetVideoAnalyticsConfiguration, _trt__SetVideoAnalyticsConfigurationResponse &trt__SetVideoAnalyticsConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetMetadataConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetMetadataConfiguration(_trt__SetMetadataConfiguration *trt__SetMetadataConfiguration, _trt__SetMetadataConfigurationResponse &trt__SetMetadataConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetAudioOutputConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetAudioOutputConfiguration(_trt__SetAudioOutputConfiguration *trt__SetAudioOutputConfiguration, _trt__SetAudioOutputConfigurationResponse &trt__SetAudioOutputConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetAudioDecoderConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetAudioDecoderConfiguration(_trt__SetAudioDecoderConfiguration *trt__SetAudioDecoderConfiguration, _trt__SetAudioDecoderConfigurationResponse &trt__SetAudioDecoderConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoSourceConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoSourceConfigurationOptions(_trt__GetVideoSourceConfigurationOptions *trt__GetVideoSourceConfigurationOptions, _trt__GetVideoSourceConfigurationOptionsResponse &trt__GetVideoSourceConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoEncoderConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoEncoderConfigurationOptions(_trt__GetVideoEncoderConfigurationOptions *trt__GetVideoEncoderConfigurationOptions, _trt__GetVideoEncoderConfigurationOptionsResponse &trt__GetVideoEncoderConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioSourceConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioSourceConfigurationOptions(_trt__GetAudioSourceConfigurationOptions *trt__GetAudioSourceConfigurationOptions, _trt__GetAudioSourceConfigurationOptionsResponse &trt__GetAudioSourceConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioEncoderConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioEncoderConfigurationOptions(_trt__GetAudioEncoderConfigurationOptions *trt__GetAudioEncoderConfigurationOptions, _trt__GetAudioEncoderConfigurationOptionsResponse &trt__GetAudioEncoderConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetMetadataConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetMetadataConfigurationOptions(_trt__GetMetadataConfigurationOptions *trt__GetMetadataConfigurationOptions, _trt__GetMetadataConfigurationOptionsResponse &trt__GetMetadataConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioOutputConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioOutputConfigurationOptions(_trt__GetAudioOutputConfigurationOptions *trt__GetAudioOutputConfigurationOptions, _trt__GetAudioOutputConfigurationOptionsResponse &trt__GetAudioOutputConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetAudioDecoderConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetAudioDecoderConfigurationOptions(_trt__GetAudioDecoderConfigurationOptions *trt__GetAudioDecoderConfigurationOptions, _trt__GetAudioDecoderConfigurationOptionsResponse &trt__GetAudioDecoderConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetGuaranteedNumberOfVideoEncoderInstances' implementation, should return SOAP_OK or error code
|
||||
virtual int GetGuaranteedNumberOfVideoEncoderInstances(_trt__GetGuaranteedNumberOfVideoEncoderInstances *trt__GetGuaranteedNumberOfVideoEncoderInstances, _trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse &trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetStreamUri' implementation, should return SOAP_OK or error code
|
||||
virtual int GetStreamUri(_trt__GetStreamUri *trt__GetStreamUri, _trt__GetStreamUriResponse &trt__GetStreamUriResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'StartMulticastStreaming' implementation, should return SOAP_OK or error code
|
||||
virtual int StartMulticastStreaming(_trt__StartMulticastStreaming *trt__StartMulticastStreaming, _trt__StartMulticastStreamingResponse &trt__StartMulticastStreamingResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'StopMulticastStreaming' implementation, should return SOAP_OK or error code
|
||||
virtual int StopMulticastStreaming(_trt__StopMulticastStreaming *trt__StopMulticastStreaming, _trt__StopMulticastStreamingResponse &trt__StopMulticastStreamingResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetSynchronizationPoint' implementation, should return SOAP_OK or error code
|
||||
virtual int SetSynchronizationPoint(_trt__SetSynchronizationPoint *trt__SetSynchronizationPoint, _trt__SetSynchronizationPointResponse &trt__SetSynchronizationPointResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetSnapshotUri' implementation, should return SOAP_OK or error code
|
||||
virtual int GetSnapshotUri(_trt__GetSnapshotUri *trt__GetSnapshotUri, _trt__GetSnapshotUriResponse &trt__GetSnapshotUriResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetVideoSourceModes' implementation, should return SOAP_OK or error code
|
||||
virtual int GetVideoSourceModes(_trt__GetVideoSourceModes *trt__GetVideoSourceModes, _trt__GetVideoSourceModesResponse &trt__GetVideoSourceModesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetVideoSourceMode' implementation, should return SOAP_OK or error code
|
||||
virtual int SetVideoSourceMode(_trt__SetVideoSourceMode *trt__SetVideoSourceMode, _trt__SetVideoSourceModeResponse &trt__SetVideoSourceModeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetOSDs' implementation, should return SOAP_OK or error code
|
||||
virtual int GetOSDs(_trt__GetOSDs *trt__GetOSDs, _trt__GetOSDsResponse &trt__GetOSDsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetOSD' implementation, should return SOAP_OK or error code
|
||||
virtual int GetOSD(_trt__GetOSD *trt__GetOSD, _trt__GetOSDResponse &trt__GetOSDResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetOSDOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetOSDOptions(_trt__GetOSDOptions *trt__GetOSDOptions, _trt__GetOSDOptionsResponse &trt__GetOSDOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetOSD' implementation, should return SOAP_OK or error code
|
||||
virtual int SetOSD(_trt__SetOSD *trt__SetOSD, _trt__SetOSDResponse &trt__SetOSDResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreateOSD' implementation, should return SOAP_OK or error code
|
||||
virtual int CreateOSD(_trt__CreateOSD *trt__CreateOSD, _trt__CreateOSDResponse &trt__CreateOSDResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'DeleteOSD' implementation, should return SOAP_OK or error code
|
||||
virtual int DeleteOSD(_trt__DeleteOSD *trt__DeleteOSD, _trt__DeleteOSDResponse &trt__DeleteOSDResponse) SOAP_PURE_VIRTUAL;
|
||||
};
|
||||
#endif
|
||||
1462
examples/camera_onvif_server/generated/soapPTZBindingService.cpp
Normal file
1462
examples/camera_onvif_server/generated/soapPTZBindingService.cpp
Normal file
File diff suppressed because it is too large
Load Diff
181
examples/camera_onvif_server/generated/soapPTZBindingService.h
Normal file
181
examples/camera_onvif_server/generated/soapPTZBindingService.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/* soapPTZBindingService.h
|
||||
Generated by gSOAP 2.8.92 for /home/sipeed/onvif_srvd/generated/onvif.h
|
||||
|
||||
gSOAP XML Web services tools
|
||||
Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved.
|
||||
The soapcpp2 tool and its generated software are released under the GPL.
|
||||
This program is released under the GPL with the additional exemption that
|
||||
compiling, linking, and/or using OpenSSL is allowed.
|
||||
--------------------------------------------------------------------------------
|
||||
A commercial use license is available from Genivia Inc., contact@genivia.com
|
||||
--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef soapPTZBindingService_H
|
||||
#define soapPTZBindingService_H
|
||||
#include "soapH.h"
|
||||
|
||||
class SOAP_CMAC PTZBindingService {
|
||||
public:
|
||||
/// Context to manage service IO and data
|
||||
struct soap *soap;
|
||||
/// flag indicating that this context is owned by this service and should be deleted by the destructor
|
||||
bool soap_own;
|
||||
/// Variables globally declared in /home/sipeed/onvif_srvd/generated/onvif.h, if any
|
||||
/// Construct a service with new managing context
|
||||
PTZBindingService();
|
||||
/// Copy constructor
|
||||
PTZBindingService(const PTZBindingService&);
|
||||
/// Construct service given a shared managing context
|
||||
PTZBindingService(struct soap*);
|
||||
/// Constructor taking input+output mode flags for the new managing context
|
||||
PTZBindingService(soap_mode iomode);
|
||||
/// Constructor taking input and output mode flags for the new managing context
|
||||
PTZBindingService(soap_mode imode, soap_mode omode);
|
||||
/// Destructor deletes deserialized data and its managing context, when the context was allocated by the constructor
|
||||
virtual ~PTZBindingService();
|
||||
/// Delete all deserialized data (with soap_destroy() and soap_end())
|
||||
virtual void destroy();
|
||||
/// Delete all deserialized data and reset to defaults
|
||||
virtual void reset();
|
||||
/// Initializer used by constructors
|
||||
virtual void PTZBindingService_init(soap_mode imode, soap_mode omode);
|
||||
/// Return a copy that has a new managing context with the same engine state
|
||||
virtual PTZBindingService *copy() SOAP_PURE_VIRTUAL_COPY;
|
||||
/// Copy assignment
|
||||
PTZBindingService& operator=(const PTZBindingService&);
|
||||
/// Close connection (normally automatic)
|
||||
virtual int soap_close_socket();
|
||||
/// Force close connection (can kill a thread blocked on IO)
|
||||
virtual int soap_force_close_socket();
|
||||
/// Return sender-related fault to sender
|
||||
virtual int soap_senderfault(const char *string, const char *detailXML);
|
||||
/// Return sender-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault to sender
|
||||
virtual int soap_receiverfault(const char *string, const char *detailXML);
|
||||
/// Return receiver-related fault with SOAP 1.2 subcode to sender
|
||||
virtual int soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML);
|
||||
/// Print fault
|
||||
virtual void soap_print_fault(FILE*);
|
||||
#ifndef WITH_LEAN
|
||||
#ifndef WITH_COMPAT
|
||||
/// Print fault to stream
|
||||
virtual void soap_stream_fault(std::ostream&);
|
||||
#endif
|
||||
/// Write fault to buffer
|
||||
virtual char *soap_sprint_fault(char *buf, size_t len);
|
||||
#endif
|
||||
/// Disables and removes SOAP Header from message by setting soap->header = NULL
|
||||
virtual void soap_noheader();
|
||||
/// Add SOAP Header to message
|
||||
virtual void soap_header(char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action, struct chan__ChannelInstanceType *chan__ChannelInstance, struct _wsse__Security *wsse__Security);
|
||||
/// Get SOAP Header structure (i.e. soap->header, which is NULL when absent)
|
||||
virtual ::SOAP_ENV__Header *soap_header();
|
||||
#ifndef WITH_NOIO
|
||||
/// Run simple single-thread (iterative, non-SSL) service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int run(int port, int backlog = 1);
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// Run simple single-thread SSL service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
|
||||
virtual int ssl_run(int port, int backlog = 1);
|
||||
#endif
|
||||
/// Bind service to port (returns master socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET bind(const char *host, int port, int backlog);
|
||||
/// Accept next request (returns socket or SOAP_INVALID_SOCKET upon error)
|
||||
virtual SOAP_SOCKET accept();
|
||||
#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
|
||||
/// When SSL is used, after accept() should perform and accept SSL handshake
|
||||
virtual int ssl_accept();
|
||||
#endif
|
||||
#endif
|
||||
/// After accept() serve the pending request (returns SOAP_OK or error code)
|
||||
virtual int serve();
|
||||
/// Used by serve() to dispatch a pending request (returns SOAP_OK or error code)
|
||||
virtual int dispatch();
|
||||
virtual int dispatch(struct soap *soap);
|
||||
//
|
||||
// Service operations are listed below: you should define these
|
||||
// Note: compile with -DWITH_PURE_VIRTUAL to declare pure virtual methods
|
||||
//
|
||||
/// Web service operation 'GetServiceCapabilities' implementation, should return SOAP_OK or error code
|
||||
virtual int GetServiceCapabilities(_tptz__GetServiceCapabilities *tptz__GetServiceCapabilities, _tptz__GetServiceCapabilitiesResponse &tptz__GetServiceCapabilitiesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetConfigurations(_tptz__GetConfigurations *tptz__GetConfigurations, _tptz__GetConfigurationsResponse &tptz__GetConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetPresets' implementation, should return SOAP_OK or error code
|
||||
virtual int GetPresets(_tptz__GetPresets *tptz__GetPresets, _tptz__GetPresetsResponse &tptz__GetPresetsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetPreset' implementation, should return SOAP_OK or error code
|
||||
virtual int SetPreset(_tptz__SetPreset *tptz__SetPreset, _tptz__SetPresetResponse &tptz__SetPresetResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemovePreset' implementation, should return SOAP_OK or error code
|
||||
virtual int RemovePreset(_tptz__RemovePreset *tptz__RemovePreset, _tptz__RemovePresetResponse &tptz__RemovePresetResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GotoPreset' implementation, should return SOAP_OK or error code
|
||||
virtual int GotoPreset(_tptz__GotoPreset *tptz__GotoPreset, _tptz__GotoPresetResponse &tptz__GotoPresetResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetStatus' implementation, should return SOAP_OK or error code
|
||||
virtual int GetStatus(_tptz__GetStatus *tptz__GetStatus, _tptz__GetStatusResponse &tptz__GetStatusResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int GetConfiguration(_tptz__GetConfiguration *tptz__GetConfiguration, _tptz__GetConfigurationResponse &tptz__GetConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNodes' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNodes(_tptz__GetNodes *tptz__GetNodes, _tptz__GetNodesResponse &tptz__GetNodesResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetNode' implementation, should return SOAP_OK or error code
|
||||
virtual int GetNode(_tptz__GetNode *tptz__GetNode, _tptz__GetNodeResponse &tptz__GetNodeResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetConfiguration' implementation, should return SOAP_OK or error code
|
||||
virtual int SetConfiguration(_tptz__SetConfiguration *tptz__SetConfiguration, _tptz__SetConfigurationResponse &tptz__SetConfigurationResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetConfigurationOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetConfigurationOptions(_tptz__GetConfigurationOptions *tptz__GetConfigurationOptions, _tptz__GetConfigurationOptionsResponse &tptz__GetConfigurationOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GotoHomePosition' implementation, should return SOAP_OK or error code
|
||||
virtual int GotoHomePosition(_tptz__GotoHomePosition *tptz__GotoHomePosition, _tptz__GotoHomePositionResponse &tptz__GotoHomePositionResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SetHomePosition' implementation, should return SOAP_OK or error code
|
||||
virtual int SetHomePosition(_tptz__SetHomePosition *tptz__SetHomePosition, _tptz__SetHomePositionResponse &tptz__SetHomePositionResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'ContinuousMove' implementation, should return SOAP_OK or error code
|
||||
virtual int ContinuousMove(_tptz__ContinuousMove *tptz__ContinuousMove, _tptz__ContinuousMoveResponse &tptz__ContinuousMoveResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RelativeMove' implementation, should return SOAP_OK or error code
|
||||
virtual int RelativeMove(_tptz__RelativeMove *tptz__RelativeMove, _tptz__RelativeMoveResponse &tptz__RelativeMoveResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'SendAuxiliaryCommand' implementation, should return SOAP_OK or error code
|
||||
virtual int SendAuxiliaryCommand(_tptz__SendAuxiliaryCommand *tptz__SendAuxiliaryCommand, _tptz__SendAuxiliaryCommandResponse &tptz__SendAuxiliaryCommandResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'AbsoluteMove' implementation, should return SOAP_OK or error code
|
||||
virtual int AbsoluteMove(_tptz__AbsoluteMove *tptz__AbsoluteMove, _tptz__AbsoluteMoveResponse &tptz__AbsoluteMoveResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'Stop' implementation, should return SOAP_OK or error code
|
||||
virtual int Stop(_tptz__Stop *tptz__Stop, _tptz__StopResponse &tptz__StopResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetPresetTours' implementation, should return SOAP_OK or error code
|
||||
virtual int GetPresetTours(_tptz__GetPresetTours *tptz__GetPresetTours, _tptz__GetPresetToursResponse &tptz__GetPresetToursResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetPresetTour' implementation, should return SOAP_OK or error code
|
||||
virtual int GetPresetTour(_tptz__GetPresetTour *tptz__GetPresetTour, _tptz__GetPresetTourResponse &tptz__GetPresetTourResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetPresetTourOptions' implementation, should return SOAP_OK or error code
|
||||
virtual int GetPresetTourOptions(_tptz__GetPresetTourOptions *tptz__GetPresetTourOptions, _tptz__GetPresetTourOptionsResponse &tptz__GetPresetTourOptionsResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'CreatePresetTour' implementation, should return SOAP_OK or error code
|
||||
virtual int CreatePresetTour(_tptz__CreatePresetTour *tptz__CreatePresetTour, _tptz__CreatePresetTourResponse &tptz__CreatePresetTourResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'ModifyPresetTour' implementation, should return SOAP_OK or error code
|
||||
virtual int ModifyPresetTour(_tptz__ModifyPresetTour *tptz__ModifyPresetTour, _tptz__ModifyPresetTourResponse &tptz__ModifyPresetTourResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'OperatePresetTour' implementation, should return SOAP_OK or error code
|
||||
virtual int OperatePresetTour(_tptz__OperatePresetTour *tptz__OperatePresetTour, _tptz__OperatePresetTourResponse &tptz__OperatePresetTourResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'RemovePresetTour' implementation, should return SOAP_OK or error code
|
||||
virtual int RemovePresetTour(_tptz__RemovePresetTour *tptz__RemovePresetTour, _tptz__RemovePresetTourResponse &tptz__RemovePresetTourResponse) SOAP_PURE_VIRTUAL;
|
||||
//
|
||||
/// Web service operation 'GetCompatibleConfigurations' implementation, should return SOAP_OK or error code
|
||||
virtual int GetCompatibleConfigurations(_tptz__GetCompatibleConfigurations *tptz__GetCompatibleConfigurations, _tptz__GetCompatibleConfigurationsResponse &tptz__GetCompatibleConfigurationsResponse) SOAP_PURE_VIRTUAL;
|
||||
};
|
||||
#endif
|
||||
59922
examples/camera_onvif_server/generated/soapStub.h
Normal file
59922
examples/camera_onvif_server/generated/soapStub.h
Normal file
File diff suppressed because it is too large
Load Diff
15
examples/camera_onvif_server/generated/version.h
Normal file
15
examples/camera_onvif_server/generated/version.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef VERSION_HEADER
|
||||
#define VERSION_HEADER
|
||||
|
||||
|
||||
|
||||
#define DAEMON_MAJOR_VERSION 2
|
||||
#define DAEMON_MINOR_VERSION 0
|
||||
#define DAEMON_PATCH_VERSION 29
|
||||
|
||||
#define COMMIT_HASH "df09d0ac77b1"
|
||||
#define COMMIT_ISDIRTY 0
|
||||
|
||||
|
||||
|
||||
#endif //VERSION_HEADER
|
||||
125
examples/camera_onvif_server/main/CMakeLists.txt
Normal file
125
examples/camera_onvif_server/main/CMakeLists.txt
Normal file
@@ -0,0 +1,125 @@
|
||||
set(WSSE_ON 1)
|
||||
set(DAEMON_NAME "onvif_server")
|
||||
# set(DAEMON_MAJOR_VERSION 2)
|
||||
# set(DAEMON_MINOR_VERSION 0)
|
||||
# set(DAEMON_PATCH_VERSION 0)
|
||||
set(DAEMON_PID_FILE_NAME ${DAEMON_NAME}.pid)
|
||||
set(DAEMON_LOG_FILE_NAME ${DAEMON_NAME}.log)
|
||||
set(DAEMON_NO_CHDIR 1)
|
||||
set(DAEMON_NO_CLOSE_STDIO 1)
|
||||
set(gsoap_version_str "${CONFIG_GSOAP_VERSION_MAJOR}.${CONFIG_GSOAP_VERSION_MINOR}")
|
||||
set(GSOAP_INSTALL ${DL_EXTRACTED_PATH}/gsoap_srcs/gsoap-${gsoap_version_str})
|
||||
set(ONVIF_SERVD_INSTALL ${CMAKE_CURRENT_LIST_DIR}/../onvif_srvd)
|
||||
set(GENERATED_INSTALL ${CMAKE_CURRENT_LIST_DIR}/../generated)
|
||||
|
||||
############### Add include ###################
|
||||
list(APPEND ADD_INCLUDE "include"
|
||||
)
|
||||
|
||||
list(APPEND ADD_PRIVATE_INCLUDE ${ONVIF_SERVD_INSTALL}/src/
|
||||
)
|
||||
|
||||
list(APPEND ADD_PRIVATE_INCLUDE ${GSOAP_INSTALL}/gsoap
|
||||
${GSOAP_INSTALL}/gsoap/custom
|
||||
)
|
||||
list(APPEND ADD_PRIVATE_INCLUDE ${GENERATED_INSTALL})
|
||||
|
||||
list(APPEND ADD_PRIVATE_INCLUDE ${GSOAP_INSTALL}/gsoap/plugin)
|
||||
###############################################
|
||||
|
||||
############ Add source files #################
|
||||
append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD_SRCS
|
||||
|
||||
# onvif_srvd
|
||||
append_srcs_dir(ADD_SRCS ${ONVIF_SERVD_INSTALL}/src)
|
||||
|
||||
list(REMOVE_ITEM ADD_SRCS ${ONVIF_SERVD_INSTALL}/src/onvif_srvd.cpp)
|
||||
|
||||
# soap
|
||||
append_srcs_dir(ADD_SRCS ${GENERATED_INSTALL})
|
||||
list(APPEND ADD_SRCS ${GSOAP_INSTALL}/gsoap/custom/duration.c)
|
||||
list(APPEND ADD_SRCS ${GSOAP_INSTALL}/gsoap/dom.cpp
|
||||
${GSOAP_INSTALL}/gsoap/stdsoap2.cpp)
|
||||
if (${WSSE_ON})
|
||||
list(APPEND ADD_SRC ${GSOAP_INSTALL}/gsoap/plugin/wsseapi.c
|
||||
${GSOAP_INSTALL}/gsoap/plugin/mecevp.c
|
||||
${GSOAP_INSTALL}/gsoap/plugin/smdevp.c
|
||||
${GSOAP_INSTALL}/gsoap/plugin/wsaapi.c
|
||||
)
|
||||
endif()
|
||||
SET_PROPERTY(SOURCE ${ADD_SRCS} PROPERTY LANGUAGE CXX)
|
||||
|
||||
# list(REMOVE_ITEM COMPONENT_SRCS "src/test2.c")
|
||||
# FILE(GLOB_RECURSE EXTRA_SRC "src/*.c")
|
||||
# FILE(GLOB EXTRA_SRC "src/*.c")
|
||||
# list(APPEND ADD_SRCS ${EXTRA_SRC})
|
||||
# aux_source_directory(src ADD_SRCS) # collect all source file in src dir, will set var ADD_SRCS
|
||||
# append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD_SRCS
|
||||
# list(REMOVE_ITEM COMPONENT_SRCS "src/test.c")
|
||||
# set(ADD_ASM_SRCS "src/asm.S")
|
||||
# list(APPEND ADD_SRCS ${ADD_ASM_SRCS})
|
||||
# SET_PROPERTY(SOURCE ${ADD_ASM_SRCS} PROPERTY LANGUAGE C) # set .S ASM file as C language
|
||||
# SET_SOURCE_FILES_PROPERTIES(${ADD_ASM_SRCS} PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp -D BBBBB")
|
||||
###############################################
|
||||
|
||||
###### Add required/dependent components ######
|
||||
list(APPEND ADD_REQUIREMENTS basic openssl nn vision)
|
||||
###############################################
|
||||
|
||||
###### Add link search path for requirements/libs ######
|
||||
# list(APPEND ADD_LINK_SEARCH_PATH "${CONFIG_TOOLCHAIN_PATH}/lib")
|
||||
# list(APPEND ADD_REQUIREMENTS pthread m) # add system libs, pthread and math lib for example here
|
||||
# set (OpenCV_DIR opencv/lib/cmake/opencv4)
|
||||
# find_package(OpenCV REQUIRED)
|
||||
###############################################
|
||||
|
||||
############ Add static libs ##################
|
||||
# list(APPEND ADD_STATIC_LIB "lib/libtest.a")
|
||||
###############################################
|
||||
|
||||
#### Add compile option for this component ####
|
||||
#### Just for this component, won't affect other
|
||||
#### modules, including component that depend
|
||||
#### on this component
|
||||
list(APPEND ADD_DEFINITIONS_PRIVATE
|
||||
-DDAEMON_NAME="${DAEMON_NAME}"
|
||||
# -DDAEMON_MAJOR_VERSION=${DAEMON_MAJOR_VERSION}
|
||||
# -DDAEMON_MINOR_VERSION=${DAEMON_MINOR_VERSION}
|
||||
# -DDAEMON_PATCH_VERSION=${DAEMON_PATCH_VERSION}
|
||||
-DDAEMON_PID_FILE_NAME="${DAEMON_PID_FILE_NAME}"
|
||||
-DDAEMON_LOG_FILE_NAME="${DAEMON_LOG_FILE_NAME}"
|
||||
-DDAEMON_NO_CHDIR=${DAEMON_NO_CHDIR}
|
||||
-DDAEMON_NO_CLOSE_STDIO=${DAEMON_NO_CLOSE_STDIO}
|
||||
)
|
||||
if (${WSSE_ON})
|
||||
list(APPEND ADD_DEFINITIONS_PRIVATE -DWITH_OPENSSL -DWITH_DOM)
|
||||
endif()
|
||||
|
||||
#### Add compile option for this component
|
||||
#### and components depend on this component
|
||||
# list(APPEND ADD_DEFINITIONS -DAAAAA222=1
|
||||
# -DAAAAA333=1)
|
||||
###############################################
|
||||
|
||||
############ Add static libs ##################
|
||||
#### Update parent's variables like CMAKE_C_LINK_FLAGS
|
||||
# set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group libmaix/libtest.a -ltest2 -Wl,--end-group" PARENT_SCOPE)
|
||||
###############################################
|
||||
|
||||
######### Add files need to download #########
|
||||
# list(APPEND ADD_FILE_DOWNLOADS "{
|
||||
# 'url': 'https://*****/abcde.tar.xz',
|
||||
# 'urls': [], # backup urls, if url failed, will try urls
|
||||
# 'sites': [], # download site, user can manually download file and put it into dl_path
|
||||
# 'sha256sum': '',
|
||||
# 'filename': 'abcde.tar.xz',
|
||||
# 'path': 'toolchains/xxxxx',
|
||||
# 'check_files': []
|
||||
# }"
|
||||
# )
|
||||
#
|
||||
# then extracted file in ${DL_EXTRACTED_PATH}/toolchains/xxxxx,
|
||||
# you can directly use then, for example use it in add_custom_command
|
||||
##############################################
|
||||
# register component, DYNAMIC or SHARED flags will make component compiled to dynamic(shared) lib
|
||||
register_component()
|
||||
13
examples/camera_onvif_server/main/Kconfig
Normal file
13
examples/camera_onvif_server/main/Kconfig
Normal file
@@ -0,0 +1,13 @@
|
||||
menu "gsoap component configuration"
|
||||
menu "GSOAP version"
|
||||
config GSOAP_VERSION_MAJOR
|
||||
int "GSOAP version major"
|
||||
default 2
|
||||
config GSOAP_VERSION_MINOR
|
||||
int "GSOAP version minor"
|
||||
default 8
|
||||
config GSOAP_VERSION_PATCH
|
||||
int "GSOAP version patch"
|
||||
default 92
|
||||
endmenu
|
||||
endmenu
|
||||
30
examples/camera_onvif_server/main/component.py
Normal file
30
examples/camera_onvif_server/main/component.py
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
def add_file_downloads(confs : dict) -> list:
|
||||
'''
|
||||
@param confs kconfig vars, dict type
|
||||
@return list type, items is dict type
|
||||
'''
|
||||
version0 = f"{confs['CONFIG_GSOAP_VERSION_MAJOR']}.{confs['CONFIG_GSOAP_VERSION_MINOR']}"
|
||||
version = f"{confs['CONFIG_GSOAP_VERSION_MAJOR']}.{confs['CONFIG_GSOAP_VERSION_MINOR']}.{confs['CONFIG_GSOAP_VERSION_PATCH']}"
|
||||
url = f"https://github.com/SrcBackup/gsoap/releases/download/v2.8.x/gsoap_{version}.zip"
|
||||
sha256sum = "bcc77bc8843ae00091d40bbfaee5071665ca2793ac1e8f05de2e2d54a84a7ddb"
|
||||
filename = f"gsoap_{version}.zip"
|
||||
path = "gsoap_srcs"
|
||||
check_file = f'gsoap-{version0}'
|
||||
sites = []
|
||||
|
||||
return [
|
||||
{
|
||||
'url': f'{url}',
|
||||
'urls': [],
|
||||
'sites': sites,
|
||||
'sha256sum': sha256sum,
|
||||
'filename': filename,
|
||||
'path': path,
|
||||
'check_files': [
|
||||
check_file
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
3
examples/camera_onvif_server/main/include/main.h
Normal file
3
examples/camera_onvif_server/main/include/main.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
626
examples/camera_onvif_server/main/src/main.cpp
Normal file
626
examples/camera_onvif_server/main/src/main.cpp
Normal file
@@ -0,0 +1,626 @@
|
||||
|
||||
#include "maix_basic.hpp"
|
||||
#include "main.h"
|
||||
|
||||
using namespace maix;
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "daemon.h"
|
||||
#include "smacros.h"
|
||||
#include "ServiceContext.h"
|
||||
|
||||
// ---- gsoap ----
|
||||
#include "DeviceBinding.nsmap"
|
||||
#include "soapDeviceBindingService.h"
|
||||
#include "soapMediaBindingService.h"
|
||||
#include "soapPTZBindingService.h"
|
||||
// #define DAEMON_NAME "onvif_server"
|
||||
|
||||
|
||||
|
||||
|
||||
static const char *help_str =
|
||||
// " Daemon name: " DAEMON_NAME "\n"
|
||||
" Daemon ver: " DAEMON_VERSION_STR "\n\n"
|
||||
#ifdef DEBUG
|
||||
" Build mode: debug\n"
|
||||
#else
|
||||
" Build mode: release\n"
|
||||
#endif
|
||||
" Build date: " __DATE__ "\n"
|
||||
" Build time: " __TIME__ "\n"
|
||||
#if COMMIT_ISDIRTY == 0
|
||||
" Build hash: " COMMIT_HASH "\n\n"
|
||||
#else
|
||||
" Build hash: *" COMMIT_HASH "\n\n"
|
||||
#endif
|
||||
"Options: description:\n\n"
|
||||
" --no_chdir Don't change the directory to '/'\n"
|
||||
" --no_fork Don't do fork\n"
|
||||
" --no_close Don't close standart IO files\n"
|
||||
" --pid_file [value] Set pid file name\n"
|
||||
" --log_file [value] Set log file name\n\n"
|
||||
" --port [value] Set socket port for Services (default = 1000)\n"
|
||||
" --user [value] Set user name for Services (default = admin)\n"
|
||||
" --password [value] Set user password for Services (default = admin)\n"
|
||||
" --model [value] Set model device for Services (default = Model)\n"
|
||||
" --scope [value] Set scope for Services (default don't set)\n"
|
||||
" --ifs [value] Set Net interfaces for work (default don't set)\n"
|
||||
" --tz_format [value] Set Time Zone Format (default = 0)\n"
|
||||
" --hardware_id [value] Set Hardware ID of device (default = HardwareID)\n"
|
||||
" --serial_num [value] Set Serial number of device (default = SerialNumber)\n"
|
||||
" --firmware_ver [value] Set firmware version of device (default = FirmwareVersion)\n"
|
||||
" --manufacturer [value] Set manufacturer for Services (default = Manufacturer)\n\n"
|
||||
" --name [value] Set Name for Profile Media Services\n"
|
||||
" --width [value] Set Width for Profile Media Services\n"
|
||||
" --height [value] Set Height for Profile Media Services\n"
|
||||
" --url [value] Set URL (or template URL) for Profile Media Services\n"
|
||||
" --snapurl [value] Set URL (or template URL) for Snapshot\n"
|
||||
" in template mode %s will be changed to IP of interface (see opt ifs)\n"
|
||||
" --type [value] Set Type for Profile Media Services (JPEG|MPEG4|H264)\n"
|
||||
" It is also a sign of the end of the profile parameters\n\n"
|
||||
" --ptz Enable PTZ support\n"
|
||||
" --move_left [value] Set process to call for PTZ pan left movement\n"
|
||||
" --move_right [value] Set process to call for PTZ pan right movement\n"
|
||||
" --move_up [value] Set process to call for PTZ tilt up movement\n"
|
||||
" --move_down [value] Set process to call for PTZ tilt down movement\n"
|
||||
" --move_stop [value] Set process to call for PTZ stop movement\n"
|
||||
" --move_preset [value] Set process to call for PTZ goto preset movement\n"
|
||||
" -v, --version Display daemon version\n"
|
||||
" -h, --help Display this help\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// indexes for long_opt function
|
||||
namespace LongOpts
|
||||
{
|
||||
enum
|
||||
{
|
||||
version = 'v',
|
||||
help = 'h',
|
||||
|
||||
//daemon options
|
||||
no_chdir = 1,
|
||||
no_fork,
|
||||
no_close,
|
||||
pid_file,
|
||||
log_file,
|
||||
|
||||
//ONVIF Service options (context)
|
||||
port,
|
||||
user,
|
||||
password,
|
||||
manufacturer,
|
||||
model,
|
||||
firmware_ver,
|
||||
serial_num,
|
||||
hardware_id,
|
||||
scope,
|
||||
ifs,
|
||||
tz_format,
|
||||
|
||||
//Media Profile for ONVIF Media Service
|
||||
name,
|
||||
width,
|
||||
height,
|
||||
url,
|
||||
snapurl,
|
||||
type,
|
||||
|
||||
//PTZ Profile for ONVIF PTZ Service
|
||||
ptz,
|
||||
move_left,
|
||||
move_right,
|
||||
move_up,
|
||||
move_down,
|
||||
move_stop,
|
||||
move_preset
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const char *short_opts = "hv";
|
||||
|
||||
|
||||
static const struct option long_opts[] =
|
||||
{
|
||||
{ "version", no_argument, NULL, LongOpts::version },
|
||||
{ "help", no_argument, NULL, LongOpts::help },
|
||||
|
||||
//daemon options
|
||||
{ "no_chdir", no_argument, NULL, LongOpts::no_chdir },
|
||||
{ "no_fork", no_argument, NULL, LongOpts::no_fork },
|
||||
{ "no_close", no_argument, NULL, LongOpts::no_close },
|
||||
{ "pid_file", required_argument, NULL, LongOpts::pid_file },
|
||||
{ "log_file", required_argument, NULL, LongOpts::log_file },
|
||||
|
||||
//ONVIF Service options (context)
|
||||
{ "port", required_argument, NULL, LongOpts::port },
|
||||
{ "user", required_argument, NULL, LongOpts::user },
|
||||
{ "password", required_argument, NULL, LongOpts::password },
|
||||
{ "manufacturer", required_argument, NULL, LongOpts::manufacturer },
|
||||
{ "model", required_argument, NULL, LongOpts::model },
|
||||
{ "firmware_ver", required_argument, NULL, LongOpts::firmware_ver },
|
||||
{ "serial_num", required_argument, NULL, LongOpts::serial_num },
|
||||
{ "hardware_id", required_argument, NULL, LongOpts::hardware_id },
|
||||
{ "scope", required_argument, NULL, LongOpts::scope },
|
||||
{ "ifs", required_argument, NULL, LongOpts::ifs },
|
||||
{ "tz_format", required_argument, NULL, LongOpts::tz_format },
|
||||
|
||||
//Media Profile for ONVIF Media Service
|
||||
{ "name", required_argument, NULL, LongOpts::name },
|
||||
{ "width", required_argument, NULL, LongOpts::width },
|
||||
{ "height", required_argument, NULL, LongOpts::height },
|
||||
{ "url", required_argument, NULL, LongOpts::url },
|
||||
{ "snapurl", required_argument, NULL, LongOpts::snapurl },
|
||||
{ "type", required_argument, NULL, LongOpts::type },
|
||||
|
||||
//PTZ Profile for ONVIF PTZ Service
|
||||
{ "ptz", no_argument, NULL, LongOpts::ptz },
|
||||
{ "move_left", required_argument, NULL, LongOpts::move_left },
|
||||
{ "move_right", required_argument, NULL, LongOpts::move_right },
|
||||
{ "move_up", required_argument, NULL, LongOpts::move_up },
|
||||
{ "move_down", required_argument, NULL, LongOpts::move_down },
|
||||
{ "move_stop", required_argument, NULL, LongOpts::move_stop },
|
||||
{ "move_preset", required_argument, NULL, LongOpts::move_preset },
|
||||
|
||||
{ NULL, no_argument, NULL, 0 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define FOREACH_SERVICE(APPLY, soap) \
|
||||
APPLY(DeviceBindingService, soap) \
|
||||
APPLY(MediaBindingService, soap) \
|
||||
APPLY(PTZBindingService, soap) \
|
||||
|
||||
|
||||
/*
|
||||
* If you need support for other services,
|
||||
* add the desired option to the macro FOREACH_SERVICE.
|
||||
*
|
||||
* Note: Do not forget to add the gsoap binding class for the service,
|
||||
* and the implementation methods for it, like for DeviceBindingService
|
||||
|
||||
|
||||
|
||||
APPLY(ImagingBindingService, soap) \
|
||||
APPLY(PTZBindingService, soap) \
|
||||
APPLY(RecordingBindingService, soap) \
|
||||
APPLY(ReplayBindingService, soap) \
|
||||
APPLY(SearchBindingService, soap) \
|
||||
APPLY(ReceiverBindingService, soap) \
|
||||
APPLY(DisplayBindingService, soap) \
|
||||
APPLY(EventBindingService, soap) \
|
||||
APPLY(PullPointSubscriptionBindingService, soap) \
|
||||
APPLY(NotificationProducerBindingService, soap) \
|
||||
APPLY(SubscriptionManagerBindingService, soap) \
|
||||
*/
|
||||
|
||||
|
||||
#define DECLARE_SERVICE(service, soap) service service ## _inst(soap);
|
||||
|
||||
#define DISPATCH_SERVICE(service, soap) \
|
||||
else if (service ## _inst.dispatch() != SOAP_NO_METHOD) {\
|
||||
soap_send_fault(soap); \
|
||||
soap_stream_fault(soap, std::cerr); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static struct soap *soap;
|
||||
|
||||
ServiceContext service_ctx;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void daemon_exit_handler(int sig)
|
||||
{
|
||||
//Here we release resources
|
||||
|
||||
UNUSED(sig);
|
||||
soap_destroy(soap); // delete managed C++ objects
|
||||
soap_end(soap); // delete managed memory
|
||||
soap_free(soap); // free the context
|
||||
|
||||
|
||||
unlink(daemon_info.pid_file);
|
||||
|
||||
app::set_exit_flag(true);
|
||||
// exit(EXIT_SUCCESS); // good job (we interrupted (finished) main loop)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init_signals(void)
|
||||
{
|
||||
set_sig_handler(SIGINT, daemon_exit_handler); //for Ctlr-C in terminal for debug (in debug mode)
|
||||
set_sig_handler(SIGTERM, daemon_exit_handler);
|
||||
|
||||
set_sig_handler(SIGCHLD, SIG_IGN); // ignore child
|
||||
set_sig_handler(SIGTSTP, SIG_IGN); // ignore tty signals
|
||||
set_sig_handler(SIGTTOU, SIG_IGN);
|
||||
set_sig_handler(SIGTTIN, SIG_IGN);
|
||||
set_sig_handler(SIGHUP, SIG_IGN);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void processing_cmd(int argc, char *argv[])
|
||||
{
|
||||
int opt;
|
||||
|
||||
StreamProfile profile;
|
||||
|
||||
|
||||
while( (opt = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1 )
|
||||
{
|
||||
switch( opt )
|
||||
{
|
||||
|
||||
case LongOpts::help:
|
||||
puts(help_str);
|
||||
exit_if_not_daemonized(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
case LongOpts::version:
|
||||
puts(DAEMON_NAME " version " DAEMON_VERSION_STR "\n");
|
||||
exit_if_not_daemonized(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
|
||||
//daemon options
|
||||
case LongOpts::no_chdir:
|
||||
daemon_info.no_chdir = 1;
|
||||
break;
|
||||
|
||||
case LongOpts::no_fork:
|
||||
daemon_info.no_fork = 1;
|
||||
break;
|
||||
|
||||
case LongOpts::no_close:
|
||||
daemon_info.no_close_stdio = 1;
|
||||
break;
|
||||
|
||||
case LongOpts::pid_file:
|
||||
daemon_info.pid_file = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::log_file:
|
||||
daemon_info.log_file = optarg;
|
||||
break;
|
||||
|
||||
|
||||
//ONVIF Service options (context)
|
||||
case LongOpts::port:
|
||||
service_ctx.port = atoi(optarg);
|
||||
break;
|
||||
|
||||
case LongOpts::user:
|
||||
service_ctx.user = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::password:
|
||||
service_ctx.password = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::manufacturer:
|
||||
service_ctx.manufacturer = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::model:
|
||||
service_ctx.model = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::firmware_ver:
|
||||
service_ctx.firmware_version = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::serial_num:
|
||||
service_ctx.serial_number = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::hardware_id:
|
||||
service_ctx.hardware_id = optarg;
|
||||
break;
|
||||
|
||||
case LongOpts::scope:
|
||||
service_ctx.scopes.push_back(optarg);
|
||||
break;
|
||||
|
||||
case LongOpts::ifs:
|
||||
service_ctx.eth_ifs.push_back(Eth_Dev_Param());
|
||||
|
||||
if( service_ctx.eth_ifs.back().open(optarg) != 0 )
|
||||
daemon_error_exit("Can't open ethernet interface: %s - %m\n", optarg);
|
||||
|
||||
break;
|
||||
|
||||
case LongOpts::tz_format:
|
||||
if( !service_ctx.set_tz_format(optarg) )
|
||||
daemon_error_exit("Can't set tz_format: %s\n", service_ctx.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//Media Profile for ONVIF Media Service
|
||||
case LongOpts::name:
|
||||
if( !profile.set_name(optarg) )
|
||||
daemon_error_exit("Can't set name for Profile: %s\n", profile.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::width:
|
||||
if( !profile.set_width(optarg) )
|
||||
daemon_error_exit("Can't set width for Profile: %s\n", profile.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::height:
|
||||
if( !profile.set_height(optarg) )
|
||||
daemon_error_exit("Can't set height for Profile: %s\n", profile.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::url:
|
||||
if( !profile.set_url(optarg) )
|
||||
daemon_error_exit("Can't set URL for Profile: %s\n", profile.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::snapurl:
|
||||
if( !profile.set_snapurl(optarg) )
|
||||
daemon_error_exit("Can't set URL for Snapshot: %s\n", profile.get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::type:
|
||||
if( !profile.set_type(optarg) )
|
||||
daemon_error_exit("Can't set type for Profile: %s\n", profile.get_cstr_err());
|
||||
|
||||
if( !service_ctx.add_profile(profile) )
|
||||
daemon_error_exit("Can't add Profile: %s\n", service_ctx.get_cstr_err());
|
||||
|
||||
profile.clear(); //now we can add new profile (just uses one variable)
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//PTZ Profile for ONVIF PTZ Service
|
||||
case LongOpts::ptz:
|
||||
service_ctx.get_ptz_node()->enable = true;
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_left:
|
||||
if( !service_ctx.get_ptz_node()->set_move_left(optarg) )
|
||||
daemon_error_exit("Can't set process for pan left movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_right:
|
||||
if( !service_ctx.get_ptz_node()->set_move_right(optarg) )
|
||||
daemon_error_exit("Can't set process for pan right movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_up:
|
||||
if( !service_ctx.get_ptz_node()->set_move_up(optarg) )
|
||||
daemon_error_exit("Can't set process for tilt up movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_down:
|
||||
if( !service_ctx.get_ptz_node()->set_move_down(optarg) )
|
||||
daemon_error_exit("Can't set process for tilt down movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_stop:
|
||||
if( !service_ctx.get_ptz_node()->set_move_stop(optarg) )
|
||||
daemon_error_exit("Can't set process for stop movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case LongOpts::move_preset:
|
||||
if( !service_ctx.get_ptz_node()->set_move_preset(optarg) )
|
||||
daemon_error_exit("Can't set process for goto preset movement: %s\n", service_ctx.get_ptz_node()->get_cstr_err());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
puts("for more detail see help\n\n");
|
||||
exit_if_not_daemonized(EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void check_service_ctx(void)
|
||||
{
|
||||
if(service_ctx.eth_ifs.empty())
|
||||
daemon_error_exit("Error: not set no one ehternet interface more details see opt --ifs\n");
|
||||
|
||||
|
||||
if(service_ctx.scopes.empty())
|
||||
daemon_error_exit("Error: not set scopes more details see opt --scope\n");
|
||||
|
||||
|
||||
if(service_ctx.get_profiles().empty())
|
||||
daemon_error_exit("Error: not set no one profile more details see --help\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init_gsoap(void)
|
||||
{
|
||||
soap = soap_new();
|
||||
|
||||
if(!soap)
|
||||
daemon_error_exit("Can't get mem for SOAP\n");
|
||||
|
||||
|
||||
soap->bind_flags = SO_REUSEADDR;
|
||||
|
||||
if( !soap_valid_socket(soap_bind(soap, NULL, service_ctx.port, 10)) )
|
||||
{
|
||||
soap_stream_fault(soap, std::cerr);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
soap->send_timeout = 3; // timeout in sec
|
||||
soap->recv_timeout = 3; // timeout in sec
|
||||
|
||||
|
||||
//save pointer of service_ctx in soap
|
||||
soap->user = (void*)&service_ctx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void init(void *data)
|
||||
{
|
||||
UNUSED(data);
|
||||
init_signals();
|
||||
check_service_ctx();
|
||||
init_gsoap();
|
||||
}
|
||||
|
||||
#include "stdio.h"
|
||||
#include "main.h"
|
||||
#include "maix_util.hpp"
|
||||
#include "maix_image.hpp"
|
||||
#include "maix_time.hpp"
|
||||
#include "maix_display.hpp"
|
||||
#include "maix_rtsp.hpp"
|
||||
#include "maix_camera.hpp"
|
||||
#include "maix_basic.hpp"
|
||||
#include "csignal"
|
||||
#include <iostream>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include "maix_basic.hpp"
|
||||
#include "maix_vision.hpp"
|
||||
#include "maix_nn_yolo11.hpp"
|
||||
|
||||
using namespace maix;
|
||||
|
||||
static void *rtsp_thread(void *param)
|
||||
{
|
||||
int cam_w = 1280;
|
||||
int cam_h = 720;
|
||||
image::Format cam_fmt = image::Format::FMT_YVU420SP;
|
||||
int cam_fps = -1;
|
||||
int cam_buffer_num = 3;
|
||||
|
||||
camera::Camera cam = camera::Camera(cam_w, cam_h, cam_fmt, "", cam_fps, cam_buffer_num);
|
||||
camera::Camera *cam2 = cam.add_channel(1280, 720, image::Format::FMT_YVU420SP);
|
||||
display::Display disp = display::Display();
|
||||
auto audio_recorder = audio::Recorder();
|
||||
rtsp::Rtsp rtsp = rtsp::Rtsp();
|
||||
rtsp.bind_camera(&cam);
|
||||
rtsp.bind_audio_recorder(&audio_recorder);
|
||||
|
||||
log::info("url:%s", rtsp.get_url().c_str());
|
||||
std::vector<std::string> url = rtsp.get_urls();
|
||||
for (size_t i = 0; i < url.size(); i ++) {
|
||||
log::info("url[%d]:%s", i, url[i].c_str());
|
||||
}
|
||||
err::check_raise(rtsp.start());
|
||||
|
||||
while(!app::need_exit()) {
|
||||
maix::image::Image *img = nullptr;
|
||||
try {
|
||||
img = cam2->read();
|
||||
} catch (std::exception &e) {
|
||||
time::sleep_ms(10);
|
||||
continue;
|
||||
}
|
||||
|
||||
disp.show(*img);
|
||||
delete img;
|
||||
}
|
||||
|
||||
rtsp.stop();
|
||||
delete cam2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "pthread.h"
|
||||
|
||||
int _main(int argc, char *argv[])
|
||||
{
|
||||
processing_cmd(argc, argv);
|
||||
daemonize2(init, nullptr);
|
||||
|
||||
FOREACH_SERVICE(DECLARE_SERVICE, soap)
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, nullptr, rtsp_thread, nullptr);
|
||||
while( !app::need_exit() )
|
||||
{
|
||||
// wait new client
|
||||
if( !soap_valid_socket(soap_accept(soap)) )
|
||||
{
|
||||
soap_stream_fault(soap, std::cerr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// process service
|
||||
if( soap_begin_serve(soap) )
|
||||
{
|
||||
soap_stream_fault(soap, std::cerr);
|
||||
}
|
||||
FOREACH_SERVICE(DISPATCH_SERVICE, soap)
|
||||
else
|
||||
{
|
||||
DEBUG_MSG("Unknown service\n");
|
||||
}
|
||||
|
||||
soap_destroy(soap); // delete managed C++ objects
|
||||
soap_end(soap); // delete managed memory
|
||||
}
|
||||
|
||||
pthread_join(thread, nullptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Catch signal and process
|
||||
sys::register_default_signal_handle();
|
||||
|
||||
// Use CATCH_EXCEPTION_RUN_RETURN to catch exception,
|
||||
// if we don't catch exception, when program throw exception, the objects will not be destructed.
|
||||
// So we catch exception here to let resources be released(call objects' destructor) before exit.
|
||||
CATCH_EXCEPTION_RUN_RETURN(_main, -1, argc, argv);
|
||||
}
|
||||
|
||||
|
||||
168
projects/README.md
Normal file
168
projects/README.md
Normal file
@@ -0,0 +1,168 @@
|
||||
# MaixCam & MaixCam2 Auto Build & Pack Script
|
||||
A bash script to **automatically compile MaixCDK projects for MaixCam and MaixCam2 platforms**, package the compiled binaries into a portable ZIP file, and generate a self-executing `main.py` for one-click deployment on both devices.
|
||||
|
||||
## Features
|
||||
- **Two Compilation Modes**: Batch compile all valid projects in a directory, or compile a single project independently.
|
||||
- **Platform Selection**: Choose to build for MaixCam only, MaixCam2 only, or both platforms (default).
|
||||
- **Project Exclusion**: Configure an exclusion list to skip specific projects during batch compilation.
|
||||
- **Cross-Platform Support**: Compiles binaries for both MaixCam and MaixCam2 in one run.
|
||||
- **Smart Packaging**:
|
||||
- Separates platform-specific binaries into dedicated folders (`maixcam/`, `maixcam2/`).
|
||||
- Copies shared resources (assets, app.yaml, README) to the root of the package.
|
||||
- Generates an auto-executing `main.py` that **auto-detects the device model** (when building both) and runs the corresponding binary.
|
||||
- **Auto-Clean**: Clears compilation caches after each build to avoid version conflicts.
|
||||
- **Error Handling**: Stops execution on critical errors (batch mode skips failed projects and continues).
|
||||
- **Colorful Logs**: Clear visual feedback with colored info/warn/error messages for easy debugging.
|
||||
- **Timestamped ZIP**: Generates uniquely named ZIP packages with timestamps to avoid overwriting.
|
||||
|
||||
## Prerequisites
|
||||
1. **MaixCDK Installed**: The script relies on the `maixcdk` command-line tool for compilation and cleaning.
|
||||
Install MaixCDK following the official guide: [MaixCDK Documentation](https://wiki.sipeed.com/maixcdk)
|
||||
2. **Bash Environment**: Works on Linux/macOS (native bash) or Windows (WSL2, Git Bash, or MSYS2).
|
||||
3. **Basic Dependencies**: Ensure `zip`, `find`, `sed` are installed (pre-installed on most Linux/macOS systems).
|
||||
4. **Valid MaixCDK Projects**: Projects must contain either `app.yaml` (MaixCDK app) or `CMakeLists.txt` (CMake-based project) to be recognized.
|
||||
|
||||
## Quick Start
|
||||
### 1. Get the Script
|
||||
Save the script as `build_and_pack.sh` and grant execution permission:
|
||||
```bash
|
||||
chmod +x build_and_pack.sh
|
||||
```
|
||||
|
||||
### 2. Configure Exclusion List (Optional)
|
||||
Edit the script to exclude specific projects from batch compilation:
|
||||
```bash
|
||||
# Open the script and modify line 14-15
|
||||
EXCLUDE_PROJECTS=("project1" "project2" "project3")
|
||||
```
|
||||
Leave the array empty `EXCLUDE_PROJECTS=()` to compile all projects.
|
||||
|
||||
### 3. Show Help Information
|
||||
```bash
|
||||
./build_and_pack.sh -h
|
||||
# or
|
||||
./build_and_pack.sh --help
|
||||
```
|
||||
|
||||
## Usage
|
||||
### Mode 1: Batch Compile (Default)
|
||||
Compile **all valid MaixCDK projects** in a target directory (skips non-project folders and a `build/` subdirectory if present).
|
||||
The compiled ZIP packages are output to a `build/` folder in the target directory.
|
||||
|
||||
#### Syntax
|
||||
```bash
|
||||
./build_and_pack.sh [PROJECTS_DIRECTORY] [--platform maixcam|maixcam2|both]
|
||||
```
|
||||
- `[PROJECTS_DIRECTORY]`: Optional, path to the folder containing all MaixCDK projects (defaults to the **current working directory** if not specified).
|
||||
- `--platform` or `-p`: Optional, specify target platform(s) to build (defaults to `both`).
|
||||
|
||||
#### Examples
|
||||
```bash
|
||||
# Batch compile all projects in the current directory (both platforms)
|
||||
./build_and_pack.sh
|
||||
|
||||
# Batch compile only for MaixCam
|
||||
./build_and_pack.sh --platform maixcam
|
||||
|
||||
# Batch compile only for MaixCam2
|
||||
./build_and_pack.sh --platform maixcam2
|
||||
|
||||
# Batch compile all projects in a specified directory for both platforms
|
||||
./build_and_pack.sh /root/MaixCDK/projects --platform both
|
||||
```
|
||||
|
||||
### Mode 2: Single Project Compile
|
||||
Compile a **single MaixCDK project** (outputs the ZIP package directly to the project directory by default).
|
||||
|
||||
#### Syntax
|
||||
```bash
|
||||
./build_and_pack.sh --single [PROJECT_PATH] [--platform maixcam|maixcam2|both]
|
||||
# or short version
|
||||
./build_and_pack.sh -s [PROJECT_PATH] [-p maixcam|maixcam2|both]
|
||||
```
|
||||
- `[PROJECT_PATH]`: Optional, path to the single MaixCDK project (defaults to the **current working directory** if not specified).
|
||||
- `--platform` or `-p`: Optional, specify target platform(s) to build (defaults to `both`).
|
||||
|
||||
#### Examples
|
||||
```bash
|
||||
# Compile the project in the current directory (both platforms)
|
||||
./build_and_pack.sh --single
|
||||
|
||||
# Compile only for MaixCam
|
||||
./build_and_pack.sh --single --platform maixcam
|
||||
|
||||
# Compile a specified single project only for MaixCam2
|
||||
./build_and_pack.sh --single /root/MaixCDK/projects/app_camera --platform maixcam2
|
||||
```
|
||||
|
||||
## Output File Structure
|
||||
### Compiled ZIP Package Content
|
||||
The generated ZIP file (e.g., `app_camera_release_20260129_153000.zip`) structure depends on the platform selection:
|
||||
|
||||
**When building both platforms (`--platform both` or default):**
|
||||
```
|
||||
app_camera_release_20260129_153000/
|
||||
├── main.py # Auto-execution script (auto-detects device & runs binary)
|
||||
├── app.yaml # Project configuration (shared)
|
||||
├── assets/ # Resource files (images/fonts, shared)
|
||||
├── README.md # Project documentation (shared)
|
||||
├── README_EN.md # English documentation (shared, if exists)
|
||||
├── maixcam/ # MaixCam-specific files
|
||||
│ ├── [binary] # Compiled binary for MaixCam
|
||||
│ └── dl_lib/ # Deep learning libraries (if exists)
|
||||
└── maixcam2/ # MaixCam2-specific files
|
||||
├── [binary] # Compiled binary for MaixCam2
|
||||
└── dl_lib/ # Deep learning libraries (if exists)
|
||||
```
|
||||
|
||||
**When building single platform (`--platform maixcam` or `--platform maixcam2`):**
|
||||
```
|
||||
app_camera_release_20260129_153000/
|
||||
├── main.py # Direct execution script (runs platform-specific binary)
|
||||
├── app.yaml # Project configuration
|
||||
├── assets/ # Resource files (images/fonts)
|
||||
├── README.md # Project documentation
|
||||
├── README_EN.md # English documentation (if exists)
|
||||
└── maixcam/ # Only the selected platform folder
|
||||
├── [binary] # Compiled binary
|
||||
└── dl_lib/ # Deep learning libraries (if exists)
|
||||
```
|
||||
|
||||
### Key Output Files
|
||||
- **ZIP Package**: Named as `<PROJECT_NAME>_release_<TIMESTAMP>.zip` (timestamp format: `YYYYMMDD_HHMMSS`).
|
||||
- Batch mode: Stored in `[PROJECTS_DIRECTORY]/build/`.
|
||||
- Single mode: Stored in the project root directory by default.
|
||||
- **`main.py`**: The core execution script—**no manual modification needed** (auto-replaces the binary name during compilation).
|
||||
|
||||
## How to Deploy on MaixCam/MaixCam2
|
||||
1. Copy the generated ZIP file to the root directory of the MaixCam/MaixCam2 device (via SSH/SCP or SD card).
|
||||
2. Unzip the package on the device:
|
||||
```bash
|
||||
unzip <PROJECT_NAME>_release_<TIMESTAMP>.zip -d <PROJECT_FOLDER>
|
||||
```
|
||||
3. Enter the project folder and run the script:
|
||||
```bash
|
||||
cd <PROJECT_FOLDER>
|
||||
python main.py
|
||||
```
|
||||
The script will **automatically detect the device model** (MaixCam/MaixCam2), grant execute permission to the binary, and run it.
|
||||
|
||||
## Script Workflow
|
||||
### For Single Project Compilation
|
||||
1. Clean up previous build outputs (if any).
|
||||
2. Based on `--platform` parameter:
|
||||
- `both` (default): Compile for **MaixCam** first, then **MaixCam2**
|
||||
- `maixcam`: Compile only for **MaixCam**
|
||||
- `maixcam2`: Compile only for **MaixCam2**
|
||||
3. Copy shared resources (assets, app.yaml, README) to the output directory.
|
||||
4. Generate platform-appropriate `main.py`:
|
||||
- For `both`: Auto-detects device and runs corresponding binary
|
||||
- For single platform: Directly runs the platform-specific binary
|
||||
5. Package all files into a timestamped ZIP and clean up temporary build files.
|
||||
|
||||
### For Batch Compilation
|
||||
1. Create a `build/` directory for output ZIP packages.
|
||||
2. Traverse all subdirectories in the target folder, skip non-project folders, the `build/` directory, and projects in the exclusion list.
|
||||
3. Compile each valid project with the **single project workflow** using the specified platform, outputting ZIPs to the `build/` directory.
|
||||
4. Skip failed projects and continue compiling the rest.
|
||||
5. Print a summary (total/succeeded/failed projects) and list failed projects (if any).
|
||||
@@ -1,17 +1,69 @@
|
||||
## 1. 简介
|
||||
本应用是基于Maix系列硬件(MaixCam/Pro/MaixCam2)开发的相机控制程序,集成了拍照、录像、参数调节等核心功能,适配不同分辨率的摄像头传感器,支持音视频同步录制、参数自定义配置等特性,可满足日常拍摄、延时摄影等多样化的使用需求。
|
||||
|
||||
# Create lv_i8n file
|
||||
## 2. 主要功能
|
||||
| 功能分类 | 具体能力 |
|
||||
|----------|----------|
|
||||
| 基础拍摄 | 支持一键拍照,可设置拍照延时(单位:秒);支持照片自动按日期分类存储,生成缩略图便于预览 |
|
||||
| 视频录制 | 支持H.264格式视频录制,音视频同步;可自定义视频码率,适配不同分辨率的码率自动推荐 |
|
||||
| 参数调节 | 快门:支持自动/手动模式,手动模式可自定义快门值<br>ISO:支持自动/手动模式,范围100~800<br>曝光补偿(EV):支持自动/手动调节<br>白平衡(WB):支持自动/手动调节<br>分辨率:支持3840×2160、2560×1440、1920×1080等多档位切换 |
|
||||
| 辅助功能 | 补光灯控制:支持开启/关闭硬件补光灯<br>延时摄影:可设置延时秒数,开启后自动按间隔录制视频(关闭音频)<br>对焦:支持手动对焦区域设置<br>时间戳:支持在画面中显示当前时间<br>RAW格式:支持开启/关闭RAW格式照片保存 |
|
||||
|
||||
```shell
|
||||
# install npm
|
||||
sudo apt install npm
|
||||
## 3. 使用说明
|
||||
### 3.1 基础操作
|
||||
#### 3.1.1 拍照
|
||||
1. 进入应用后,默认进入预览界面;
|
||||
2. 可先设置拍照延时(可选,0秒为立即拍摄);
|
||||
3. 点击拍照按钮,若设置了延时,界面会显示延时动画,延时结束后自动完成拍照;
|
||||
4. 照片会自动保存至「图片存储目录/当前日期/序号.jpg」路径,同时生成缩略图供预览。
|
||||
|
||||
# intall lv_i18n
|
||||
sudo npm i lv_i18n -g
|
||||
#### 3.1.2 视频录制
|
||||
1. 点击录制开始按钮,应用自动准备录制环境并开始录制,界面显示录制时长;
|
||||
2. 录制过程中可查看实时录制时间,支持根据分辨率自动适配推荐码率,也可手动修改码率(非录制状态下);
|
||||
3. 点击停止按钮,录制结束,视频自动保存至「视频存储目录/当前日期/序号.mp4」路径。
|
||||
|
||||
# create en-GB.yml, and edit it
|
||||
mkdir i18n
|
||||
touch i18n/en-GB.yml
|
||||
### 3.2 参数配置
|
||||
#### 3.2.1 分辨率切换
|
||||
1. 在参数设置界面选择分辨率档位,确认后应用会自动重启相机并加载新分辨率;
|
||||
2. 分辨率档位受硬件传感器限制,超出传感器最大尺寸的档位会被禁用。
|
||||
|
||||
# create lv_i18n file
|
||||
lv_i18n compile -t i18n/en-GB.yml -o i18n
|
||||
```
|
||||
#### 3.2.2 快门/ISO调节
|
||||
- 自动模式:勾选「自动」选项,相机会根据环境自动调节快门/ISO;
|
||||
- 手动模式:取消「自动」勾选,输入目标快门值(单位:秒)/ISO值,确认后立即生效。
|
||||
|
||||
#### 3.2.3 辅助功能开关
|
||||
- 补光灯:点击补光灯按钮,切换开启/关闭状态;
|
||||
- 时间戳:点击时间戳按钮,开启后画面左下角显示当前日期时间;
|
||||
- 延时摄影:设置延时秒数(0为关闭,>0为固定间隔,<0为自动模式),开启后录制视频时自动关闭音频;
|
||||
- RAW格式:点击RAW按钮,开启后拍照会同时保存RAW格式文件(后缀.raw)。
|
||||
|
||||
### 3.3 预览与查看
|
||||
1. 拍照完成后,界面会自动显示刚拍摄的照片缩略图和预览图;
|
||||
2. 点击「查看照片」按钮,可浏览已拍摄的照片。
|
||||
|
||||
## 4. 注意事项
|
||||
1. 分辨率切换:切换分辨率时,应用会重启相机模块,期间预览会短暂中断,属于正常现象;
|
||||
2. 码率修改:仅在非录制状态下可修改码率,录制过程中修改码率会提示「视频忙」且不生效;
|
||||
3. 延时摄影:开启延时摄影后,音频会自动关闭,关闭延时摄影后需手动重新开启音频;
|
||||
4. RAW格式:开启RAW格式后,照片保存体积会增大,且需要专用软件解析;
|
||||
5. 补光灯:补光灯的硬件引脚默认配置为GPIOB3,可通过设备配置文件修改引脚映射;
|
||||
6. 存储路径:照片/视频默认按日期分目录存储,需确保存储设备有足够空间,否则会保存失败;
|
||||
7. 音视频同步:录制视频时,若出现音频卡顿,可检查音频采样率配置(默认48000Hz)。
|
||||
|
||||
## 5. 更多介绍
|
||||
### 5.1 硬件适配
|
||||
- 支持MaixCam、MaixCam2两款硬件平台,MaixCam2支持更高码率(最高100Mbps)和AI-ISP功能;
|
||||
- 补光灯引脚可通过设备配置文件中的「cam_light_io」参数自定义,默认B3引脚;
|
||||
- 摄像头传感器最大分辨率决定可选分辨率档位,适配前需确认硬件传感器规格。
|
||||
|
||||
### 5.2 存储说明
|
||||
- 照片默认存储路径:应用指定的图片目录(可通过系统接口修改);
|
||||
- 视频默认存储路径:应用指定的视频目录(可通过系统接口修改);
|
||||
- 所有文件保存后会执行「sync」操作,确保数据写入存储设备,避免断电丢失。
|
||||
|
||||
### 5.3 性能说明
|
||||
- 预览帧率默认30fps,分辨率越高,预览/录制的系统资源占用越大;
|
||||
- 延时摄影模式下,视频帧率仍为30fps,仅按设置的间隔推送帧数据,适合长时间低帧率录制场景。
|
||||
|
||||
### 5.4 源码
|
||||
- [源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_camera)
|
||||
77
projects/app_camera/README_EN.md
Normal file
77
projects/app_camera/README_EN.md
Normal file
@@ -0,0 +1,77 @@
|
||||
## 1. Introduction
|
||||
This application is a camera control program developed based on Maix series hardware (MaixCam/Pro/MaixCam2). It integrates core functions such as photo capture, video recording, and parameter adjustment. It is compatible with camera sensors of different resolutions and supports features like audio-video synchronization and custom parameter configuration, meeting diverse usage requirements such as daily shooting and time-lapse photography.
|
||||
|
||||
## 2. Main Features
|
||||
|
||||
| Feature Category | Capabilities |
|
||||
|------------------|--------------|
|
||||
| **Basic Shooting** | Supports one-click photo capture with configurable delay (in seconds). Photos are automatically categorized by date and thumbnails are generated for easy preview. |
|
||||
| **Video Recording** | Supports H.264 format video recording with audio-video synchronization. Video bitrate can be customized, and recommended bitrates are automatically adapted based on resolution. |
|
||||
| **Parameter Adjustment** | **Shutter:** Auto/manual mode with customizable shutter speed.<br>**ISO:** Auto/manual mode (range: 100~800).<br>**Exposure Compensation (EV):** Auto/manual adjustment.<br>**White Balance (WB):** Auto/manual adjustment.<br>**Resolution:** Switch between multiple presets (e.g., 3840×2160, 2560×1440, 1920×1080). |
|
||||
| **Auxiliary Functions** | **Fill Light:** Hardware fill light on/off control.<br>**Time-lapse:** Configurable interval; audio is automatically disabled when enabled.<br>**Focus:** Manual focus area setting.<br>**Timestamp:** Display current time on the screen.<br>**RAW Format:** Option to save photos in RAW format. |
|
||||
|
||||
## 3. User Guide
|
||||
|
||||
### 3.1 Basic Operations
|
||||
|
||||
#### 3.1.1 Taking Photos
|
||||
1. Upon entering the app, the preview screen is displayed by default.
|
||||
2. (Optional) Set a capture delay (0 seconds for immediate capture).
|
||||
3. Click the capture button. If a delay is set, a countdown animation will appear. The photo is taken automatically after the countdown.
|
||||
4. Photos are automatically saved to `[Image Storage Directory]/[Current Date]/[Index].jpg`, and a thumbnail is generated for preview.
|
||||
|
||||
#### 3.1.2 Video Recording
|
||||
1. Click the Record Start button. The app prepares the environment and starts recording; the recording duration is displayed on screen.
|
||||
2. During recording, the elapsed time is shown. The bitrate is auto-adapted but can be manually modified (only when not recording).
|
||||
3. Click the Stop button to end recording. The video is saved to `[Video Storage Directory]/[Current Date]/[Index].mp4`.
|
||||
|
||||
### 3.2 Parameter Configuration
|
||||
|
||||
#### 3.2.1 Resolution Switching
|
||||
1. Select a resolution preset in the settings menu.
|
||||
2. The app will automatically restart the camera module to apply the new resolution.
|
||||
3. Note: Options are limited by the hardware sensor; presets exceeding the sensor's maximum capability are disabled.
|
||||
|
||||
#### 3.2.2 Shutter/ISO Adjustment
|
||||
* **Auto Mode:** Check the "Auto" option. The camera adjusts Shutter/ISO based on the environment.
|
||||
* **Manual Mode:** Uncheck "Auto" and input the target Shutter speed (seconds) or ISO value. Changes take effect immediately.
|
||||
|
||||
#### 3.2.3 Auxiliary Function Switches
|
||||
* **Fill Light:** Toggle the button to turn the hardware light on or off.
|
||||
* **Timestamp:** Toggle the button to display the current date and time in the bottom-left corner.
|
||||
* **Time-lapse:** Set the interval in seconds (0 to disable, >0 for fixed interval). Audio is automatically disabled in this mode.
|
||||
* **RAW Format:** Toggle the button to save an additional RAW format file (`.raw` suffix) when capturing photos.
|
||||
|
||||
### 3.3 Preview and Playback
|
||||
1. After capturing a photo, the thumbnail and a larger preview are displayed automatically.
|
||||
2. Click the "View Photos" button to browse the photo gallery.
|
||||
|
||||
## 4. Notes
|
||||
|
||||
1. **Resolution Switching:** Switching resolution restarts the camera module, causing a brief interruption in the preview. This is normal behavior.
|
||||
2. **Bitrate Modification:** Bitrate can only be modified when not recording. Attempting to change it during recording will show a "Video Busy" warning and will not take effect.
|
||||
3. **Time-lapse Photography:** Audio is automatically disabled in time-lapse mode. You need to manually re-enable it if you switch back to normal recording.
|
||||
4. **RAW Format:** Enabling RAW format increases file size significantly, and dedicated software is required for viewing/processing.
|
||||
5. **Fill Light:** The default hardware pin for the light is GPIOB3. This can be modified via the device configuration file (`cam_light_io`).
|
||||
6. **Storage Path:** Files are stored in date-based directories by default. Ensure sufficient storage space is available to prevent save failures.
|
||||
7. **AV Sync:** If audio stutters during recording, check the audio sample rate configuration (default is 48000Hz).
|
||||
|
||||
## 5. More Information
|
||||
|
||||
### 5.1 Hardware Compatibility
|
||||
* Supports **MaixCam** and **MaixCam2** platforms.
|
||||
* **MaixCam2** supports higher bitrates (up to 100Mbps) and features AI-ISP.
|
||||
* The fill light pin is configurable via the `cam_light_io` parameter in the device config file (default: B3).
|
||||
* The available resolution options are determined by the camera sensor's maximum resolution.
|
||||
|
||||
### 5.2 Storage Details
|
||||
* **Default Photo Path:** Defined by the system interface (usually under the app's picture directory).
|
||||
* **Default Video Path:** Defined by the system interface (usually under the app's video directory).
|
||||
* A `sync` operation is performed after saving to ensure data is written to the storage device, preventing data loss in case of sudden power loss.
|
||||
|
||||
### 5.3 Performance
|
||||
* The default preview frame rate is 30fps. Higher resolutions consume more system resources.
|
||||
* In time-lapse mode, the output video remains at 30fps, but frames are pushed at the set interval. This is suitable for long-duration, low-frame-rate recording.
|
||||
|
||||
### 5.4 Source Code
|
||||
* [Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_camera)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ static void left_screen_init(void)
|
||||
lv_image_set_src(img, &img_focus);
|
||||
lv_obj_center(img);
|
||||
}
|
||||
#ifndef PLATFORM_MAIXCAM2
|
||||
|
||||
{
|
||||
y_pct += 25;
|
||||
lv_obj_t *obj = lv_obj_create(scr);
|
||||
@@ -324,7 +324,7 @@ static void left_screen_init(void)
|
||||
lv_obj_set_style_text_font(label, &lv_font_montserrat_16, 0);
|
||||
lv_obj_center(label);
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
y_pct += 25;
|
||||
lv_obj_t *obj = lv_obj_create(scr);
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
Hello World Project based on MaixCDK
|
||||
====
|
||||
## 1. 简介
|
||||
本程序基于MaixCam系列硬件平台开发,是一款实时图像分类识别应用。程序可调用设备摄像头采集画面,通过预加载的MobilenetV2神经网络模型对画面中的主体进行分类识别,将识别结果(类别名称、置信度)、性能耗时等信息实时显示在屏幕上,并支持触屏退出操作,适配Maix硬件的交互特性。
|
||||
|
||||
Hello world example code for MaixCDK of Sipeed, build method please visit [MaixCDK](https://github.com/sipeed/MaixCDK).
|
||||
## 2. 主要功能
|
||||
1. **实时图像采集**:调用设备摄像头获取实时画面,适配屏幕分辨率自动调整采集参数;
|
||||
2. **AI分类识别**:基于MobilenetV2模型对摄像头画面进行快速分类,输出识别类别及置信度(准确率);
|
||||
3. **可视化展示**:在屏幕上实时显示:
|
||||
- 识别框(画面中心的白色矩形框);
|
||||
- 识别结果(类别名称、置信度百分比);
|
||||
- 性能耗时(总耗时、摄像头采集耗时、识别耗时、画面显示耗时);
|
||||
- 返回图标(屏幕左上角);
|
||||
4. **快捷退出**:触摸屏幕左上角指定区域可快速退出程序;
|
||||
5. **异常处理**:包含摄像头读取、图像缩放、模型加载等关键环节的异常检测与日志输出,便于问题排查。
|
||||
|
||||
## 3. 使用说明
|
||||
1. 运行前需确保Maix系列开发板(带摄像头、触摸屏、显示屏)硬件正常,摄像头安装到位并对准待识别物体,将分类模型文件`mobilenetv2.mud`放置在设备`/root/models/`目录下,程序启动后会输出“Program start”“open camera success”等日志信息并自动进入实时识别模式,摄像头画面将实时显示在屏幕上;使用时将待识别物体对准摄像头,屏幕中心白色矩形框为识别区域,框下方会显示识别结果(类别名称+置信度百分比),屏幕上方可查看各环节耗时(单位:ms),触摸屏幕左上角“返回图标”区域(约100x100像素范围)即可停止并退出程序。
|
||||
|
||||
|
||||
## 4. 注意事项
|
||||
1. 异常退出:若程序异常终止,可查看终端日志中的“error”信息定位问题(如摄像头读取失败、模型加载失败等);
|
||||
2. 资源释放:程序退出时会自动释放摄像头、图像、模型等资源,请勿强制终止(如拔电源),避免资源占用。
|
||||
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_classifier)
|
||||
|
||||
[MaixCAM MaixPy 使用 AI 模型进行物体分类](https://wiki.sipeed.com/maixpy/doc/zh/vision/classify.html)
|
||||
25
projects/app_classifier/README_EN.md
Normal file
25
projects/app_classifier/README_EN.md
Normal file
@@ -0,0 +1,25 @@
|
||||
## 1. Overview
|
||||
This program is developed based on the MaixCam series hardware platform and serves as a real-time image classification and recognition application. It can invoke the device's camera to capture frames, perform classification recognition on the main subject in the frames using a preloaded MobilenetV2 neural network model, and display recognition results (category name, confidence level), performance time consumption, and other information on the screen in real time. It also supports touch-screen exit operation, adapting to the interactive features of Maix hardware.
|
||||
|
||||
## 2. Main Features
|
||||
1. **Real-time Image Capture**: Invokes the device's camera to acquire real-time frames and automatically adjusts capture parameters to match the screen resolution;
|
||||
2. **AI Classification Recognition**: Performs fast classification on camera frames based on the MobilenetV2 model and outputs the recognized category and confidence level (accuracy rate);
|
||||
3. **Visual Display**: Real-time display on the screen includes:
|
||||
- Recognition frame (white rectangular frame at the center of the screen);
|
||||
- Recognition results (category name + confidence percentage);
|
||||
- Performance time consumption (total time, camera capture time, recognition time, display time);
|
||||
- Return icon (top-left corner of the screen);
|
||||
4. **Quick Exit**: Touch the designated area in the top-left corner of the screen to exit the program quickly;
|
||||
5. **Exception Handling**: Includes exception detection and log output for key links such as camera reading, image scaling, and model loading, facilitating problem troubleshooting.
|
||||
|
||||
## 3. Usage Instructions
|
||||
1. Before running, ensure that the Maix series development board (equipped with a camera, touch screen, and display screen) is functioning properly, the camera is installed correctly and aimed at the object to be recognized, and place the classification model file `mobilenetv2.mud` in the `/root/models/` directory of the device. After starting the program, it will output log information such as "Program start" and "open camera success" and automatically enter the real-time recognition mode, with the camera frame displayed on the screen in real time. When using, aim the object to be recognized at the camera; the white rectangular frame at the center of the screen is the recognition area, and the recognition results (category name + confidence percentage) will be displayed below the frame. You can view the time consumption of each link (in ms) at the top of the screen, and touch the "return icon" area (approximately 100x100 pixels) in the top-left corner of the screen to stop and exit the program.
|
||||
|
||||
## 4. Notes
|
||||
1. Abnormal Exit: If the program terminates abnormally, check the "error" information in the terminal log to locate the problem (e.g., camera reading failure, model loading failure, etc.);
|
||||
2. Resource Release: The program will automatically release resources such as the camera, images, and models when exiting. Do not force termination (e.g., unplugging the power supply) to avoid resource occupation.
|
||||
|
||||
## 5. More Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_classifier)
|
||||
|
||||
[MaixCAM MaixPy Use AI Model for Object Classification](https://wiki.sipeed.com/maixpy/doc/en/vision/classify.html)
|
||||
@@ -6,8 +6,8 @@ icon: assets/classifier.png
|
||||
author: Sipeed Ltd
|
||||
desc: AI object classification
|
||||
desc[zh]: AI 物体分类识别
|
||||
files:
|
||||
include:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
AI detector Project based on MaixCDK
|
||||
====
|
||||
## 1. 简介
|
||||
本程序适用于搭载 MaixCam系列芯片的硬件设备,基于 YOLOv5 神经网络模型实现实时目标检测功能。程序可调用设备摄像头采集画面,对画面中的目标进行识别与框选,并在显示屏实时展示检测结果;同时支持触控屏操作,点击指定退出按钮区域可终止程序运行,整体操作简单、检测响应实时性高。
|
||||
|
||||
AI detector code for MaixCDK of Sipeed, build method please visit [MaixCDK](https://github.com/sipeed/MaixCDK).
|
||||
## 2. 主要功能
|
||||
1. **实时目标检测**:调用设备摄像头获取实时画面,通过 YOLOv5 模型对画面中的目标进行识别,支持设置置信度阈值(0.5)和交并比阈值(0.45)过滤无效检测结果。
|
||||
2. **可视化展示**:在检测画面中用红色矩形框标注目标位置,显示目标类别名称;同时展示检测耗时(摄像头采集、模型推理、画面显示)、总耗时及实时帧率等性能数据。
|
||||
3. **触控退出功能**:显示屏左上角显示退出按钮(ret.png 图片),触摸该按钮区域可立即退出程序。
|
||||
4. **异常处理**:内置摄像头读取、模型加载、图片缩放等环节的异常检测与日志输出,保障程序稳定运行。
|
||||
|
||||
## 3. 使用说明
|
||||
### 3.1 运行与操作步骤
|
||||
1. 将编译后的程序文件上传至设备指定目录;
|
||||
2. 通过终端或设备本地执行程序启动命令,程序启动后摄像头自动开启,显示屏实时显示检测画面,画面左上角会出现退出按钮;
|
||||
3. 检测过程中,显示屏会实时展示目标框、目标类别名称,以及摄像头采集耗时、模型检测耗时、画面显示耗时、总耗时和实时帧率等信息;
|
||||
4. 退出程序:
|
||||
- 常规方式:用手指触摸显示屏左上角的退出按钮区域,程序立即终止运行;
|
||||
- 应急方式:若通过终端运行程序,可按下 Ctrl + C 快捷键强制退出程序。
|
||||
|
||||
## 4. 注意事项
|
||||
1. **文件路径**:务必保证 `yolov5s.mud` 文件路径与程序中指定路径一致,路径错误会导致程序启动失败并输出日志错误信息;
|
||||
2. **硬件适配**:程序会根据摄像头分辨率自动适配字体大小、按钮尺寸,若设备屏幕/摄像头分辨率特殊,可能出现按钮显示不全或触控区域偏移,需调整代码中按钮缩放比例参数;
|
||||
3. **性能指标**:耗时、帧率等性能数据仅作参考,不同硬件配置(芯片型号、内存大小)下数值会有差异;
|
||||
4. **异常处理**:若程序启动失败,可查看日志信息定位问题(如模型加载失败、摄像头未识别、图片文件缺失等);
|
||||
5. **资源释放**:程序退出时会自动释放摄像头、显示屏、图片、检测结果等资源,无需手动清理,避免强制断电导致资源占用。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_detector)
|
||||
|
||||
[MaixPy MaixCAM 使用 YOLOv5 / YOLOv8 / YOLO11 模型进行目标检测](https://wiki.sipeed.com/maixpy/doc/zh/vision/yolov5.html)
|
||||
29
projects/app_detector/README_EN.md
Normal file
29
projects/app_detector/README_EN.md
Normal file
@@ -0,0 +1,29 @@
|
||||
## 1. Overview
|
||||
This program is designed for hardware devices equipped with MaixCam series chips, implementing real-time object detection based on the YOLOv5 neural network model. It can access the device's camera to capture live frames, identify and frame objects in the画面, and display detection results in real time on the display screen. Additionally, it supports touchscreen operation—tapping the designated exit button area terminates program execution. The overall operation is simple with high real-time responsiveness for detection.
|
||||
|
||||
## 2. Key Features
|
||||
1. **Real-time Object Detection**: Accesses the device's camera to acquire live video frames, identifies objects via the YOLOv5 model, and filters invalid detection results using a confidence threshold (0.5) and IoU (Intersection over Union) threshold (0.45).
|
||||
2. **Visualized Display**: Marks object positions with red rectangular boxes and displays object category names on the detection screen. It also shows performance metrics including detection time consumption (camera capture, model inference, screen display), total time consumption, and real-time frame rate.
|
||||
3. **Touch Exit Function**: An exit button (ret.png image) is displayed in the upper-left corner of the screen; touching this area immediately exits the program.
|
||||
4. **Exception Handling**: Built-in exception detection and log output for camera reading, model loading, image resizing, and other processes to ensure stable program operation.
|
||||
|
||||
## 3. Usage Instructions
|
||||
### 3.1 Running and Operation Steps
|
||||
1. Upload the compiled program files to the specified directory on the device.
|
||||
2. Execute the program startup command via the terminal or locally on the device. After startup, the camera activates automatically, the display screen shows real-time detection frames, and an exit button appears in the upper-left corner of the screen.
|
||||
3. During detection, the screen real-time displays object bounding boxes, object category names, as well as time consumption for camera capture, model detection, screen display, total time consumption, and real-time frame rate.
|
||||
4. Exiting the program:
|
||||
- Normal method: Touch the exit button area in the upper-left corner of the display screen with your finger to terminate the program immediately.
|
||||
- Emergency method: If running the program via the terminal, press the Ctrl + C shortcut to force exit.
|
||||
|
||||
## 4. Notes
|
||||
1. **File Path**: Ensure the file path of `yolov5s.mud` matches the path specified in the program. Incorrect paths will cause program startup failure and output error logs.
|
||||
2. **Hardware Compatibility**: The program automatically adapts font size and button dimensions based on camera resolution. For devices with special screen/camera resolutions, the button may display incompletely or the touch area may shift—adjust the button scaling parameters in the code if needed.
|
||||
3. **Performance Metrics**: Time consumption, frame rate, and other performance data are for reference only and vary with different hardware configurations (chip model, memory size).
|
||||
4. **Exception Handling**: If the program fails to start, check log information to locate issues (e.g., model loading failure, unrecognized camera, missing image files).
|
||||
5. **Resource Release**: The program automatically releases resources (camera, display screen, images, detection results) upon exit—manual cleanup is unnecessary. Avoid forced power-off to prevent resource occupation.
|
||||
|
||||
## 5. Further Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_detector)
|
||||
|
||||
[MaixPy MaixCAM: Object Detection with YOLOv5 / YOLOv8 / YOLO11 Models](https://wiki.sipeed.com/maixpy/doc/en/vision/yolov5.html)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -1,9 +1,85 @@
|
||||
## 1. 简介
|
||||
本程序是基于MaixCam硬件平台和LVGL图形界面开发的**实时寻线识别应用**,核心通过LAB颜色空间阈值筛选实现图像中的线条检测,支持用户自定义LAB阈值参数、实时查看像素颜色信息、可视化寻线结果,并可将用户配置的参数持久化保存,同时通过串口协议上报检测数据,适用于巡线小车、视觉检测等场景的基础寻线功能开发与验证。
|
||||
|
||||
## 2. 主要功能
|
||||
1. **LAB阈值配置**:支持自定义LAB颜色空间的L(亮度)、A(红绿色差)、B(蓝黄色差)阈值范围,默认配置为L(0-27)、A(-128-127)、B(-128-127),且参数修改后自动保存;
|
||||
2. **像素颜色采集**:点击屏幕任意位置可采集对应像素的RGB及LAB值,并在界面上展示;
|
||||
3. **寻线检测**:基于设定的LAB阈值对摄像头画面进行线条检测,识别线条的坐标、角度等信息;
|
||||
4. **可视化展示**:
|
||||
- 检测到的线条以绿色线条标注在画面中;
|
||||
- 线条角度判断后显示左/右方向标识;
|
||||
- 支持开启“二值化模式”,直观查看阈值筛选后的黑白图像;
|
||||
5. **数据上报**:通过串口通信协议将检测到的线条坐标、角度等信息上报,支持与外部设备(如MCU、上位机)交互;
|
||||
6. **参数持久化**:程序退出时自动保存用户配置的LAB阈值,下次启动自动加载。
|
||||
|
||||
# uart protocol
|
||||
## 3. 使用说明
|
||||
### 3.1 程序操作流程
|
||||
#### 3.1.1 首次启动
|
||||
1. 运行程序后,自动初始化并加载默认LAB阈值(L:0-27、A:-128-127、B:-128-127),界面显示摄像头实时画面;
|
||||
2. 若配置文件不存在,程序自动创建并写入默认参数,日志提示“use default lab config for user”。
|
||||
|
||||
识别到色块时,将会把色块的四个顶点信息通过串口协议上报。
|
||||
#### 3.1.2 阈值调整
|
||||
1. 在界面上找到Lmin/Lmax、Amin/Amax、Bmin/Bmax对应的调节控件(如滑块、输入框);
|
||||
2. 调整对应数值,程序实时更新检测阈值,日志会打印当前配置的阈值(格式:{Lmin, Lmax, Amin, Amax, Bmin, Bmax});
|
||||
3. 调整后无需手动保存,退出程序时自动持久化。
|
||||
|
||||
例如上报内容为:AA CA AC BB 14 00 00 00 E1 08 EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00 A7 20,其中`08`是本次消息的命令码0x08, `EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00`为依次为4个顶点坐标值,`EE 00`和`37 00`表示第一个顶点坐标为(238, 55),`15 01`和`F7 FF`表示第二个顶点坐标为(277, -9),`4E 01`和`19 00`表示第三个顶点坐标为(334, 25),`27 01`和`5A 00`表示第四个顶点坐标为(295, 90)。
|
||||
#### 3.1.3 像素颜色采集
|
||||
1. 点击屏幕任意位置,程序采集该位置像素的RGB和LAB值;
|
||||
2. 界面上的“颜色框”会依次显示采集到的颜色及对应数值,同时日志打印触摸坐标(touch (x, y))。
|
||||
|
||||
#### 3.1.4 寻线检测与可视化
|
||||
1. 程序默认实时进行寻线检测,检测到线条后画面中显示绿色线条;
|
||||
2. 线条角度>0且<90°时显示右方向标识,否则显示左方向标识;
|
||||
3. 开启“二值化模式”(界面“眼睛”按钮):
|
||||
- 点击“眼睛开启”,画面切换为二值化图像(阈值内像素为白色,其余为黑色);
|
||||
- 点击“眼睛关闭”,恢复摄像头原始画面。
|
||||
|
||||
#### 3.1.5 退出程序
|
||||
1. 通过界面“退出”按钮触发退出,日志提示“exit!”;
|
||||
2. 程序自动保存当前LAB阈值,日志打印“save user's lab config”及保存的参数。
|
||||
|
||||
### 3.2 自定义扩展
|
||||
1. 调整寻线精度:修改`app_loop`中以下参数可优化检测效果:
|
||||
- `x_stride/y_stride`:检测步长(值越小精度越高,性能消耗越大);
|
||||
- `area_threshold/pixels_threshold`:面积/像素阈值(过滤小面积噪声线条);
|
||||
- `roi`:检测区域(默认全屏,可缩小区域减少计算量);
|
||||
2. 通信协议扩展:修改`APP_CMD_REPORT_FIND_LINES`(指令码9)或`priv.ptl->report()`的参数,适配外部设备的通信格式;
|
||||
3. 可视化优化:调整`ui_show_left_or_right`中的位置(x/y)、缩放比例(transform_scale)等,适配不同尺寸屏幕。
|
||||
|
||||
## 4. 串口通信协议(uart protocol)
|
||||
程序检测到线条(色块)后,会将相关坐标信息通过串口协议上报,便于外部设备解析和交互。
|
||||
### 4.1 数据格式示例
|
||||
上报内容示例:`AA CA AC BB 14 00 00 00 E1 08 EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00 A7 20`
|
||||
### 4.2 字段解析
|
||||
- `08`:本次消息的命令码(十六进制0x08),用于标识当前上报的是寻线/色块检测数据;
|
||||
- `EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00`:4个顶点的坐标值,按顺序排列,每个顶点由2字节x坐标+2字节y坐标组成(小端模式):
|
||||
- `EE 00`(x) + `37 00`(y) → 第一个顶点坐标为(238, 55);
|
||||
- `15 01`(x) + `F7 FF`(y) → 第二个顶点坐标为(277, -9);
|
||||
- `4E 01`(x) + `19 00`(y) → 第三个顶点坐标为(334, 25);
|
||||
- `27 01`(x) + `5A 00`(y) → 第四个顶点坐标为(295, 90)。
|
||||
|
||||
### 4.3 解析说明
|
||||
- 坐标值为**小端模式**(低字节在前,高字节在后),解析时需先拼接高低字节再转换为十进制;
|
||||
- 负数坐标以补码形式表示(如`F7 FF`转换为十进制为-9);
|
||||
- 串口波特率、校验位等参数需与外部设备保持一致(默认参数可参考Maix平台串口配置)。
|
||||
|
||||
## 5. 注意事项
|
||||
1. **阈值合理性**:
|
||||
- L值范围为0-100,A/B值范围为-128-127,超出范围可能导致检测失效;
|
||||
- 调整阈值时建议先采集目标线条的LAB值,再以该值为中心小幅调整范围;
|
||||
2. **硬件性能**:开启二值化模式或缩小检测步长会增加计算量,可能导致画面帧率下降;
|
||||
3. **触摸采集精度**:触摸屏校准不准确会导致采集的像素坐标偏差,建议先校准触摸屏;
|
||||
4. **配置文件异常**:若配置文件损坏,程序会加载默认参数,可删除配置文件后重启恢复;
|
||||
5. **资源释放**:程序退出时会自动释放通信协议对象(`priv.ptl`),请勿强制终止程序,避免内存泄漏;
|
||||
6. **串口通信**:
|
||||
- 确保串口外设未被其他程序占用,否则会导致数据上报失败;
|
||||
- 外部设备解析数据时需严格按照小端模式解析坐标,避免数值错误;
|
||||
7. **日志排查**:运行异常时查看日志,重点关注:
|
||||
- “protocol init failed!”:通信协议初始化失败,检查内存是否充足;
|
||||
- “camera read failed”:摄像头读取失败,检查硬件连接;
|
||||
- 阈值打印信息:确认是否与界面配置一致。
|
||||
|
||||
## 6. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_line_tracking)
|
||||
|
||||
[MaixCAM MaixPy 小车巡线](https://wiki.sipeed.com/maixpy/doc/zh/projects/line_tracking_robot.html)
|
||||
85
projects/app_line_tracking/README_EN.md
Normal file
85
projects/app_line_tracking/README_EN.md
Normal file
@@ -0,0 +1,85 @@
|
||||
## 1. Introduction
|
||||
This program is a **real-time line tracking application** developed based on the MaixCam hardware platform and the LVGL graphical interface. It utilizes LAB color space threshold filtering to detect lines in images. It supports user-defined LAB threshold parameters, real-time viewing of pixel color information, visualization of tracking results, and persistent saving of user configurations. Additionally, it reports detection data via a serial port protocol, making it suitable for the development and verification of basic line tracking functions in scenarios such as line-following robots and visual inspection systems.
|
||||
|
||||
## 2. Main Features
|
||||
1. **LAB Threshold Configuration**: Supports customizing the threshold ranges for L (Lightness), A (Red-Green), and B (Blue-Yellow) in the LAB color space. The default configuration is L(0-27), A(-128-127), B(-128-127), and parameters are saved automatically after modification.
|
||||
2. **Pixel Color Sampling**: Clicking anywhere on the screen captures the RGB and LAB values of the corresponding pixel and displays them on the interface.
|
||||
3. **Line Detection**: Performs line detection on the camera feed based on the set LAB thresholds to identify line coordinates, angles, and other information.
|
||||
4. **Visualization**:
|
||||
* Detected lines are marked with green lines on the screen.
|
||||
* Direction indicators (Left/Right) are displayed based on the line angle.
|
||||
* Supports a "Binary Mode" to visually inspect the black-and-white image after threshold filtering.
|
||||
5. **Data Reporting**: Reports detected line coordinates and angles via a serial communication protocol, supporting interaction with external devices (such as MCUs or host computers).
|
||||
6. **Parameter Persistence**: Automatically saves user-configured LAB thresholds when the program exits and loads them on the next startup.
|
||||
|
||||
## 3. User Guide
|
||||
### 3.1 Program Operation Flow
|
||||
#### 3.1.1 First Launch
|
||||
1. After running the program, it automatically initializes and loads the default LAB thresholds (L: 0-27, A: -128-127, B: -128-127), and the interface displays the real-time camera feed.
|
||||
2. If the configuration file does not exist, the program automatically creates it and writes the default parameters. The log will prompt "use default lab config for user".
|
||||
|
||||
#### 3.1.2 Adjusting Thresholds
|
||||
1. Find the adjustment controls (such as sliders or input boxes) for Lmin/Lmax, Amin/Amax, and Bmin/Bmax on the interface.
|
||||
2. Adjust the corresponding values. The program updates the detection thresholds in real-time, and the log prints the current configuration (format: {Lmin, Lmax, Amin, Amax, Bmin, Bmax}).
|
||||
3. No manual saving is required after adjustment; the values are persisted automatically when the program exits.
|
||||
|
||||
#### 3.1.3 Pixel Color Sampling
|
||||
1. Click anywhere on the screen to capture the RGB and LAB values of that pixel.
|
||||
2. The "Color Box" on the interface sequentially displays the sampled color and its corresponding values, while the log prints the touch coordinates (touch (x, y)).
|
||||
|
||||
#### 3.1.4 Line Detection and Visualization
|
||||
1. The program performs real-time line detection by default. When a line is detected, it is displayed as a green line on the screen.
|
||||
2. A right direction indicator is shown if the line angle is > 0° and < 90°; otherwise, a left direction indicator is shown.
|
||||
3. Enabling "Binary Mode" (via the "Eye" button on the interface):
|
||||
* Click "Eye Open" to switch the view to a binary image (pixels within the threshold are white, others are black).
|
||||
* Click "Eye Close" to revert to the original camera feed.
|
||||
|
||||
#### 3.1.5 Exiting the Program
|
||||
1. Trigger the exit via the "Exit" button on the interface; the log will prompt "exit!".
|
||||
2. The program automatically saves the current LAB thresholds, and the log prints "save user's lab config" along with the saved parameters.
|
||||
|
||||
### 3.2 Custom Extension
|
||||
1. **Adjusting Detection Precision**: Modify the following parameters in `app_loop` to optimize detection performance:
|
||||
* `x_stride/y_stride`: Detection step size (smaller values mean higher precision but higher performance cost).
|
||||
* `area_threshold/pixels_threshold`: Area/pixel thresholds (filters out small noise lines).
|
||||
* `roi`: Region of Interest (default is full screen; reducing the area reduces computation).
|
||||
2. **Communication Protocol Extension**: Modify parameters in `APP_CMD_REPORT_FIND_LINES` (Command Code 9) or `priv.ptl->report()` to adapt to the communication format of external devices.
|
||||
3. **Visualization Optimization**: Adjust the position (x/y) and scale (`transform_scale`) in `ui_show_left_or_right` to fit different screen sizes.
|
||||
|
||||
## 4. Serial Communication Protocol (UART Protocol)
|
||||
When the program detects a line (or color block), it reports the relevant coordinate information via the serial port protocol for parsing and interaction by external devices.
|
||||
### 4.1 Data Format Example
|
||||
Example Report: `AA CA AC BB 14 00 00 00 E1 08 EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00 A7 20`
|
||||
### 4.2 Field Parsing
|
||||
* `08`: The command code for this message (Hex 0x08), indicating that line tracking/color block detection data is being reported.
|
||||
* `EE 00 37 00 15 01 F7 FF 4E 01 19 00 27 01 5A 00`: Coordinate values of 4 vertices, arranged sequentially. Each vertex consists of a 2-byte x-coordinate + 2-byte y-coordinate (Little Endian):
|
||||
* `EE 00` (x) + `37 00` (y) → First vertex coordinates (238, 55).
|
||||
* `15 01` (x) + `F7 FF` (y) → Second vertex coordinates (277, -9).
|
||||
* `4E 01` (x) + `19 00` (y) → Third vertex coordinates (334, 25).
|
||||
* `27 01` (x) + `5A 00` (y) → Fourth vertex coordinates (295, 90).
|
||||
|
||||
### 4.3 Parsing Notes
|
||||
* Coordinate values are in **Little Endian** format (Least Significant Byte first). When parsing, concatenate the high and low bytes before converting to decimal.
|
||||
* Negative coordinates are represented in two's complement (e.g., `F7 FF` converts to decimal -9).
|
||||
* Serial port parameters such as baud rate and parity must match those of the external device (refer to Maix platform serial port configuration for defaults).
|
||||
|
||||
## 5. Precautions
|
||||
1. **Threshold Reasonableness**:
|
||||
* The valid range for L is 0-100, and for A/B it is -128-127. Exceeding these ranges may cause detection failure.
|
||||
* When adjusting thresholds, it is recommended to first sample the LAB value of the target line and then adjust the range slightly around that value.
|
||||
2. **Hardware Performance**: Enabling Binary Mode or reducing the detection step size increases computational load, which may cause a drop in frame rate.
|
||||
3. **Touch Sampling Accuracy**: Inaccurate touchscreen calibration leads to deviations in sampled pixel coordinates. It is recommended to calibrate the touchscreen first.
|
||||
4. **Configuration File Issues**: If the configuration file is corrupted, the program loads default parameters. Recovery can be done by deleting the configuration file and restarting.
|
||||
5. **Resource Release**: The communication protocol object (`priv.ptl`) is released automatically on exit. Do not force-terminate the program to avoid memory leaks.
|
||||
6. **Serial Communication**:
|
||||
* Ensure the serial port peripheral is not occupied by other programs, as this causes reporting failure.
|
||||
* External devices must parse coordinates strictly in Little Endian mode to avoid value errors.
|
||||
7. **Log Troubleshooting**: Check logs for exceptions, focusing on:
|
||||
* "protocol init failed!": Communication protocol initialization failed; check for sufficient memory.
|
||||
* "camera read failed": Camera read failed; check hardware connections.
|
||||
* Threshold print information: Verify it matches the interface configuration.
|
||||
|
||||
## 6. More Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_line_tracking)
|
||||
|
||||
[MaixCAM MaixPy Line Tracking Robot (/Car)](https://wiki.sipeed.com/maixpy/doc/en/projects/line_tracking_robot.html)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -1,8 +1,64 @@
|
||||
# README
|
||||
Displaying Images and Playing Videos
|
||||
## 1. 简介
|
||||
本应用是基于MaixCam平台开发的相册视频一体化管理与播放工具,支持按日期分类管理图片和视频文件,提供图片查看、视频播放、文件删除等核心功能,适配Maix系列硬件的显示与交互逻辑,可直观地浏览和操作本地存储的多媒体文件。
|
||||
|
||||
## Displaying Images
|
||||
When the program starts, it will read and display images from the `/maixapp/share/picture/` directory. The program supports `jpg` and `png` image formats. It is recommended that the image resolution does not exceed `2560x1440`, and the width must be a multiple of `32`.
|
||||
## 2. 主要功能
|
||||
### 2.1 文件管理
|
||||
- 自动扫描指定路径(`/maixapp/share/picture` 图片、`/maixapp/share/video` 视频)下的多媒体文件,按日期目录分类整理;
|
||||
- 自动生成图片/视频缩略图(128x128尺寸),提升浏览效率;
|
||||
- 支持批量删除、单文件删除,删除后自动更新界面并清理本地文件。
|
||||
|
||||
## Displaying Videos
|
||||
When the program starts, it will read videos from the `/maixapp/share/video/` directory. The program supports playing, pausing, and setting the playback position. Only `mp4` videos encoded in the `H.264` format are supported. It is recommended that the video resolution does not exceed `2560x1440`, and the width must be a multiple of `32`.
|
||||
### 2.2 媒体浏览与播放
|
||||
- 缩略图模式快速浏览所有图片/视频,点击缩略图可切换至全屏查看/播放模式;
|
||||
- 图片全屏查看:支持左右滑动切换上一张/下一张图片;
|
||||
- 视频全屏播放:支持播放/暂停控制、进度条拖动调整播放进度,自动适配显示分辨率。
|
||||
|
||||
### 2.3 异常处理
|
||||
- 自动忽略无法加载的文件,并记录至忽略列表,避免重复加载失败;
|
||||
- 视频解码失败时自动重试(最多3次),重试失败则显示默认空白界面。
|
||||
|
||||
## 3. 使用说明
|
||||
### 3.1 启动应用
|
||||
应用启动后会自动扫描指定目录下的图片(.jpg/.jpeg/.png)和视频(.mp4)文件,按日期分类生成缩略图列表,默认进入缩略图浏览界面。
|
||||
|
||||
### 3.2 缩略图浏览
|
||||
- 界面显示所有可识别的图片/视频缩略图,按日期分组展示;
|
||||
- 点击图片缩略图:进入图片全屏查看模式;
|
||||
- 点击视频缩略图:进入视频播放准备界面,自动加载视频首帧。
|
||||
|
||||
### 3.3 图片全屏操作
|
||||
- 查看:全屏显示图片,自动适配屏幕分辨率;
|
||||
- 切换:点击屏幕左侧/右侧,切换上一张/下一张图片;
|
||||
- 删除:触发删除操作(界面指定删除按钮),可删除当前图片及对应缩略图,返回缩略图列表。
|
||||
|
||||
### 3.4 视频全屏操作
|
||||
- 播放/暂停:点击视频区域,切换播放(标识4)/暂停(标识5)状态;
|
||||
- 进度调整:拖动进度条可快速跳转视频播放位置,释放进度条后自动定位至对应时间点;
|
||||
- 退出播放:播放结束后自动停留在最后一帧,可返回缩略图列表。
|
||||
|
||||
### 3.5 文件删除
|
||||
- 单文件删除:全屏查看/播放模式下触发删除,删除当前文件;
|
||||
- 批量删除:缩略图模式下启用批量删除功能,选择多个文件后执行删除,自动清理本地文件和界面列表。
|
||||
|
||||
## 4. 注意事项
|
||||
### 4.1 文件路径要求
|
||||
- 图片/视频需存放至指定目录:图片放 `/maixapp/share/picture`、视频放 `/maixapp/share/video`,且需按日期命名子目录(如 `2024-01-01`),否则可能无法被扫描识别;
|
||||
- 仅支持 `.jpg/.jpeg/.png` 格式图片、H.264编码的 `.mp4` 格式视频,其他格式文件会被自动忽略。
|
||||
|
||||
### 4.2 分辨率与格式限制
|
||||
- 图片:建议分辨率不超过2560x1440,且宽度必须为32的倍数;
|
||||
- 视频:建议分辨率不超过2560x1440,且宽度必须为32的倍数,仅支持H.264编码的MP4格式;
|
||||
- 视频播放依赖硬件解码能力,高分辨率/高码率视频可能出现卡顿,建议使用适配屏幕分辨率(如552x368)的视频文件。
|
||||
|
||||
### 4.3 性能与兼容性
|
||||
- 缩略图生成需要一定时间,首次加载大量文件时界面响应可能延迟,属于正常现象。
|
||||
|
||||
### 4.4 存储与权限
|
||||
- 删除操作会直接删除本地文件(包括原文件和缩略图),不可恢复,操作前请确认;
|
||||
- 确保应用对 `/maixapp/share/picture`、`/maixapp/share/video` 目录有读写权限,否则无法创建缩略图、删除文件。
|
||||
|
||||
### 4.5 异常处理
|
||||
- 若视频无法播放,检查文件是否损坏或是否为H.264编码的标准MP4格式;
|
||||
- 若图片无法加载,确认文件路径和格式无误,损坏文件会被自动加入忽略列表,需手动删除后重新扫描。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_photos)
|
||||
|
||||
64
projects/app_photos/README_EN.md
Normal file
64
projects/app_photos/README_EN.md
Normal file
@@ -0,0 +1,64 @@
|
||||
## 1. Introduction
|
||||
This application is an integrated photo and video management and playback tool developed for the MaixCam platform. It supports managing image and video files by date, providing core features such as image viewing, video playback, and file deletion. It is optimized for the display and interaction logic of Maix series hardware, allowing for intuitive browsing and manipulation of local multimedia files.
|
||||
|
||||
## 2. Main Features
|
||||
### 2.1 File Management
|
||||
- Automatically scans multimedia files under specified paths (`/maixapp/share/picture` for images, `/maixapp/share/video` for videos) and organizes them by date directories.
|
||||
- Automatically generates thumbnails (128x128 resolution) for images and videos to improve browsing efficiency.
|
||||
- Supports batch deletion and single-file deletion. The interface updates automatically and local files are cleaned up after deletion.
|
||||
|
||||
### 2.2 Media Browsing and Playback
|
||||
- Thumbnail mode allows for quick browsing of all images/videos; clicking a thumbnail switches to full-screen view/playback mode.
|
||||
- **Full-screen Image Viewing:** Supports left/right swiping to switch between previous/next images.
|
||||
- **Full-screen Video Playback:** Supports play/pause controls and progress bar dragging to adjust playback position. Automatically adapts to the display resolution.
|
||||
|
||||
### 2.3 Exception Handling
|
||||
- Automatically ignores files that cannot be loaded and records them in an ignore list to avoid repeated loading failures.
|
||||
- Automatically retries video decoding up to 3 times if it fails; displays a default blank screen if retries are unsuccessful.
|
||||
|
||||
## 3. User Guide
|
||||
### 3.1 Launching the Application
|
||||
Upon startup, the application automatically scans for image (`.jpg`/`.jpeg`/`.png`) and video (`.mp4`) files in the specified directories, generates a thumbnail list grouped by date, and defaults to the thumbnail browsing interface.
|
||||
|
||||
### 3.2 Thumbnail Browsing
|
||||
- The interface displays all recognizable image/video thumbnails, grouped by date.
|
||||
- **Click Image Thumbnail:** Enters full-screen image viewing mode.
|
||||
- **Click Video Thumbnail:** Enters the video playback preparation interface and automatically loads the first frame of the video.
|
||||
|
||||
### 3.3 Full-screen Image Operations
|
||||
- **View:** Displays the image in full screen, automatically adapting to the screen resolution.
|
||||
- **Switch:** Click the left/right side of the screen to switch to the previous/next image.
|
||||
- **Delete:** Triggers the delete operation (via the designated delete button on the interface). Deletes the current image and its corresponding thumbnail, then returns to the thumbnail list.
|
||||
|
||||
### 3.4 Full-screen Video Operations
|
||||
- **Play/Pause:** Click the video area to toggle between Play (Icon 4) and Pause (Icon 5) states.
|
||||
- **Adjust Progress:** Drag the progress bar to quickly jump to a specific position in the video; automatically seeks to the corresponding timestamp when the progress bar is released.
|
||||
- **Exit Playback:** Automatically pauses on the last frame after playback ends; you can return to the thumbnail list.
|
||||
|
||||
### 3.5 File Deletion
|
||||
- **Single File Deletion:** Trigger deletion while in full-screen view/playback mode to delete the current file.
|
||||
- **Batch Deletion:** Enable batch delete in thumbnail mode, select multiple files to execute deletion. Local files and the interface list are cleaned up automatically.
|
||||
|
||||
## 4. Notes
|
||||
### 4.1 File Path Requirements
|
||||
- Images/videos must be stored in the specified directories: Images in `/maixapp/share/picture`, videos in `/maixapp/share/video`. Subdirectories must be named by date (e.g., `2024-01-01`), otherwise they may not be scanned or recognized.
|
||||
- Only `.jpg`/`.jpeg`/`.png` image formats and H.264 encoded `.mp4` video formats are supported; other formats are automatically ignored.
|
||||
|
||||
### 4.2 Resolution and Format Limitations
|
||||
- **Images:** It is recommended that the resolution does not exceed 2560x1440, and the width must be a multiple of 32.
|
||||
- **Videos:** It is recommended that the resolution does not exceed 2560x1440, and the width must be a multiple of 32. Only H.264 encoded MP4 format is supported.
|
||||
- Video playback relies on hardware decoding capabilities. High-resolution/high-bitrate videos may experience lag; it is recommended to use video files adapted to the screen resolution (e.g., 552x368).
|
||||
|
||||
### 4.3 Performance and Compatibility
|
||||
- Thumbnail generation takes time. Interface response delays when loading a large number of files for the first time are normal.
|
||||
|
||||
### 4.4 Storage and Permissions
|
||||
- The delete operation directly removes local files (including the original file and thumbnail) and is irreversible; please confirm before proceeding.
|
||||
- Ensure the application has read/write permissions for the `/maixapp/share/picture` and `/maixapp/share/video` directories; otherwise, thumbnails cannot be created and files cannot be deleted.
|
||||
|
||||
### 4.5 Exception Handling
|
||||
- If a video cannot play, check if the file is corrupted or if it is a standard H.264 encoded MP4 file.
|
||||
- If an image cannot load, verify the file path and format are correct. Corrupted files are automatically added to the ignore list and need to be manually deleted before rescanning.
|
||||
|
||||
## 5. More Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_photos)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -1,9 +1,36 @@
|
||||
speech Project based on MaixCDK
|
||||
====
|
||||
# 语音识别应用使用说明
|
||||
## 1. 简介
|
||||
本应用是基于Maix-Speech开发的语音识别工具,集成了数字识别、关键词唤醒、长语音连续识别三大核心语音处理能力,并通过可视化界面展示识别结果,支持触控操作切换功能模式,适配中文语音交互场景。
|
||||
|
||||
## 2. 主要功能
|
||||
| 功能模块 | 功能描述 |
|
||||
|----------|----------|
|
||||
| 数字识别(digit) | 识别语音中的数字内容,并将识别结果实时显示在屏幕上 |
|
||||
| 关键词唤醒(kws) | 支持识别“小爱同学”“天猫精灵”“天气怎么样”三个预设关键词,识别到后高亮展示对应关键词 |
|
||||
| 长语音连续识别(lvcsr) | 支持通用中文长语音连续识别,可识别任意中文语句,同时输出拼音和汉字结果 |
|
||||
| 触控交互 | 通过屏幕触控切换不同功能模式、清空识别结果,操作直观便捷 |
|
||||
| 多语言界面 | 支持中英文界面切换,适配不同语言使用习惯 |
|
||||
|
||||
## 3. 使用说明
|
||||
### 3.1 启动应用
|
||||
将应用程序部署到Maix硬件设备后,直接运行可执行文件即可启动,启动后屏幕会显示语音识别主界面,默认进入**数字识别模式**(digit模式,底部digit标识为绿色)。
|
||||
|
||||
### 3.2 功能切换
|
||||
通过点击屏幕底部功能区实现模式切换:
|
||||
- **Clear(清空)**:点击屏幕左下角“Clear”区域,清空当前屏幕显示的识别结果;
|
||||
- **digit(数字识别)**:点击屏幕底部左侧“digit”区域,切换至数字识别模式(标识变绿),此时说出数字即可识别并显示;
|
||||
- **kws(关键词唤醒)**:点击屏幕底部中间“kws”区域,切换至关键词唤醒模式(标识变绿),屏幕会显示“小爱同学、天猫精灵、天气怎么样”三个关键词,说出对应关键词即可识别并高亮展示;
|
||||
- **lvcsr(长语音识别)**:点击屏幕底部右侧“lvcsr”区域,切换至长语音连续识别模式(标识变绿),此时说出任意中文语句,屏幕会显示识别后的汉字及对应拼音。
|
||||
|
||||
### 3.3 退出应用
|
||||
点击屏幕左上角的退出区域(40×40像素范围),即可关闭应用程序。
|
||||
|
||||
This is a project based on MaixCDK, build method please visit [MaixCDK](https://github.com/sipeed/MaixCDK)
|
||||
## 4. 注意事项
|
||||
1. 模型依赖:应用运行前需确保/root/models/目录下存在语音识别所需的模型文件(am_3332_192_int8.mud、lmS目录下的语言模型等),缺失模型会导致功能无法使用;
|
||||
2. 操作提示:切换功能模式时需等待当前模式停止运行后再操作,避免功能冲突;
|
||||
3. 语音输入:使用时需保持环境安静,距离麦克风30-50cm说话,可提升识别准确率。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_speech)
|
||||
|
||||
[MaixCAM MaixPy 语音实时识别](https://wiki.sipeed.com/maixpy/doc/zh/audio/recognize.html)
|
||||
41
projects/app_speech/README_EN.md
Normal file
41
projects/app_speech/README_EN.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Voice Recognition Application User Guide
|
||||
|
||||
## 1. Introduction
|
||||
This application is a voice recognition tool developed based on Maix-Speech. It integrates three core voice processing capabilities: digit recognition, keyword wake-up, and long-form continuous speech recognition (LVCSR). It displays recognition results through a visual interface and supports touch operation to switch between functional modes, making it suitable for Chinese voice interaction scenarios.
|
||||
|
||||
## 2. Main Features
|
||||
|
||||
| Feature Module | Description |
|
||||
|----------|----------|
|
||||
| **Digit Recognition** | Recognizes numeric content in speech and displays the results in real-time on the screen. |
|
||||
| **Keyword Wake-up (KWS)** | Supports recognition of three preset keywords: "Xiaoai Tongxue" (Xiaomi AI), "Tmall Genie", and "Tianqi Zenmeyang" (How is the weather). The recognized keyword is highlighted upon detection. |
|
||||
| **Long-form Continuous Speech Recognition (LVCSR)** | Supports general continuous Chinese speech recognition. It can recognize arbitrary Chinese sentences and outputs both Pinyin and Hanzi (Chinese character) results. |
|
||||
| **Touch Interaction** | Intuitive and convenient operation to switch between different functional modes and clear recognition results via screen touch. |
|
||||
| **Multilingual Interface** | Supports switching between Chinese and English interfaces to adapt to different language usage habits. |
|
||||
|
||||
## 3. Usage Instructions
|
||||
|
||||
### 3.1 Starting the Application
|
||||
After deploying the application to the Maix hardware device, run the executable file to start it. Upon launch, the voice recognition main interface will appear, and the app will default to **Digit Recognition mode** (indicated by the green "digit" label at the bottom).
|
||||
|
||||
### 3.2 Switching Functions
|
||||
Switch modes by tapping the function area at the bottom of the screen:
|
||||
|
||||
* **Clear**: Tap the "Clear" area at the bottom left to clear the recognition results currently displayed on the screen.
|
||||
* **Digit**: Tap the "digit" area on the bottom left to switch to Digit Recognition mode (the label turns green). Speak numbers to have them recognized and displayed.
|
||||
* **KWS**: Tap the "kws" area in the bottom center to switch to Keyword Wake-up mode (the label turns green). The screen will display the three keywords: "Xiaoai Tongxue", "Tmall Genie", and "Tianqi Zenmeyang". Speaking the corresponding keyword will trigger recognition and highlight the word.
|
||||
* **LVCSR**: Tap the "lvcsr" area on the bottom right to switch to Long-form Speech Recognition mode (the label turns green). Speak any Chinese sentence, and the screen will display the recognized text in both Hanzi and Pinyin.
|
||||
|
||||
### 3.3 Exiting the Application
|
||||
Tap the exit area in the top-left corner of the screen (approx. 40×40 pixels) to close the application.
|
||||
|
||||
## 4. Notes
|
||||
|
||||
1. **Model Dependencies**: Before running the application, ensure the required voice recognition model files exist in the `/root/models/` directory (specifically `am_3332_192_int8.mud` and language models under the `lmS` directory). Missing models will prevent the functions from working.
|
||||
2. **Operational Tips**: When switching functional modes, wait for the current mode to stop running before tapping to avoid functional conflicts.
|
||||
3. **Voice Input**: For optimal accuracy, maintain a quiet environment and speak at a distance of 30-50cm from the microphone.
|
||||
|
||||
## 5. More Information
|
||||
|
||||
* [Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_speech)
|
||||
* [MaixCAM MaixPy Real-time Speech Recognition](https://wiki.sipeed.com/maixpy/doc/en/audio/recognize.html)
|
||||
@@ -11,3 +11,4 @@ files:
|
||||
assets: assets
|
||||
locales: locales
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
@@ -1,8 +1,37 @@
|
||||
# Thermal camera
|
||||
## 1. 简介
|
||||
本程序适用于搭载MaixCam/Pro/2硬件平台的设备,主要实现对PMOD_Thermal32红外热成像传感器的驱动与数据可视化,支持热成像画面与摄像头画面融合显示,可实时展示温度数据、极值温度标注等核心信息,是一套开箱即用的热成像数据采集与可视化解决方案。
|
||||
|
||||
## 2. 主要功能
|
||||
1. **设备自动检测**:程序启动后自动扫描I2C总线(MAIXCAM为I2C5,MAIXCAM2为I2C7),识别是否接入PMOD_Thermal32热成像传感器;
|
||||
2. **热成像可视化**:将PMOD_Thermal32采集的32×24像素温度矩阵转换为可视化图像,并缩放至显示屏分辨率展示;
|
||||
3. **多模式显示**:支持纯热成像模式、热成像与摄像头画面融合模式切换;
|
||||
4. **温度标注**:实时显示画面中最高温度、最低温度、中心位置温度,并通过十字准星标注对应位置;
|
||||
5. **交互支持**:适配触摸屏操作,支持退出程序、模式切换等基础交互;
|
||||
6. **自适应硬件**:兼容MAIXCAM/MAIXCAM2两种硬件平台,自动适配I2C引脚与驱动加载逻辑。
|
||||
|
||||
## Supported List
|
||||
## 3. 使用说明
|
||||
### 3.1 硬件准备
|
||||
1. 将PMOD_Thermal32传感器通过对应接口连接至设备的指定I2C总线(MAIXCAM接I2C5,MAIXCAM2接I2C7);
|
||||
2. 确保设备显示屏、触摸屏、摄像头(如需融合模式)已正确安装并接线。
|
||||
|
||||
[Consult purchase address](https://wiki.sipeed.com/en/store.html)
|
||||
### 3.2 运行程序
|
||||
3. 程序启动后会自动检测PMOD_Thermal32设备:
|
||||
- 检测到设备:自动进入热成像显示界面,实时刷新热成像画面;
|
||||
- 未检测到设备:屏幕显示“Devices Not Found!”提示,点击触摸屏任意位置可退出程序。
|
||||
|
||||
* PMOD_Thermal32
|
||||
### 3.3 操作说明
|
||||
1. **模式切换**:支持热成像纯模式/热成像+摄像头融合模式切换(具体切换方式需结合设备UI交互逻辑,如触摸屏点击指定区域);
|
||||
2. **退出程序**:在显示界面点击触摸屏(未检测到设备时),或通过设备默认退出指令(如快捷键、串口指令)退出;
|
||||
3. **画面刷新**:程序后台自动循环采集传感器数据,画面实时刷新(PMOD_Thermal32帧率为32FPS)。
|
||||
|
||||
## 4. 注意事项
|
||||
1. **传感器接线**:MLX90640的I2C地址固定为0x33,需确保接线正确且无地址冲突;
|
||||
2. **摄像头复位**:融合模式下若摄像头异常,程序会自动尝试复位摄像头,复位期间画面会短暂中断,属于正常现象;
|
||||
3. **资源占用**:程序运行时会占用显示屏、I2C、摄像头等硬件资源,退出程序前请勿手动占用这些资源,避免冲突。
|
||||
4. **温度参数**:程序默认适配的温度范围可通过代码调整(当前默认动态适配温度极值,也可手动设置固定范围如5.0℃~60.0℃);
|
||||
5. **色彩映射**:支持切换不同的色彩映射方案(cmap),可根据实际需求调整热成像画面的色彩显示效果;
|
||||
6. **画面缩放**:原始热成像数据为32×24像素,程序通过缩放算法(BICUBIC/BILINEAR)适配显示屏分辨率,保证画面清晰;
|
||||
7. **扩展开发**:程序预留了温度数据接口(如`matrix()`获取温度矩阵、`max_temp_point()`获取最高温坐标与数值),可基于这些接口扩展温度报警、数据存储等功能。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_thermal_camera)
|
||||
37
projects/app_thermal_camera/README_EN.md
Normal file
37
projects/app_thermal_camera/README_EN.md
Normal file
@@ -0,0 +1,37 @@
|
||||
## 1. Overview
|
||||
This program is designed for devices equipped with MaixCam/Pro/2 hardware platforms. It primarily implements driver support and data visualization for the PMOD_Thermal32 infrared thermal imaging sensor, supporting fused display of thermal imaging and camera footage, and real-time display of temperature data (including extreme temperature annotations). It serves as an out-of-the-box solution for thermal imaging data collection and visualization.
|
||||
|
||||
## 2. Key Features
|
||||
1. **Automatic Device Detection**: Upon startup, the program automatically scans the I2C bus (I2C5 for MAIXCAM, I2C7 for MAIXCAM2) to detect the connection of the PMOD_Thermal32 thermal imaging sensor;
|
||||
2. **Thermal Imaging Visualization**: Converts the 32×24 pixel temperature matrix collected by the PMOD_Thermal32 into a visual image, scaled to fit the display resolution for presentation;
|
||||
3. **Multi-Mode Display**: Supports switching between pure thermal imaging mode and thermal imaging + camera fusion mode;
|
||||
4. **Temperature Annotation**: Real-time display of the maximum temperature, minimum temperature, and center position temperature in the frame, with corresponding positions marked by crosshairs;
|
||||
5. **Interactive Support**: Adapted for touchscreen operation, supporting basic interactions such as program exit and mode switching;
|
||||
6. **Hardware Adaptability**: Compatible with MAIXCAM/MAIXCAM2 hardware platforms, automatically adapting I2C pin configurations and driver loading logic.
|
||||
|
||||
## 3. Usage Instructions
|
||||
### 3.1 Hardware Preparation
|
||||
1. Connect the PMOD_Thermal32 sensor to the designated I2C bus of the device via the corresponding interface (I2C5 for MAIXCAM, I2C7 for MAIXCAM2);
|
||||
2. Ensure the device's display, touchscreen, and camera (if fusion mode is required) are properly installed and wired.
|
||||
|
||||
### 3.2 Running the Program
|
||||
3. Upon startup, the program automatically detects the PMOD_Thermal32 device:
|
||||
- Device detected: Automatically enters the thermal imaging display interface, with real-time refresh of the thermal imaging frame;
|
||||
- Device not detected: The screen displays the prompt "Devices Not Found!", and the program can be exited by tapping any position on the touchscreen.
|
||||
|
||||
### 3.3 Operation Instructions
|
||||
1. **Mode Switching**: Supports switching between pure thermal imaging mode and thermal imaging + camera fusion mode (the specific switching method depends on the device's UI interaction logic, e.g., tapping a designated area on the touchscreen);
|
||||
2. **Exiting the Program**: Tap the touchscreen (when no device is detected) or use the device's default exit commands (e.g., shortcut keys, serial port commands) to exit;
|
||||
3. **Frame Refresh**: The program cyclically collects sensor data in the background, with real-time frame refresh (PMOD_Thermal32 operates at 32FPS).
|
||||
|
||||
## 4. Notes
|
||||
1. **Sensor Wiring**: The MLX90640 (core component of PMOD_Thermal32) has a fixed I2C address of 0x33; ensure correct wiring and no address conflicts;
|
||||
2. **Camera Reset**: If the camera malfunctions in fusion mode, the program automatically attempts to reset the camera. A brief interruption of the frame during reset is normal;
|
||||
3. **Resource Occupancy**: The program occupies hardware resources such as the display, I2C bus, and camera during operation. Do not manually occupy these resources before exiting the program to avoid conflicts;
|
||||
4. **Temperature Parameters**: The default temperature range adapted by the program can be adjusted via code (currently set to dynamically adapt to temperature extremes, or fixed ranges such as 5.0℃~60.0℃ can be manually configured);
|
||||
5. **Color Mapping**: Supports switching between different color mapping schemes (cmap) to adjust the color display effect of the thermal imaging frame as needed;
|
||||
6. **Frame Scaling**: The original thermal imaging data is 32×24 pixels; the program uses scaling algorithms (BICUBIC/BILINEAR) to adapt to the display resolution, ensuring clear frame presentation;
|
||||
7. **Extended Development**: The program reserves temperature data interfaces (e.g., `matrix()` to retrieve temperature matrix, `max_temp_point()` to retrieve coordinates and values of the maximum temperature), which can be used to extend functions such as temperature alarm and data storage.
|
||||
|
||||
## 5. Further Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_thermal_camera)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -1,8 +1,46 @@
|
||||
# ToF camera
|
||||
## 1. 简介
|
||||
本应用基于MaixCam系列硬件平台开发,集成TOF100深度传感器与摄像头模块,实现了深度数据采集、视觉图像融合、数据可视化展示等功能。应用可实时采集TOF100的深度矩阵数据,并支持将深度数据与摄像头图像进行融合处理后,在显示屏上直观展示,适用于近距离(4cm-75cm)深度感知与视觉融合的场景验证和功能演示。
|
||||
|
||||
## 2. 主要功能
|
||||
1. **深度数据采集**:通过TOF100传感器采集25×25/50×50/100×100分辨率的深度矩阵数据,支持4cm-75cm的有效探测范围。
|
||||
2. **视觉融合处理**:可将摄像头采集的图像与TOF深度数据进行融合,生成带深度信息的可视化图像。
|
||||
3. **多分辨率适配**:支持切换不同的深度数据分辨率(25×25/50×50/100×100),并自动适配显示效果。
|
||||
4. **实时可视化展示**:将深度数据/融合图像缩放适配显示屏分辨率后实时显示,支持十字准星标注深度极值点(最小值、最大值、中心点)。
|
||||
5. **触控交互**:通过触摸屏实现基础的交互控制,如设备未检测到时的退出操作。
|
||||
|
||||
## Supported List
|
||||
## 3. 使用说明
|
||||
### 3.1 硬件准备
|
||||
1. 确认硬件平台为MaixCAM/MaixCAM2(不同平台SPI端口自动适配);
|
||||
2. 正确连接TOF100传感器至对应SPI接口(MaixCAM为SPI4,MaixCAM2为SPI2);
|
||||
3. 连接摄像头模块(默认适配50×50分辨率,支持分辨率动态调整);
|
||||
4. 连接显示屏与触摸屏,确保硬件驱动正常。
|
||||
|
||||
[Consult purchase address](https://wiki.sipeed.com/en/store.html)
|
||||
### 3.2 启动应用
|
||||
1. 将编译后的应用程序部署至Maix硬件平台;
|
||||
2. 执行应用程序,无需额外命令行参数,程序自动初始化硬件并启动;
|
||||
3. 启动后程序会自动检测TOF100传感器,若未检测到则显示屏显示“Devices Not Found!”提示,触摸屏幕即可退出。
|
||||
|
||||
* PMOD_TOF100
|
||||
### 3.3 运行操作
|
||||
1. **默认模式**:启动后自动进入深度数据显示模式,实时展示TOF100采集的深度数据可视化图像;
|
||||
2. **融合模式切换**:开启融合模式后,程序自动采集摄像头图像并与深度数据融合展示;
|
||||
3. **分辨率切换**:程序支持动态切换深度数据分辨率(25×25/50×50/100×100),切换后自动重新初始化深度映射表并适配显示;
|
||||
4. **退出应用**:可通过系统信号(如Ctrl+C)或触摸屏操作(设备未检测时)退出应用。
|
||||
|
||||
### 3.4 异常处理
|
||||
1. 若硬件初始化失败(显示屏/摄像头/触摸屏/TOF100),程序会输出错误日志并退出;
|
||||
2. 运行过程中若深度矩阵数据为空,程序会跳过当前帧并继续运行,不中断整体流程;
|
||||
3. 摄像头分辨率调整时,程序会自动重置摄像头并重新初始化,期间短暂跳过部分帧数据。
|
||||
|
||||
## 4. 注意事项
|
||||
1. **硬件兼容性**:不同Maix平台(MaixCAM/MaixCAM2)的SPI端口不同,程序已自动适配,无需手动修改,但需确保硬件接线对应;
|
||||
2. **探测范围**:TOF100的有效探测范围为4cm-75cm,超出该范围的数据可能无效,程序已做阈值过滤;
|
||||
3. **分辨率限制**:视觉融合模式仅支持50×50分辨率的深度数据,切换其他分辨率会自动切回50×50;
|
||||
4. **资源释放**:程序退出时会自动释放显示屏、摄像头、TOF100等硬件资源,避免强制断电导致资源泄漏;
|
||||
5. **性能提示**:运行过程中若出现帧率过低,可降低深度数据分辨率或关闭视觉融合模式。
|
||||
6. **数据可视化逻辑**:深度数据通过颜色映射表(cmap)转换为RGB图像,不同颜色对应不同深度值,融合模式下叠加摄像头图像的亮度信息;
|
||||
7. **显示适配**:程序会根据显示屏的宽高比自动调整图像显示位置,确保画面居中展示;
|
||||
8. **调试预留**:程序中保留了部分调试代码(如帧率打印、坐标打印、测试图像绘制等),可通过编译宏开启,便于功能调试和定制开发;
|
||||
9. **扩展能力**:可通过修改深度阈值(OPNS_MIN_DIS_MM/OPNS_MAX_DIS_MM)、融合权重等参数,适配不同的应用场景需求。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_tof_camera)
|
||||
46
projects/app_tof_camera/README_EN.md
Normal file
46
projects/app_tof_camera/README_EN.md
Normal file
@@ -0,0 +1,46 @@
|
||||
## 1. Introduction
|
||||
This application is developed based on the MaixCam series hardware platform. It integrates the TOF100 depth sensor with a camera module to achieve functions such as depth data acquisition, visual image fusion, and data visualization. The application can collect depth matrix data from the TOF100 in real-time and supports fusing this depth data with camera images for intuitive display on a screen. It is suitable for scenario verification and functional demonstration of short-range (4cm-75cm) depth perception and visual fusion.
|
||||
|
||||
## 2. Main Features
|
||||
1. **Depth Data Acquisition**: Collects depth matrix data at resolutions of 25×25, 50×50, or 100×100 via the TOF100 sensor, supporting an effective detection range of 4cm to 75cm.
|
||||
2. **Visual Fusion Processing**: Fuses images captured by the camera with TOF depth data to generate visual images containing depth information.
|
||||
3. **Multi-Resolution Adaptation**: Supports switching between different depth data resolutions (25×25/50×50/100×100) and automatically adapts the display output.
|
||||
4. **Real-Time Visualization**: Scales depth data or fused images to fit the display resolution for real-time viewing. Supports crosshair annotations for depth extrema (minimum, maximum, and center points).
|
||||
5. **Touch Interaction**: Enables basic interaction via the touchscreen, such as exiting the application if the device is not detected.
|
||||
|
||||
## 3. User Guide
|
||||
### 3.1 Hardware Preparation
|
||||
1. Confirm the hardware platform is MaixCAM or MaixCAM2 (SPI ports are automatically adapted for different platforms).
|
||||
2. Connect the TOF100 sensor to the corresponding SPI interface (SPI4 for MaixCAM, SPI2 for MaixCAM2).
|
||||
3. Connect the camera module (defaults to 50×50 resolution, supports dynamic adjustment).
|
||||
4. Connect the display and touchscreen, ensuring hardware drivers are functioning correctly.
|
||||
|
||||
### 3.2 Application Startup
|
||||
1. Deploy the compiled application to the Maix hardware platform.
|
||||
2. Execute the application; no additional command-line parameters are required. The program will automatically initialize the hardware and start.
|
||||
3. Upon startup, the program automatically detects the TOF100 sensor. If not detected, the screen displays a "Devices Not Found!" message, and you can exit by touching the screen.
|
||||
|
||||
### 3.3 Operation
|
||||
1. **Default Mode**: Automatically enters depth data display mode upon startup, showing a real-time visualization of depth data collected by the TOF100.
|
||||
2. **Fusion Mode Switch**: When fusion mode is enabled, the program automatically captures camera images and displays them fused with depth data.
|
||||
3. **Resolution Switch**: The program supports dynamic switching of depth data resolution (25×25/50×50/100×100). After switching, it automatically re-initializes the depth mapping table and adapts the display.
|
||||
4. **Exit Application**: The application can be exited via a system signal (e.g., Ctrl+C) or touchscreen operation (when the device is not detected).
|
||||
|
||||
### 3.4 Exception Handling
|
||||
1. If hardware initialization fails (display/camera/touchscreen/TOF100), the program outputs an error log and exits.
|
||||
2. If depth matrix data is empty during operation, the program skips the current frame and continues running without interrupting the overall process.
|
||||
3. When adjusting the camera resolution, the program automatically resets and re-initializes the camera, skipping some frames briefly during this period.
|
||||
|
||||
## 4. Notes
|
||||
1. **Hardware Compatibility**: SPI ports differ between Maix platforms (MaixCAM/MaixCAM2). The program automatically adapts, requiring no manual modification, but ensure hardware wiring corresponds correctly.
|
||||
2. **Detection Range**: The effective detection range of the TOF100 is 4cm-75cm. Data outside this range may be invalid, and the program applies threshold filtering.
|
||||
3. **Resolution Limitation**: Visual fusion mode only supports depth data at 50×50 resolution; switching to other resolutions will automatically revert to 50×50.
|
||||
4. **Resource Release**: The program automatically releases hardware resources (display, camera, TOF100) upon exit to prevent resource leaks caused by forced power-off.
|
||||
5. **Performance Tips**: If the frame rate is too low during operation, reduce the depth data resolution or disable visual fusion mode.
|
||||
6. **Data Visualization Logic**: Depth data is converted to an RGB image using a Color Map (cmap), where different colors correspond to different depth values. In fusion mode, brightness information from the camera image is overlaid.
|
||||
7. **Display Adaptation**: The program automatically adjusts the image position based on the display aspect ratio to ensure the image is centered.
|
||||
8. **Debugging Reserves**: The program retains some debugging code (e.g., frame rate printing, coordinate printing, test image drawing), which can be enabled via compilation macros to facilitate functional debugging and customized development.
|
||||
9. **Expandability**: Parameters such as depth thresholds (OPNS_MIN_DIS_MM/OPNS_MAX_DIS_MM) and fusion weights can be modified to adapt to different application scenarios.
|
||||
|
||||
## 5. More Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_tof_camera)
|
||||
@@ -10,4 +10,5 @@ files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
41
projects/app_uvc_camera/README.md
Normal file
41
projects/app_uvc_camera/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
## 1. 简介
|
||||
本工具是基于MaixCam系列硬件开发的摄像头UVC推流应用,能够将设备摄像头采集的视频画面以MJPG格式通过UVC(USB视频类)协议对外输出,支持本地显示屏状态展示与触控屏快捷退出操作,适用于需要将MaixCam设备作为USB摄像头使用的场景。
|
||||
|
||||
## 2. 主要功能
|
||||
- 摄像头采集:自动初始化1280×720分辨率、RGB888格式的摄像头画面,帧率最高60fps;
|
||||
- UVC推流:满足条件时自动启动UVC服务,将摄像头画面封装为MJPG格式对外推送,支持第三方工具(如Guvcview)接收;
|
||||
- 本地显示:在设备显示屏上展示UVC服务状态、启用提示或错误信息;
|
||||
- 快捷退出:通过触控屏左上角区域的点击操作,可快速退出程序;
|
||||
- 日志输出:实时输出帧率、数据量、各环节耗时等运行日志,便于调试和状态监控。
|
||||
|
||||
## 3. 使用说明
|
||||
### 3.1 前置准备
|
||||
1. 确保Maix设备已安装对应固件,且摄像头模块正常连接并驱动;
|
||||
2. 确认在「应用设置/USB设置/UVC」中开启UVC功能。
|
||||
|
||||
### 3.2 运行程序
|
||||
1. 启动程序,程序会自动完成以下操作:
|
||||
- 加载并显示初始图片;
|
||||
- 初始化摄像头并尝试启动UVC服务;
|
||||
- 在显示屏上显示UVC启动成功/未启用的提示信息。
|
||||
|
||||
### 3.3 接收UVC视频流
|
||||
1. 若UVC启动成功,将Maix设备通过USB连接至电脑;
|
||||
2. 在电脑端打开支持MJPG格式的视频采集工具(如Guvcview);
|
||||
3. 在工具中选择对应的USB摄像头设备,并切换至MJPG视频通道,即可看到Maix设备摄像头采集的画面(画面中会显示帧尺寸、帧计数等信息)。
|
||||
|
||||
### 3.4 退出程序
|
||||
- 触摸设备显示屏左上角(40+60像素宽度、40像素高度范围内),程序会自动停止UVC服务并退出;
|
||||
|
||||
## 4. 注意事项
|
||||
1. 兼容性:Ubuntu系统下的Cheese工具与本程序的UVC推流不兼容,推荐使用Guvcview工具接收视频流;
|
||||
2. 文件依赖:必须确「应用设置/USB设置/UVC」中开启UVC功能,否则UVC服务无法启动,程序会提示需先启用UVC功能;
|
||||
3. 帧率与性能:程序默认配置摄像头60fps采集,若设备性能不足,可修改代码中摄像头初始化的帧率参数(60)降低负载。
|
||||
|
||||
1. 日志信息:程序运行过程中会输出帧计数、单帧耗时、帧率、数据字节数等日志,可通过终端查看,用于排查帧率过低、推流卡顿等问题;
|
||||
2. 画面自定义:可修改代码中 `draw_string` 相关代码,自定义显示屏或推流画面中显示的文字内容、颜色、大小;
|
||||
3. 分辨率调整:若需要调整推流分辨率,可修改代码中摄像头初始化的宽高参数(1280, 720),但需确保摄像头支持对应分辨率;
|
||||
4. 调试模式:代码中保留了帧数据保存为jpg文件的注释代码(`#if 0` 块),取消注释后,程序会将每帧MJPG数据保存至 `/root/res/` 目录,便于调试视频流数据问题(需确保该目录存在)。
|
||||
|
||||
## 5. 更多介绍
|
||||
[源码](https://github.com/sipeed/MaixCDK/tree/main/projects/app_uvc_camera)
|
||||
41
projects/app_uvc_camera/README_EN.md
Normal file
41
projects/app_uvc_camera/README_EN.md
Normal file
@@ -0,0 +1,41 @@
|
||||
## 1. Introduction
|
||||
This tool is a camera UVC streaming application developed based on MaixCam series hardware. It can output video frames captured by the device's camera in MJPG format via the UVC (USB Video Class) protocol, supports local display screen status display and touchscreen quick exit operation, and is suitable for scenarios where the MaixCam device needs to be used as a USB camera.
|
||||
|
||||
## 2. Main Features
|
||||
- Camera Capture: Automatically initializes camera frames with 1280×720 resolution and RGB888 format, with a maximum frame rate of 60fps;
|
||||
- UVC Streaming: Automatically starts the UVC service when conditions are met, encapsulates camera frames into MJPG format for external streaming, and supports reception by third-party tools (e.g., Guvcview);
|
||||
- Local Display: Displays UVC service status, enable prompts or error messages on the device's display screen;
|
||||
- Quick Exit: The program can be quickly exited by clicking the upper left area of the touchscreen;
|
||||
- Log Output: Real-time outputs running logs such as frame count, single-frame time consumption, frame rate, and data volume for easy debugging and status monitoring.
|
||||
|
||||
## 3. Usage Instructions
|
||||
### 3.1 Preparations
|
||||
1. Ensure the Maix device has the corresponding firmware installed, and the camera module is properly connected and driven;
|
||||
2. Confirm that the UVC function is enabled in [App Settings/USB Settings/UVC].
|
||||
|
||||
### 3.2 Running the Program
|
||||
1. Launch the program, which will automatically complete the following operations:
|
||||
- Load and display the initial image;
|
||||
- Initialize the camera and attempt to start the UVC service;
|
||||
- Display UVC startup success/unenabled prompt information on the display screen.
|
||||
|
||||
### 3.3 Receiving UVC Video Stream
|
||||
1. If UVC starts successfully, connect the Maix device to the computer via USB;
|
||||
2. Open a video capture tool that supports MJPG format on the computer (e.g., Guvcview);
|
||||
3. Select the corresponding USB camera device in the tool and switch to the MJPG video channel to view the camera frames captured by the Maix device (frame size, frame count, etc., will be displayed on the screen).
|
||||
|
||||
### 3.4 Exiting the Program
|
||||
- Touch the upper left corner of the device's display screen (within the range of 40+60 pixels in width and 40 pixels in height), and the program will automatically stop the UVC service and exit;
|
||||
|
||||
## 4. Notes
|
||||
1. Compatibility: The Cheese tool on the Ubuntu system is incompatible with the UVC streaming of this program; it is recommended to use the Guvcview tool to receive the video stream;
|
||||
2. Function Dependency: The UVC function must be enabled in [App Settings/USB Settings/UVC], otherwise the UVC service cannot be started, and the program will prompt to enable the UVC function first;
|
||||
3. Frame Rate and Performance: The program is configured to capture camera frames at 60fps by default. If the device performance is insufficient, you can modify the frame rate parameter (60) in the camera initialization code to reduce the load.
|
||||
|
||||
1. Log Information: During program operation, logs such as frame count, single-frame time consumption, frame rate, and data bytes will be output, which can be viewed through the terminal to troubleshoot issues such as low frame rate and streaming stuttering;
|
||||
2. Screen Customization: You can modify the `draw_string` related code in the program to customize the content, color, and size of the text displayed on the display screen or streaming frame;
|
||||
3. Resolution Adjustment: If you need to adjust the streaming resolution, you can modify the width and height parameters (1280, 720) in the camera initialization code, but ensure that the camera supports the corresponding resolution;
|
||||
4. Debug Mode: The code retains commented code (`#if 0` block) for saving frame data as JPG files. After uncommenting, the program will save each frame of MJPG data to the `/root/res/` directory, which is convenient for debugging video stream data issues (ensure the directory exists).
|
||||
|
||||
## 5. More Information
|
||||
[Source Code](https://github.com/sipeed/MaixCDK/tree/main/projects/app_uvc_camera)
|
||||
@@ -9,4 +9,6 @@ desc[zh]: UVC照相机应用,在你的电脑上显示画面
|
||||
files:
|
||||
app.yaml: app.yaml
|
||||
assets: assets
|
||||
README.md: README.md
|
||||
README_EN.md: README_EN.md
|
||||
|
||||
|
||||
@@ -98,4 +98,3 @@ for dir in */; do
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
356
projects/build_and_pack.sh
Executable file
356
projects/build_and_pack.sh
Executable file
@@ -0,0 +1,356 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 自动编译 maixcam 和 maixcam2 平台并打包
|
||||
# 使用方法:
|
||||
# 批量编译(默认): ./build_and_pack.sh [projects目录路径] [--platform maixcam|maixcam2|both]
|
||||
# 单项目编译: ./build_and_pack.sh --single [项目路径] [--platform maixcam|maixcam2|both]
|
||||
|
||||
set -e # 遇到错误立即退出
|
||||
|
||||
# 默认平台
|
||||
PLATFORM="both"
|
||||
|
||||
# 排除项目名单(留空则编译所有项目)
|
||||
# 示例: EXCLUDE_PROJECTS=("project1" "project2" "project3")
|
||||
EXCLUDE_PROJECTS=()
|
||||
|
||||
# 颜色定义
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 打印带颜色的信息
|
||||
info() {
|
||||
echo -e "${GREEN}[INFO]${NC} $1"
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo -e "${YELLOW}[WARN]${NC} $1"
|
||||
}
|
||||
|
||||
error() {
|
||||
echo -e "${RED}[ERROR]${NC} $1"
|
||||
}
|
||||
|
||||
title() {
|
||||
echo -e "${BLUE}[====]${NC} $1"
|
||||
}
|
||||
|
||||
# 查找 release 目录
|
||||
find_release_dir() {
|
||||
local dist_dir=$1
|
||||
local release_dir=$(find "$dist_dir" -maxdepth 1 -type d -name "*_release" | head -n 1)
|
||||
if [ -n "$release_dir" ]; then
|
||||
echo "$release_dir"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# 从 release 目录名提取二进制文件名
|
||||
get_binary_name() {
|
||||
local release_dir=$1
|
||||
local dir_name=$(basename "$release_dir")
|
||||
echo "${dir_name%_release}"
|
||||
}
|
||||
|
||||
# 编译并复制
|
||||
build_platform() {
|
||||
local project_path=$1
|
||||
local platform=$2
|
||||
local is_first=$3
|
||||
local output_dir=$4
|
||||
local dist_dir="$project_path/dist"
|
||||
|
||||
info "开始编译平台: $platform"
|
||||
|
||||
cd "$project_path"
|
||||
|
||||
# 使用 echo 自动选择平台进行编译
|
||||
if [ "$platform" == "maixcam" ]; then
|
||||
echo "2" | maixcdk build
|
||||
elif [ "$platform" == "maixcam2" ]; then
|
||||
echo "3" | maixcdk build
|
||||
else
|
||||
error "未知平台: $platform"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# 自动查找 release 目录
|
||||
local release_dir=$(find_release_dir "$dist_dir")
|
||||
|
||||
if [ -z "$release_dir" ] || [ ! -d "$release_dir" ]; then
|
||||
error "编译失败,未找到 *_release 目录"
|
||||
ls -la "$dist_dir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local binary_name=$(get_binary_name "$release_dir")
|
||||
|
||||
info "找到 release 目录: $release_dir"
|
||||
|
||||
# 只复制二进制文件和 dl_lib 到平台目录
|
||||
mkdir -p "$output_dir/$platform"
|
||||
cp "$release_dir/$binary_name" "$output_dir/$platform/"
|
||||
if [ -d "$release_dir/dl_lib" ]; then
|
||||
cp -r "$release_dir/dl_lib" "$output_dir/$platform/"
|
||||
fi
|
||||
|
||||
# 第一次编译时复制共享文件到根目录
|
||||
if [ "$is_first" == "true" ]; then
|
||||
info "复制共享文件..."
|
||||
[ -d "$release_dir/assets" ] && cp -r "$release_dir/assets" "$output_dir/"
|
||||
[ -f "$release_dir/app.yaml" ] && cp "$release_dir/app.yaml" "$output_dir/"
|
||||
[ -f "$release_dir/README.md" ] && cp "$release_dir/README.md" "$output_dir/"
|
||||
[ -f "$release_dir/README_EN.md" ] && cp "$release_dir/README_EN.md" "$output_dir/"
|
||||
echo "$binary_name" > "$output_dir/.binary_name"
|
||||
fi
|
||||
|
||||
info "清理编译缓存..."
|
||||
maixcdk distclean
|
||||
|
||||
info "平台 $platform 编译完成"
|
||||
}
|
||||
|
||||
# 创建 main.py
|
||||
create_main_py() {
|
||||
local output_dir=$1
|
||||
local binary_name=$2
|
||||
local platform=$3
|
||||
|
||||
if [ "$platform" == "both" ]; then
|
||||
cat > "$output_dir/main.py" << 'EOF'
|
||||
from maix import sys
|
||||
import subprocess
|
||||
|
||||
device_name = sys.device_name().lower()
|
||||
|
||||
if device_name == 'maixcam2':
|
||||
subprocess.run(['chmod', '+x', 'maixcam2/BINARY_NAME'])
|
||||
ret = subprocess.run(['maixcam2/BINARY_NAME'])
|
||||
if ret.returncode != 0:
|
||||
raise RuntimeError(f'Run BINARY_NAME failed! ret:{ret.returncode}')
|
||||
else:
|
||||
subprocess.run(['chmod', '+x', 'maixcam/BINARY_NAME'])
|
||||
ret = subprocess.run(['maixcam/BINARY_NAME'])
|
||||
if ret.returncode != 0:
|
||||
raise RuntimeError(f'Run BINARY_NAME failed! ret:{ret.returncode}')
|
||||
EOF
|
||||
elif [ "$platform" == "maixcam" ]; then
|
||||
cat > "$output_dir/main.py" << 'EOF'
|
||||
import subprocess
|
||||
|
||||
subprocess.run(['chmod', '+x', 'maixcam/BINARY_NAME'])
|
||||
ret = subprocess.run(['maixcam/BINARY_NAME'])
|
||||
if ret.returncode != 0:
|
||||
raise RuntimeError(f'Run BINARY_NAME failed! ret:{ret.returncode}')
|
||||
EOF
|
||||
else
|
||||
cat > "$output_dir/main.py" << 'EOF'
|
||||
import subprocess
|
||||
|
||||
subprocess.run(['chmod', '+x', 'maixcam2/BINARY_NAME'])
|
||||
ret = subprocess.run(['maixcam2/BINARY_NAME'])
|
||||
if ret.returncode != 0:
|
||||
raise RuntimeError(f'Run BINARY_NAME failed! ret:{ret.returncode}')
|
||||
EOF
|
||||
fi
|
||||
sed -i "s/BINARY_NAME/$binary_name/g" "$output_dir/main.py"
|
||||
}
|
||||
|
||||
# 编译单个项目
|
||||
build_single_project() {
|
||||
local project_path=$1
|
||||
local output_zip_dir=$2 # 可选,指定zip输出目录
|
||||
|
||||
local project_name=$(basename "$project_path")
|
||||
local output_dir="$project_path/release_all"
|
||||
local timestamp=$(date +%Y%m%d_%H%M%S)
|
||||
local zip_name="${project_name}_release_${timestamp}.zip"
|
||||
|
||||
title "编译项目: $project_name"
|
||||
info "项目路径: $project_path"
|
||||
info "编译平台: $PLATFORM"
|
||||
|
||||
# 清理之前的输出
|
||||
[ -d "$output_dir" ] && rm -rf "$output_dir"
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
# 根据平台选择编译
|
||||
if [ "$PLATFORM" == "both" ]; then
|
||||
build_platform "$project_path" "maixcam" "true" "$output_dir"
|
||||
build_platform "$project_path" "maixcam2" "false" "$output_dir"
|
||||
elif [ "$PLATFORM" == "maixcam" ]; then
|
||||
build_platform "$project_path" "maixcam" "true" "$output_dir"
|
||||
else
|
||||
build_platform "$project_path" "maixcam2" "true" "$output_dir"
|
||||
fi
|
||||
|
||||
# 获取二进制文件名并创建 main.py
|
||||
local binary_name=$(cat "$output_dir/.binary_name")
|
||||
rm -f "$output_dir/.binary_name"
|
||||
create_main_py "$output_dir" "$binary_name" "$PLATFORM"
|
||||
|
||||
# 重命名为 app 名称
|
||||
local app_dir="$project_path/$binary_name"
|
||||
mv "$output_dir" "$app_dir"
|
||||
|
||||
# 打包
|
||||
info "打包中..."
|
||||
cd "$project_path"
|
||||
zip -rq "$zip_name" "$binary_name"
|
||||
|
||||
# 清理临时目录
|
||||
rm -rf "$app_dir"
|
||||
|
||||
# 如果指定了输出目录,移动zip
|
||||
if [ -n "$output_zip_dir" ]; then
|
||||
mv "$zip_name" "$output_zip_dir/"
|
||||
info "输出文件: $output_zip_dir/$zip_name"
|
||||
else
|
||||
info "输出文件: $project_path/$zip_name"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
# 批量编译所有项目
|
||||
build_all_projects() {
|
||||
local projects_dir=$1
|
||||
local build_dir="$projects_dir/build"
|
||||
local timestamp=$(date +%Y%m%d_%H%M%S)
|
||||
|
||||
title "========================================="
|
||||
title "批量编译模式"
|
||||
title "Projects 目录: $projects_dir"
|
||||
title "========================================="
|
||||
echo ""
|
||||
|
||||
# 创建 build 目录
|
||||
mkdir -p "$build_dir"
|
||||
info "输出目录: $build_dir"
|
||||
echo ""
|
||||
|
||||
# 统计
|
||||
local total=0
|
||||
local success=0
|
||||
local failed=0
|
||||
local failed_list=""
|
||||
|
||||
# 遍历所有子目录
|
||||
for project in "$projects_dir"/*/; do
|
||||
project_name="$(basename "$project")"
|
||||
|
||||
# 跳过 build 目录
|
||||
if [ "$project_name" == "build" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查是否在排除名单中
|
||||
if [[ " ${EXCLUDE_PROJECTS[@]} " =~ " ${project_name} " ]]; then
|
||||
warn "跳过排除项目: $project_name"
|
||||
continue
|
||||
fi
|
||||
|
||||
# 检查是否是有效项目(包含 app.yaml 或 CMakeLists.txt)
|
||||
if [ ! -f "$project/app.yaml" ] && [ ! -f "$project/CMakeLists.txt" ]; then
|
||||
warn "跳过非项目目录: $project"
|
||||
continue
|
||||
fi
|
||||
|
||||
total=$((total + 1))
|
||||
project_path="${project%/}" # 去掉末尾斜杠
|
||||
|
||||
# 编译项目(捕获错误继续)
|
||||
if build_single_project "$project_path" "$build_dir"; then
|
||||
success=$((success + 1))
|
||||
else
|
||||
failed=$((failed + 1))
|
||||
failed_list="$failed_list\n - $(basename "$project_path")"
|
||||
error "项目 $(basename "$project_path") 编译失败,继续下一个..."
|
||||
fi
|
||||
done
|
||||
|
||||
# 输出统计
|
||||
echo ""
|
||||
title "========================================="
|
||||
title "批量编译完成!"
|
||||
title "========================================="
|
||||
info "总计: $total 个项目"
|
||||
info "成功: $success 个"
|
||||
if [ $failed -gt 0 ]; then
|
||||
error "失败: $failed 个"
|
||||
echo -e "失败项目:$failed_list"
|
||||
fi
|
||||
info "输出目录: $build_dir"
|
||||
echo ""
|
||||
ls -la "$build_dir"
|
||||
}
|
||||
|
||||
# 解析参数
|
||||
parse_args() {
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--platform|-p)
|
||||
PLATFORM="$2"
|
||||
if [ "$PLATFORM" != "maixcam" ] && [ "$PLATFORM" != "maixcam2" ] && [ "$PLATFORM" != "both" ]; then
|
||||
error "无效的平台: $PLATFORM (支持: maixcam, maixcam2, both)"
|
||||
exit 1
|
||||
fi
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "$1"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# 主入口
|
||||
main() {
|
||||
local first_arg=$(parse_args "$@")
|
||||
|
||||
if [ "$first_arg" == "--single" ] || [ "$first_arg" == "-s" ]; then
|
||||
# 单项目编译模式
|
||||
shift
|
||||
local remaining=$(parse_args "$@")
|
||||
local project_path="${remaining:-$(pwd)}"
|
||||
if [ ! -d "$project_path" ]; then
|
||||
error "目录不存在: $project_path"
|
||||
exit 1
|
||||
fi
|
||||
build_single_project "$project_path"
|
||||
else
|
||||
# 默认:批量编译模式
|
||||
local remaining=$(parse_args "$@")
|
||||
local projects_dir="${remaining:-$(pwd)}"
|
||||
if [ ! -d "$projects_dir" ]; then
|
||||
error "目录不存在: $projects_dir"
|
||||
exit 1
|
||||
fi
|
||||
build_all_projects "$projects_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
# 显示帮助
|
||||
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
|
||||
echo "使用方法:"
|
||||
echo " 批量编译(默认): $0 [projects目录路径] [--platform maixcam|maixcam2|both]"
|
||||
echo " 单项目编译: $0 --single [项目路径] [--platform maixcam|maixcam2|both]"
|
||||
echo ""
|
||||
echo "参数:"
|
||||
echo " --platform, -p 指定编译平台 (maixcam, maixcam2, both), 默认: both"
|
||||
echo ""
|
||||
echo "示例:"
|
||||
echo " $0 # 批量编译当前目录下所有项目(两个平台)"
|
||||
echo " $0 --platform maixcam # 批量编译当前目录(仅maixcam)"
|
||||
echo " $0 /root/MaixCDK/projects --platform maixcam2 # 批量编译指定目录(仅maixcam2)"
|
||||
echo " $0 --single --platform maixcam # 编译当前目录项目(仅maixcam)"
|
||||
echo " $0 --single /root/MaixCDK/projects/app_camera # 编译指定项目(两个平台)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user