fix compile error

This commit is contained in:
Neucrack
2025-04-08 14:03:44 +08:00
parent 1e93623876
commit 1993e53a56
7 changed files with 65 additions and 15 deletions

View File

@@ -42,7 +42,7 @@ def add_file_downloads(confs : dict) -> list:
elif version == "6.1.1.1":
sha256sum = "a768eef0ab5841d63cb99dc4ee66b0b252b56ecce0bb8d344eb68bb8d6e49735"
else:
raise Exception(f"version {version} not support")
raise Exception(f"version {version} not support, please add support in component.py of FFmpeg")
sites = ["https://github.com/sipeed/MaixCDK/releases/tag/v0.0.0"]
filename = f"ffmpeg_maixcam2_libs_n{version}.tar.xz"
path = f"ffmpeg_srcs"

View File

@@ -47,7 +47,13 @@ namespace maix::peripheral::key
{
if(_default_key)
return;
_default_key = new Key(on_key, true, KEY_DEVICE0);
try
{
_default_key = new Key(on_key, true, KEY_DEVICE0);
} catch (const std::exception& e) {
log::warn("Initialize Key failed, no key driver, %s", e.what());
return;
}
_key_defult_listener = true;
}
@@ -353,7 +359,7 @@ namespace maix::peripheral::key
err::Err e = this->open();
if (e != err::ERR_NONE)
{
throw err::Exception(err::ERR_NOT_FOUND, std::string("Key device") + this->_device + " not found");
throw err::Exception(err::ERR_NOT_FOUND, std::string("Key device ") + this->_device + " not found");
}
}
}

View File

@@ -0,0 +1,44 @@
#include <bits/stdc++.h>
#include <functional>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "maix_uvc_stream.hpp"
extern "C" {
extern int uvc_main_exist;
extern int uvc_main(int argc, char *argv[]);
int uvc_video_fill_mjpg_buffer(void *buf, uint32_t *size) {
return -1;
}
}
namespace maix::uvc
{
int helper_fill_mjpg_image(void* buf, uint32_t* size, image::Image *img) {
return -1;
}
// 静态成员定义
UvcServer *UvcServer::_instance = nullptr;
void UvcServer::run() { }
void UvcServer::stop() { }
UvcStreamer::UvcStreamer(): _using_jpeg(0) { }
UvcStreamer::~UvcStreamer() { }
err::Err UvcStreamer::show(image::Image *img) {
return err::ERR_NOT_IMPL;
}
}

View File

@@ -386,6 +386,11 @@ namespace maix::image
if (!_actual_data)
throw err::Exception(err::ERR_NO_MEM, "malloc image data failed");
_data = (void *)(((uint64_t)_actual_data + 0x1000) & ~0xFFF);
#if PLATFORM_MAIXCAM
// memset(_data, 0, _data_size);
#else
memset(_data, 0, _data_size);
#endif
// log::debug("malloc image data\n");
_is_malloc = true;
}

View File

@@ -36,13 +36,7 @@ endif()
###### Add required/dependent components ######
if(PLATFORM_LINUX)
list(APPEND ADD_REQUIREMENTS nn)
elseif(PLATFORM_MAIXCAM)
list(APPEND ADD_REQUIREMENTS nn)
elseif(PLATFORM_MAIXCAM2)
list(APPEND ADD_REQUIREMENTS nn)
endif()
list(APPEND ADD_REQUIREMENTS nn)
###############################################
###### Add link search path for requirements/libs ######
@@ -63,8 +57,8 @@ endif()
###############################################
#### Add compile option for this component ####
#### Just for this component, won't affect other
#### modules, including component that depend
#### Just for this component, won't affect other
#### modules, including component that depend
#### on this component
# list(APPEND ADD_DEFINITIONS_PRIVATE -DAAAAA=1)

View File

@@ -8,13 +8,14 @@
#include "maix_image.hpp"
#include "maix_image_obj.hpp"
#include "maix_image_extra.hpp"
#include "maix_basic.hpp"
using namespace maix;
namespace maix::image
{
QRCodeDetector::QRCodeDetector() {
throw err::Exception(err::ERR_NOT_IMPL);
}
QRCodeDetector::~QRCodeDetector() {
@@ -28,4 +29,4 @@ namespace maix::image
(void)decoder_type;
return std::vector<image::QRCode>();
}
}
}

View File

@@ -72,4 +72,4 @@ namespace maix::image
return out;
}
}
}