fix order: add_mdns_main reply on camera init

idfv5.0
scgan 2023-03-02 19:35:31 +08:00
parent cef95e6926
commit 9f0c1a2c83
4 changed files with 5 additions and 4 deletions

View File

@ -180,6 +180,7 @@ void app_mdns_main()
} }
xSemaphoreGive(query_lock); xSemaphoreGive(query_lock);
// must be called after camera initialization
sensor_t * s = esp_camera_sensor_get(); sensor_t * s = esp_camera_sensor_get();
if(s == NULL){ if(s == NULL){
ESP_LOGE(TAG, "esp_camera_sensor_get() Failed"); ESP_LOGE(TAG, "esp_camera_sensor_get() Failed");

View File

@ -10,12 +10,12 @@ static QueueHandle_t xQueueHttpFrame = NULL;
extern "C" void app_main() extern "C" void app_main()
{ {
app_wifi_main(); app_wifi_main();
app_mdns_main();
xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *));
xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *));
register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame);
app_mdns_main();
register_cat_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_cat_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame);
register_httpd(xQueueHttpFrame, NULL, true); register_httpd(xQueueHttpFrame, NULL, true);
} }

View File

@ -10,12 +10,12 @@ static QueueHandle_t xQueueHttpFrame = NULL;
extern "C" void app_main() extern "C" void app_main()
{ {
app_wifi_main(); app_wifi_main();
app_mdns_main();
xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *));
xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *));
register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame);
app_mdns_main();
register_human_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_human_face_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame);
register_httpd(xQueueHttpFrame, NULL, true); register_httpd(xQueueHttpFrame, NULL, true);
} }

View File

@ -10,12 +10,12 @@ static QueueHandle_t xQueueHttpFrame = NULL;
extern "C" void app_main() extern "C" void app_main()
{ {
app_wifi_main(); app_wifi_main();
app_mdns_main();
xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueAIFrame = xQueueCreate(2, sizeof(camera_fb_t *));
xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *)); xQueueHttpFrame = xQueueCreate(2, sizeof(camera_fb_t *));
register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame); register_camera(PIXFORMAT_RGB565, FRAMESIZE_QVGA, 2, xQueueAIFrame);
app_mdns_main();
register_motion_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame); register_motion_detection(xQueueAIFrame, NULL, NULL, xQueueHttpFrame);
register_httpd(xQueueHttpFrame, NULL, true); register_httpd(xQueueHttpFrame, NULL, true);
} }