CjRaspiVideoCapture
cj_raspi_video_capture.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Seajei, LLC. All Rights Reserved.
3  */
4 
11 #ifndef _CJ_RASPI_VID_H_
12 #define _CJ_RASPI_VID_H_
13 
14 //#ifdef __cplusplus
15 //extern "C" {
16 //#endif
17 
18 /* Library Header files */
19 #include <stdint.h>
20 #include <stddef.h>
21 
25 typedef enum {
26  RASPI_VIDEO_RESOLUTION_240P,
27  RASPI_VIDEO_RESOLUTION_360P,
28  RASPI_VIDEO_RESOLUTION_480P,
29  RASPI_VIDEO_RESOLUTION_720P,
30  RASPI_VIDEO_RESOLUTION_1080P
32 
36 typedef struct {
38  int bitrate;
39  int framerate;
41  int brightness;
42  int contrast;
43  int saturation;
44  int hflip;
45  int vflip;
47 
53 typedef void (*nalu_encoded_handler)(uint8_t *buf, size_t bufLen);
54 
58 void cj_rvc_init(nalu_encoded_handler naluEncodedHandler);
59 
64 void cj_rvc_start(RaspiVideoParams *params);
65 
69 void cj_rvc_stop(void);
70 
75 void cj_rvc_process_main_loop(void);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* _CJ_RASPI_VID_H_ */
int framerate
Framerate of video in frames/second. 30 is a typical number.
Definition: cj_raspi_video_capture.h:39
void cj_rvc_process_main_loop(void)
This function needs to be called regularly for the library to function.
void cj_rvc_init(nalu_encoded_handler naluEncodedHandler)
Initializes library.
void(* nalu_encoded_handler)(uint8_t *buf, size_t bufLen)
This callback gets called any time a new NALU (I-frame, P-frame, SPS, PPS, other) has been received f...
Definition: cj_raspi_video_capture.h:53
int saturation
Sets the saturation. Default is 0. Range is -100 to 100.
Definition: cj_raspi_video_capture.h:43
Enables video settings to be specified.
Definition: cj_raspi_video_capture.h:36
int contrast
Sets the contrast. Default is 0. Range is -100 to 100.
Definition: cj_raspi_video_capture.h:42
int bitrate
Bitrate of video in bits/second. A good range for a 720p video with 30 fps is 800,...
Definition: cj_raspi_video_capture.h:38
int intraperiod
Defines how often keyframes (I-frames) are inserted versus P-frames. Set it to 15 if for example you ...
Definition: cj_raspi_video_capture.h:40
RaspiVideoResolution
Available video resolutions.
Definition: cj_raspi_video_capture.h:25
void cj_rvc_stop(void)
Stop capturing frames.
int hflip
Flip horizontally. Default is 0. Set it to 1 to flip.
Definition: cj_raspi_video_capture.h:44
RaspiVideoResolution resolution
Video resolution.
Definition: cj_raspi_video_capture.h:37
int vflip
Flip vertically. Default is 0. Set it to 1 to flip.
Definition: cj_raspi_video_capture.h:45
void cj_rvc_start(RaspiVideoParams *params)
Set various parameters for video and start capturing frames.
int brightness
Sets the brightness. Default is 50. Range is 0 to 100.
Definition: cj_raspi_video_capture.h:41