This commit is contained in:
Rene Zeldenthuis
2024-04-01 19:58:44 +02:00
parent f59fb8bb9a
commit 5117f0d21a
9 changed files with 90 additions and 64 deletions

View File

@@ -10,16 +10,15 @@ public:
esp_err_t initialize(camera_config_t *camera_config);
esp_err_t deinitialize();
// sensor_t* esp_camera_sensor_get();
void update_frame();
uint8_t *data() const { return fb->buf; }
size_t width() const { return fb->width; }
size_t height() const { return fb->height; }
size_t size() const { return fb->len; }
uint8_t *data() const { return fb_->buf; }
size_t width() const { return fb_->width; }
size_t height() const { return fb_->height; }
size_t size() const { return fb_->len; }
private:
esp_err_t init_result;
camera_fb_t *fb;
esp_err_t init_result_;
camera_fb_t *fb_;
};

View File

@@ -18,7 +18,7 @@ private:
rtsp_command_teardown // TEARDOWN
};
const std::string available_stream_name_ = "mjpeg/1";
const char* available_stream_name_ = "mjpeg/1";
rtsp_command parse_command(const std::string &request);
bool parse_client_port(const std::string &request);

View File

@@ -8,19 +8,19 @@ constexpr uint8_t RTP_PAYLOAD_JPG = 26;
constexpr size_t jpeg_luminance_table_length = 64;
constexpr size_t jpeg_chrominance_table_length = 64;
// https://www.ietf.org/rfc/rfc2326#section-10.12
typedef struct __attribute__((packed))
{
char magic; // Magic encapsulation ASCII dollar sign (24 hexadecimal)
uint8_t channel; // Channel identifier
uint16_t length; // Network order
} rtp_over_tcp_hdr_t;
class micro_rtsp_streamer
{
public:
// https://www.ietf.org/rfc/rfc2326#section-10.12
typedef struct __attribute__((packed))
{
char magic; // Magic encapsulation ASCII dollar sign (24 hexadecimal)
uint8_t channel; // Channel identifier
uint16_t length; // Network order
} rtp_over_tcp_hdr_t;
micro_rtsp_streamer(const uint16_t width, const uint16_t height);
rtp_over_tcp_hdr_t *create_jpg_packet(const uint8_t *jpg_scan, const uint8_t *jpg_scan_end, uint8_t **jpg_offset, const uint32_t timestamp, const uint8_t* quantization_table_luminance, const uint8_t* quantization_table_chrominance);
rtp_over_tcp_hdr_t *create_jpg_packet(const uint8_t *jpg_scan, const uint8_t *jpg_scan_end, uint8_t **jpg_offset, const uint32_t timestamp, const uint8_t *quantization_table_luminance, const uint8_t *quantization_table_chrominance);
private:
uint16_t width_, height_;