forked from xiaozhi/xiaozhi-esp32
Co-authored-by: Рябчиков Денис <DRyabchikov_od@inno.tech>
This commit is contained in:
@@ -410,7 +410,7 @@ bool Esp32Camera::Capture() {
|
|||||||
frame_.len = buf.bytesused;
|
frame_.len = buf.bytesused;
|
||||||
frame_.data = (uint8_t*)heap_caps_malloc(frame_.len, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
frame_.data = (uint8_t*)heap_caps_malloc(frame_.len, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||||
if (!frame_.data) {
|
if (!frame_.data) {
|
||||||
ESP_LOGE(TAG, "alloc frame copy failed: need allocate %d bytes", buf.bytesused);
|
ESP_LOGE(TAG, "alloc frame copy failed: need allocate %lu bytes", buf.bytesused);
|
||||||
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
||||||
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
||||||
}
|
}
|
||||||
@@ -482,7 +482,7 @@ bool Esp32Camera::Capture() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "unsupported sensor format: 0x%08x", sensor_format_);
|
ESP_LOGE(TAG, "unsupported sensor format: 0x%08lx", sensor_format_);
|
||||||
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
||||||
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
||||||
}
|
}
|
||||||
@@ -524,7 +524,7 @@ bool Esp32Camera::Capture() {
|
|||||||
rotate_cfg.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888;
|
rotate_cfg.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "unsupported sensor format: 0x%08x", sensor_format_);
|
ESP_LOGE(TAG, "unsupported sensor format: 0x%08lx", sensor_format_);
|
||||||
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
||||||
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
||||||
}
|
}
|
||||||
@@ -639,7 +639,7 @@ bool Esp32Camera::Capture() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ESP_LOGE(TAG, "unsupported sensor format for PPA rotation: 0x%08x", sensor_format_);
|
ESP_LOGE(TAG, "unsupported sensor format for PPA rotation: 0x%08lx", sensor_format_);
|
||||||
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
if (ioctl(video_fd_, VIDIOC_QBUF, &buf) != 0) {
|
||||||
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
ESP_LOGE(TAG, "Cleanup: VIDIOC_QBUF failed");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ static uint8_t* convert_input_to_encoder_buf(const uint8_t* src, uint16_t width,
|
|||||||
src_len = static_cast<uint32_t>(width * height * 2);
|
src_len = static_cast<uint32_t>(width * height * 2);
|
||||||
break;
|
break;
|
||||||
[[unlikely]] default:
|
[[unlikely]] default:
|
||||||
ESP_LOGE(TAG, "[Unreachable Case] unsupported format: 0x%08x", format);
|
ESP_LOGE(TAG, "[Unreachable Case] unsupported format: 0x%08lx", format);
|
||||||
std::unreachable();
|
std::unreachable();
|
||||||
}
|
}
|
||||||
int sz = (int)width * (int)height * 2;
|
int sz = (int)width * (int)height * 2;
|
||||||
@@ -186,7 +186,7 @@ static uint8_t* convert_input_to_encoder_buf(const uint8_t* src, uint16_t width,
|
|||||||
*out_size = sz;
|
*out_size = sz;
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
ESP_LOGE(TAG, "unsupported format: 0x%08x", format);
|
ESP_LOGE(TAG, "unsupported format: 0x%08lx", format);
|
||||||
if (out_size)
|
if (out_size)
|
||||||
*out_size = 0;
|
*out_size = 0;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user