|
esp32cam
OV2640 camera on ESP32-CAM
|
Control MJPEG stream timing. More...
#include <mjpeg.hpp>
Public Types | |
| enum | Action { CAPTURE = -1 , RETURN = -2 , SEND = -3 , STOP = -4 } |
Public Member Functions | |
| MjpegController (MjpegConfig cfg) | |
| int | countSentFrames () const |
| Retrieve number of sent frames. | |
| int | decideAction () |
| Decide what to do now. | |
| void | notifyCapture () |
| Notify that frame capture has started. | |
| void | notifyReturn (std::unique_ptr< Frame > frame) |
| Notify that frame capture has completed. | |
| Frame * | getFrame () const |
| Retrieve current frame. | |
| void | notifySent (bool ok) |
| Notify that a frame is sent to the client. | |
| void | notifyFail () |
| Notify that an error has occurred. | |
Public Attributes | |
| const MjpegConfig | cfg |
Control MJPEG stream timing.
|
explicit |
|
inline |
Retrieve number of sent frames.
| int esp32cam::detail::MjpegController::decideAction | ( | ) |
Decide what to do now.
| CAPTURE | capture a frame. |
| RETURN | return a captured frame. |
| SEND | send current frame to the client. |
| STOP | disconnect the client. |
|
inline |
Retrieve current frame.
| void esp32cam::detail::MjpegController::notifyCapture | ( | ) |
Notify that frame capture has started.
| void esp32cam::detail::MjpegController::notifyFail | ( | ) |
Notify that an error has occurred.
| void esp32cam::detail::MjpegController::notifyReturn | ( | std::unique_ptr< Frame > | frame | ) |
Notify that frame capture has completed.
| frame | captured frame, possibly nullptr. |
| void esp32cam::detail::MjpegController::notifySent | ( | bool | ok | ) |
Notify that a frame is sent to the client.
| ok | whether sent successfully. |
The caller is expected to enforce MjpegConfig::frameTimeout and call `notifySent(false)` in case of send timeout.
| const MjpegConfig esp32cam::detail::MjpegController::cfg |