112 virtual bool init(
const std::shared_ptr<Config>& camera_config);
121 int xioctl(
int fd,
int request,
void* arg);
122 bool init_device(
void);
123 bool uninit_device(
void);
125 void set_device_config();
127 void set_auto_focus(
int value);
129 void set_v4l_parameter(
const std::string& param,
int value);
130 void set_v4l_parameter(
const std::string& param,
const std::string& value);
132 int init_mjpeg_decoder(
int image_width,
int image_height);
133 void mjpeg2rgb(
char* mjepg_buffer,
int len,
char* rgb_buffer,
int pixels);
135 int convert_yuv_to_rgb_pixel(
int y,
int u,
int v);
136 int convert_yuv_to_rgb_buffer(
unsigned char* yuv,
unsigned char* rgb,
137 unsigned int width,
unsigned int height);
140 bool init_read(
unsigned int buffer_size);
141 bool init_mmap(
void);
142 bool init_userp(
unsigned int buffer_size);
143 bool set_adv_trigger(
void);
144 bool close_device(
void);
145 bool open_device(
void);
148 bool start_capturing(
void);
149 bool stop_capturing(
void);
153 std::shared_ptr<Config> config_;
157 unsigned int n_buffers_;
161 AVFrame* avframe_camera_;
162 AVFrame* avframe_rgb_;
164 AVDictionary* avoptions_;
165 AVCodecContext* avcodec_context_;
166 int avframe_camera_size_;
167 int avframe_rgb_size_;
168 struct SwsContext* video_sws_;
170 float frame_warning_interval_ = 0.0;
171 float device_wait_sec_ = 0.0;
172 uint64_t last_nsec_ = 0;
173 float frame_drop_interval_ = 0.0;