forked from xiaozhi/xiaozhi-esp32
fix: fixed the issue of slow startup for devices without cameras (#866)
This commit is contained in:
@@ -83,6 +83,16 @@ SscmaCamera::SscmaCamera(esp_io_expander_handle_t io_exp_handle) {
|
||||
|
||||
sscma_client_init(sscma_client_handle_);
|
||||
|
||||
ESP_LOGI(TAG, "SSCMA client initialized");
|
||||
// 设置分辨率
|
||||
// 3 = 640x480
|
||||
if (sscma_client_set_sensor(sscma_client_handle_, 1, 3, true)) {
|
||||
ESP_LOGE(TAG, "Failed to set sensor");
|
||||
sscma_client_del(sscma_client_handle_);
|
||||
sscma_client_handle_ = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取设备信息
|
||||
sscma_client_info_t *info;
|
||||
if (sscma_client_get_info(sscma_client_handle_, &info, true) == ESP_OK) {
|
||||
@@ -90,8 +100,6 @@ SscmaCamera::SscmaCamera(esp_io_expander_handle_t io_exp_handle) {
|
||||
info->id ? info->id : "NULL",
|
||||
info->name ? info->name : "NULL");
|
||||
}
|
||||
sscma_client_set_sensor(sscma_client_handle_, 1, 3, true); // 3 = 640x480
|
||||
|
||||
// 初始化JPEG数据的内存
|
||||
jpeg_data_.len = 0;
|
||||
jpeg_data_.buf = (uint8_t*)heap_caps_malloc(IMG_JPEG_BUF_SIZE, MALLOC_CAP_SPIRAM);;
|
||||
|
||||
Reference in New Issue
Block a user