refactor: move static function on top of files
This commit is contained in:
+18
-18
@@ -270,6 +270,24 @@ static void close_stream(const VideoCapture *video_capture) {
|
||||
ioctl(video_capture->fd, VIDIOC_STREAMOFF, &buf_type);
|
||||
}
|
||||
|
||||
static bool read_video(VideoCapture *video_capture) {
|
||||
if (ioctl(video_capture->fd, VIDIOC_DQBUF, &video_capture->buf) == -1) {
|
||||
ioctl_error(video_capture, "VIDIOC_DQBUF",
|
||||
"buffer type not supported or no buffer allocated or the index "
|
||||
"is out of bounds");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ioctl(video_capture->fd, VIDIOC_QBUF, &video_capture->buf) == -1) {
|
||||
ioctl_error(video_capture, "VIDIOC_QBUF",
|
||||
"buffer type not supported or no buffer allocated or the index "
|
||||
"is out of bounds");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void video_init(VideoCapture *video_capture, const char *name,
|
||||
unsigned int preferred_height) {
|
||||
open_device(video_capture, name);
|
||||
@@ -305,24 +323,6 @@ void video_init(VideoCapture *video_capture, const char *name,
|
||||
create_image_buffer(video_capture);
|
||||
}
|
||||
|
||||
static bool read_video(VideoCapture *video_capture) {
|
||||
if (ioctl(video_capture->fd, VIDIOC_DQBUF, &video_capture->buf) == -1) {
|
||||
ioctl_error(video_capture, "VIDIOC_DQBUF",
|
||||
"buffer type not supported or no buffer allocated or the index "
|
||||
"is out of bounds");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ioctl(video_capture->fd, VIDIOC_QBUF, &video_capture->buf) == -1) {
|
||||
ioctl_error(video_capture, "VIDIOC_QBUF",
|
||||
"buffer type not supported or no buffer allocated or the index "
|
||||
"is out of bounds");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool video_background_read(VideoCapture *video_capture, SharedContext *context,
|
||||
int input_index, bool trace_fps) {
|
||||
pid_t pid;
|
||||
|
||||
Reference in New Issue
Block a user