Skip to content

Commit 39fb26c

Browse files
committed
camera: rename internal headers
1 parent 583c9d3 commit 39fb26c

File tree

12 files changed

+59
-49
lines changed

12 files changed

+59
-49
lines changed

src/esp32cam.h

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,10 @@
77
#ifndef ESP32CAM_H
88
#define ESP32CAM_H
99

10-
#include "internal/config.hpp"
11-
#include "internal/mjpeg.hpp"
10+
#include "esp32cam/camera.hpp"
1211

1312
namespace esp32cam {
1413

15-
class CameraClass {
16-
public:
17-
/**
18-
* @brief Enable camera.
19-
* @return whether success.
20-
*/
21-
bool begin(const Config& config);
22-
23-
/**
24-
* @brief Disable camera.
25-
* @return whether success.
26-
*/
27-
bool end();
28-
29-
/**
30-
* @brief Retrieve list of resolutions (likely) supported by hardware.
31-
* @pre Camera is enabled.
32-
*/
33-
ResolutionList listResolutions() const;
34-
35-
/**
36-
* @brief Change camera resolution.
37-
* @pre Camera is enabled.
38-
* @param resolution new resolution; must be no higher than initial resolution.
39-
* @param sleepFor how long to wait for stabilization (millis).
40-
*/
41-
bool changeResolution(const Resolution& resolution, int sleepFor = 500);
42-
43-
/**
44-
* @brief Capture a frame of picture.
45-
* @pre Camera is enabled.
46-
* @return the picture frame, or nullptr on error.
47-
*/
48-
std::unique_ptr<Frame> capture();
49-
50-
/**
51-
* @brief Stream Motion JPEG.
52-
* @pre The camera has been initialized to JPEG mode.
53-
* @return number of frames streamed.
54-
*/
55-
int streamMjpeg(Client& client, const MjpegConfig& cfg = MjpegConfig());
56-
};
57-
58-
/** @brief ESP32 camera API. */
59-
extern CameraClass Camera;
60-
6114
/** @brief Capture a frame with the camera. */
6215
inline std::unique_ptr<Frame>
6316
capture() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "esp32cam.h"
1+
#include "camera.hpp"
22

33
#include <Arduino.h>
44
#include <esp_camera.h>

src/esp32cam/camera.hpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#ifndef ESP32CAM_CAMERA_HPP
2+
#define ESP32CAM_CAMERA_HPP
3+
4+
#include "config.hpp"
5+
#include "mjpeg.hpp"
6+
7+
namespace esp32cam {
8+
9+
class CameraClass {
10+
public:
11+
/**
12+
* @brief Enable camera.
13+
* @return whether success.
14+
*/
15+
bool begin(const Config& config);
16+
17+
/**
18+
* @brief Disable camera.
19+
* @return whether success.
20+
*/
21+
bool end();
22+
23+
/**
24+
* @brief Retrieve list of resolutions (likely) supported by hardware.
25+
* @pre Camera is enabled.
26+
*/
27+
ResolutionList listResolutions() const;
28+
29+
/**
30+
* @brief Change camera resolution.
31+
* @pre Camera is enabled.
32+
* @param resolution new resolution; must be no higher than initial resolution.
33+
* @param sleepFor how long to wait for stabilization (millis).
34+
*/
35+
bool changeResolution(const Resolution& resolution, int sleepFor = 500);
36+
37+
/**
38+
* @brief Capture a frame of picture.
39+
* @pre Camera is enabled.
40+
* @return the picture frame, or nullptr on error.
41+
*/
42+
std::unique_ptr<Frame> capture();
43+
44+
/**
45+
* @brief Stream Motion JPEG.
46+
* @pre The camera has been initialized to JPEG mode.
47+
* @return number of frames streamed.
48+
*/
49+
int streamMjpeg(Client& client, const MjpegConfig& cfg = MjpegConfig());
50+
};
51+
52+
/** @brief ESP32 camera API. */
53+
extern CameraClass Camera;
54+
55+
} // namespace esp32cam
56+
57+
#endif // ESP32CAM_CAMERA_HPP

0 commit comments

Comments
 (0)