esp32-mjpeg-multiclient-esp.../PlatformIO/esp32-cam-rtos-pio/include/streaming.h

44 lines
1.1 KiB
C
Raw Normal View History

#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
uint32_t fnm; // frame number
uint32_t siz; // frame size
2024-09-30 21:47:59 +02:00
uint8_t* dat; // frame pointer
} frameChunck_t;
void camCB(void* pvParameters);
void handleJPGSstream(void);
2024-10-01 14:03:25 +02:00
void handleNotFound(void);
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);
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;