Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
video_capture.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include "modules/computer_vision/video_capture.h"
#include "modules/computer_vision/cv.h"
#include "lib/encoding/jpeg.h"
+ Include dependency graph for video_capture.c:

Go to the source code of this file.

Macros

#define VIDEO_CAPTURE_PATH   /data/video/images
 
#define VIDEO_CAPTURE_JPEG_QUALITY   99
 
#define VIDEO_CAPTURE_FPS   0
 Default FPS (zero means run at camera fps) More...
 

Functions

struct image_tvideo_capture_func (struct image_t *img, uint8_t camera_id)
 
void video_capture_save (struct image_t *img)
 
void video_capture_init (void)
 
void video_capture_shoot (void)
 
void video_capture_start_capture (void)
 
void video_capture_stop_capture (void)
 

Variables

bool video_capture_take_shot = false
 
bool video_capture_record_video = false
 
int video_capture_index = 0
 
static char save_dir [256]
 

Macro Definition Documentation

◆ VIDEO_CAPTURE_FPS

#define VIDEO_CAPTURE_FPS   0

Default FPS (zero means run at camera fps)

Definition at line 51 of file video_capture.c.

◆ VIDEO_CAPTURE_JPEG_QUALITY

#define VIDEO_CAPTURE_JPEG_QUALITY   99

Definition at line 47 of file video_capture.c.

◆ VIDEO_CAPTURE_PATH

#define VIDEO_CAPTURE_PATH   /data/video/images

Definition at line 43 of file video_capture.c.

Function Documentation

◆ video_capture_func()

struct image_t * video_capture_func ( struct image_t img,
uint8_t  camera_id 
)

Definition at line 87 of file video_capture.c.

References video_capture_record_video, video_capture_save(), and video_capture_take_shot.

Referenced by video_capture_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ video_capture_init()

void video_capture_init ( void  )

Definition at line 68 of file video_capture.c.

References cv_add_to_device(), save_dir, VIDEO_CAPTURE_FPS, video_capture_func(), and VIDEO_CAPTURE_PATH.

+ Here is the call graph for this function:

◆ video_capture_save()

void video_capture_save ( struct image_t img)

Definition at line 114 of file video_capture.c.

References image_t::buf, image_t::buf_size, image_t::h, image_create(), image_free(), IMAGE_JPEG, jpeg_encode_image(), image_t::pprz_ts, save_dir, VIDEO_CAPTURE_JPEG_QUALITY, image_t::w, and write_exif_jpeg().

Referenced by video_capture_func().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ video_capture_shoot()

void video_capture_shoot ( void  )

Definition at line 100 of file video_capture.c.

References video_capture_take_shot.

Referenced by dc_send_command().

+ Here is the caller graph for this function:

◆ video_capture_start_capture()

void video_capture_start_capture ( void  )

Definition at line 106 of file video_capture.c.

References video_capture_record_video.

◆ video_capture_stop_capture()

void video_capture_stop_capture ( void  )

Definition at line 110 of file video_capture.c.

References video_capture_record_video.

Variable Documentation

◆ save_dir

char save_dir[256]
static

Definition at line 61 of file video_capture.c.

Referenced by video_capture_init(), and video_capture_save().

◆ video_capture_index

int video_capture_index = 0

Definition at line 58 of file video_capture.c.

◆ video_capture_record_video

bool video_capture_record_video = false

◆ video_capture_take_shot

bool video_capture_take_shot = false

Definition at line 56 of file video_capture.c.

Referenced by video_capture_func(), and video_capture_shoot().