Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
viewvideo.c File Reference

Get live images from a RTP/UDP stream and save pictures on internal memory. More...

#include "modules/computer_vision/viewvideo.h"
#include "modules/computer_vision/cv.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <math.h>
#include "lib/vision/image.h"
#include "lib/encoding/jpeg.h"
#include "lib/encoding/rtp.h"
#include "udp_socket.h"
+ Include dependency graph for viewvideo.c:

Go to the source code of this file.

Macros

#define VIEWVIDEO_DOWNSIZE_FACTOR   4
 
#define VIEWVIDEO_QUALITY_FACTOR   50
 
#define VIEWVIDEO_RTP_TIME_INC   0
 
#define VIEWVIDEO_SHOT_PATH   /data/video/images
 
#define VIEWVIDEO_USE_NETCAT   FALSE
 
#define VIEWVIDEO_USE_RTP   TRUE
 

Functions

bool_t viewvideo_function (struct image_t *img)
 Handles all the video streaming and saving of the image shots This is a sepereate thread, so it needs to be thread safe! More...
 
void viewvideo_init (void)
 Initialize the view video. More...
 

Variables

struct UdpSocket video_sock
 
struct viewvideo_t viewvideo
 

Detailed Description

Get live images from a RTP/UDP stream and save pictures on internal memory.

Works on Linux platforms

Definition in file viewvideo.c.

Macro Definition Documentation

#define VIEWVIDEO_DOWNSIZE_FACTOR   4

Definition at line 51 of file viewvideo.c.

#define VIEWVIDEO_QUALITY_FACTOR   50

Definition at line 57 of file viewvideo.c.

Referenced by viewvideo_function().

#define VIEWVIDEO_RTP_TIME_INC   0

Definition at line 63 of file viewvideo.c.

Referenced by viewvideo_function().

#define VIEWVIDEO_SHOT_PATH   /data/video/images

Definition at line 72 of file viewvideo.c.

Referenced by viewvideo_init().

#define VIEWVIDEO_USE_NETCAT   FALSE

Definition at line 79 of file viewvideo.c.

Referenced by viewvideo_function().

#define VIEWVIDEO_USE_RTP   TRUE

Definition at line 83 of file viewvideo.c.

Function Documentation

bool_t viewvideo_function ( struct image_t img)

Handles all the video streaming and saving of the image shots This is a sepereate thread, so it needs to be thread safe!

Definition at line 114 of file viewvideo.c.

References image_t::buf, image_t::buf_size, viewvideo_t::downsize_factor, image_t::h, image_create(), image_free(), IMAGE_JPEG, IMAGE_YUV422, image_yuv422_downsample(), viewvideo_t::is_streaming, jpeg_encode_image(), rtp_frame_send(), TRUE, viewvideo_t::use_rtp, video_sock, viewvideo, VIEWVIDEO_QUALITY_FACTOR, VIEWVIDEO_RTP_TIME_INC, VIEWVIDEO_USE_NETCAT, and image_t::w.

Referenced by viewvideo_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void viewvideo_init ( void  )

Initialize the view video.

Definition at line 198 of file viewvideo.c.

Variable Documentation

struct UdpSocket video_sock

Definition at line 90 of file viewvideo.c.

Referenced by viewvideo_function(), and viewvideo_init().

struct viewvideo_t viewvideo
Initial value:
= {
.is_streaming = FALSE,
.downsize_factor = VIEWVIDEO_DOWNSIZE_FACTOR,
.quality_factor = VIEWVIDEO_QUALITY_FACTOR,
.use_rtp = VIEWVIDEO_USE_RTP,
}
#define VIEWVIDEO_QUALITY_FACTOR
Definition: viewvideo.c:57
#define VIEWVIDEO_DOWNSIZE_FACTOR
Definition: viewvideo.c:51
#define FALSE
Definition: std.h:5
#define VIEWVIDEO_USE_RTP
Definition: viewvideo.c:83

Definition at line 100 of file viewvideo.c.

Referenced by video_usb_logger_periodic(), viewvideo_function(), and viewvideo_init().