2024-09-27 14:47:46 +02:00
|
|
|
#pragma once
|
|
|
|
#include "definitions.h"
|
|
|
|
#include "references.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t frame;
|
|
|
|
WiFiClient *client;
|
|
|
|
TaskHandle_t task;
|
|
|
|
char* buffer;
|
|
|
|
size_t len;
|
|
|
|
} streamInfo_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t cnt; // served to clients counter. when equal to number of active clients, could be deleted
|
2024-09-30 21:47:59 +02:00
|
|
|
void* nxt; // next chunck
|
2024-09-27 14:47:46 +02:00
|
|
|
uint32_t fnm; // frame number
|
|
|
|
uint32_t siz; // frame size
|
2024-09-30 21:47:59 +02:00
|
|
|
uint8_t* dat; // frame pointer
|
2024-09-27 14:47:46 +02:00
|
|
|
} frameChunck_t;
|
|
|
|
|
|
|
|
|
|
|
|
void camCB(void* pvParameters);
|
|
|
|
void handleJPGSstream(void);
|
2024-10-01 14:03:25 +02:00
|
|
|
void handleNotFound(void);
|
2024-09-27 14:47:46 +02:00
|
|
|
void streamCB(void * pvParameters);
|
|
|
|
void mjpegCB(void * pvParameters);
|
2024-09-30 21:47:59 +02:00
|
|
|
|
|
|
|
#define FAIL_IF_OOM true
|
|
|
|
#define OK_IF_OOM false
|
|
|
|
#define PSRAM_ONLY true
|
|
|
|
#define ANY_MEMORY false
|
|
|
|
char* allocateMemory(char* aPtr, size_t aSize, bool fail = FAIL_IF_OOM, bool psramOnly = ANY_MEMORY);
|
2024-09-27 14:47:46 +02:00
|
|
|
|
|
|
|
extern const char* HEADER;
|
|
|
|
extern const char* BOUNDARY;
|
|
|
|
extern const char* CTNTTYPE;
|
|
|
|
extern const int hdrLen;
|
|
|
|
extern const int bdrLen;
|
|
|
|
extern const int cntLen;
|
|
|
|
extern volatile uint32_t frameNumber;
|
|
|
|
|
|
|
|
extern frameChunck_t* fstFrame;
|
2024-09-30 21:47:59 +02:00
|
|
|
extern frameChunck_t* curFrame;
|