-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
117 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef ASYNC_JPEG_STREAM_RESPONSE_H | ||
#define ASYNC_JPEG_STREAM_RESPONSE_H | ||
|
||
#include "Arduino.h" | ||
#include "ESPAsyncWebServer.h" | ||
#include "camera_pins.h" | ||
#include "esp_camera.h" | ||
|
||
typedef struct { | ||
camera_fb_t * fb; | ||
size_t index; | ||
} camera_frame_t; | ||
|
||
class AsyncJpegStreamResponse : public AsyncAbstractResponse { | ||
private: | ||
camera_frame_t _frame; | ||
size_t _index; | ||
size_t _jpg_buf_len; | ||
uint8_t *_jpg_buf; | ||
|
||
public: | ||
AsyncJpegStreamResponse(); | ||
~AsyncJpegStreamResponse(); | ||
|
||
bool _sourceValid() const; | ||
|
||
virtual size_t _fillBuffer(uint8_t *buf, size_t maxLen) override; | ||
|
||
size_t _content(uint8_t *buffer, size_t maxLen, size_t index); | ||
}; | ||
|
||
#endif // ASYNC_JPEG_STREAM_RESPONSE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters