MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _read_frame

Method _read_frame

modules/camera/camera_feed_linux.cpp:196–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void CameraFeedLinux::_read_frame() {
197 struct v4l2_buffer buffer;
198 memset(&buffer, 0, sizeof(buffer));
199 buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
200 buffer.memory = V4L2_MEMORY_MMAP;
201
202 if (ioctl(file_descriptor, VIDIOC_DQBUF, &buffer) == -1) {
203 if (errno != EAGAIN) {
204 print_error(vformat("ioctl(VIDIOC_DQBUF) error: %d.", errno));
205 exit_flag.set();
206 }
207 return;
208 }
209
210 buffer_decoder->decode(buffers[buffer.index]);
211
212 if (ioctl(file_descriptor, VIDIOC_QBUF, &buffer) == -1) {
213 print_error(vformat("ioctl(VIDIOC_QBUF) error: %d.", errno));
214 }
215}
216
217void CameraFeedLinux::_stop_capturing() {
218 enum v4l2_buf_type type;

Callers

nothing calls this directly

Calls 4

vformatFunction · 0.85
print_errorFunction · 0.50
setMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected