Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/computer_vision/video_thread.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "lib/v4l/v4l2.h"
#include "lib/vision/image.h"
#include "lib/vision/bayer.h"
#include "mcu_periph/sys_time.h"
#include <BOARD_CONFIG>
#include <pthread.h>
#include "rt_priority.h"
Go to the source code of this file.
Macros | |
#define | VIDEO_THREAD_NICE_LEVEL 5 |
#define | VIDEO_THREAD_MAX_CAMERAS 4 |
#define | VIDEO_THREAD_VERBOSE 0 |
#define | printf_debug if(VIDEO_THREAD_VERBOSE > 0) printf |
#define | IMG_FLT_SIZE 272 |
Functions | |
static void * | video_thread_function (void *data) |
Handles all the video streaming and saving of the image shots This is a separate thread, so it needs to be thread safe! More... | |
static bool | initialize_camera (struct video_config_t *camera) |
static void | start_video_thread (struct video_config_t *camera) |
static void | stop_video_thread (struct video_config_t *device) |
void | video_thread_periodic (void) |
A dummy for now. More... | |
bool | add_video_device (struct video_config_t *device) |
void | video_thread_init (void) |
Initialize the view video. More... | |
void | video_thread_start () |
Starts the streaming of a all cameras. More... | |
void | video_thread_stop () |
Stops the streaming of all cameras This could take some time, because the thread is stopped asynchronous. More... | |
Variables | |
static struct video_config_t * | cameras [VIDEO_THREAD_MAX_CAMERAS] = {NULL} |
#define IMG_FLT_SIZE 272 |
#define printf_debug if(VIDEO_THREAD_VERBOSE > 0) printf |
Definition at line 71 of file video_thread.c.
#define VIDEO_THREAD_MAX_CAMERAS 4 |
Definition at line 63 of file video_thread.c.
#define VIDEO_THREAD_NICE_LEVEL 5 |
Definition at line 57 of file video_thread.c.
#define VIDEO_THREAD_VERBOSE 0 |
Definition at line 68 of file video_thread.c.
bool add_video_device | ( | struct video_config_t * | device | ) |
Definition at line 197 of file video_thread.c.
|
static |
Definition at line 172 of file video_thread.c.
References video_config_t::buf_cnt, video_config_t::crop, video_thread_t::dev, video_config_t::dev_name, video_config_t::format, video_config_t::output_size, video_config_t::sensor_size, video_config_t::subdev_format, video_config_t::subdev_name, video_config_t::thread, v4l2_init(), and v4l2_init_subdev().
Referenced by add_video_device().
|
static |
Definition at line 233 of file video_thread.c.
References video_config_t::dev_name, video_thread_t::is_running, video_config_t::thread, and video_thread_function().
Referenced by video_thread_start().
|
static |
Definition at line 251 of file video_thread.c.
References video_thread_t::dev, video_thread_t::is_running, v4l2_device::name, video_config_t::thread, and v4l2_stop_capture().
Referenced by video_thread_stop().
|
static |
Handles all the video streaming and saving of the image shots This is a separate thread, so it needs to be thread safe!
Definition at line 90 of file video_thread.c.
References BayerToYUV(), configure_isp(), cv_run_device(), video_thread_t::dev, video_config_t::dev_name, video_config_t::filters, video_config_t::fps, get_sys_time_usec(), image_create(), image_free(), IMAGE_YUV422, IMG_FLT_SIZE, video_thread_t::is_running, set_nice_level(), sys_time_usleep(), video_config_t::thread, v4l2_image_free(), v4l2_image_get(), v4l2_start_capture(), VIDEO_FILTER_DEBAYER, VIDEO_FILTER_ISP, and VIDEO_THREAD_NICE_LEVEL.
Referenced by start_video_thread().
void video_thread_init | ( | void | ) |
Initialize the view video.
Definition at line 269 of file video_thread.c.
References cameras, and VIDEO_THREAD_MAX_CAMERAS.
void video_thread_periodic | ( | void | ) |
A dummy for now.
Definition at line 81 of file video_thread.c.
void video_thread_start | ( | void | ) |
Starts the streaming of a all cameras.
Definition at line 280 of file video_thread.c.
References cameras, start_video_thread(), and VIDEO_THREAD_MAX_CAMERAS.
void video_thread_stop | ( | void | ) |
Stops the streaming of all cameras This could take some time, because the thread is stopped asynchronous.
Definition at line 294 of file video_thread.c.
References cameras, stop_video_thread(), and VIDEO_THREAD_MAX_CAMERAS.
|
static |
Definition at line 73 of file video_thread.c.
Referenced by add_video_device(), video_thread_init(), video_thread_start(), and video_thread_stop().