-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMALCamera.h
41 lines (35 loc) · 1.32 KB
/
MMALCamera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "interface/mmal/mmal.h"
#include "interface/mmal/mmal_logging.h"
#include "interface/mmal/mmal_buffer.h"
#include "interface/mmal/util/mmal_util.h"
#include "interface/mmal/util/mmal_util_params.h"
#include "interface/mmal/util/mmal_default_components.h"
#include "interface/mmal/util/mmal_connection.h"
class MMALCamera
{
public:
MMALCamera();
bool startPreview();
bool endPreview();
~MMALCamera();
private:
// Globals private variables for starting and stopping camera preview
MMAL_COMPONENT_T *previewComponent;
MMAL_COMPONENT_T *cameraComponent;
MMAL_CONNECTION_T *previewConnection;
MMAL_PORT_T *previewPort;
MMAL_PORT_T *cameraPreviewPort;
MMAL_PORT_T *previewInputPort;
// State variables
bool previewState;
// Callback for MMAL
static void default_camera_control_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer);
// Create / destroy functions
MMAL_STATUS_T create_preview(void);
MMAL_STATUS_T create_camera(void);
void destroy_preview(void);
void destroy_camera(void);
// Port connection / disconnection
MMAL_STATUS_T connect_ports(MMAL_PORT_T *output_port, MMAL_PORT_T *input_port);
void disconnect_ports();
};