52#ifndef VIEWVIDEO_DOWNSIZE_FACTOR
53#define VIEWVIDEO_DOWNSIZE_FACTOR 4
58#ifndef VIEWVIDEO_QUALITY_FACTOR
59#define VIEWVIDEO_QUALITY_FACTOR 50
65#define VIEWVIDEO_FPS 5
70#ifndef VIEWVIDEO_NICE_LEVEL
71#define VIEWVIDEO_NICE_LEVEL 5
76#ifndef VIEWVIDEO_USE_NETCAT
77#define VIEWVIDEO_USE_NETCAT FALSE
80#if !VIEWVIDEO_USE_NETCAT && !(defined VIEWVIDEO_USE_RTP)
81#define VIEWVIDEO_USE_RTP TRUE
84#if VIEWVIDEO_USE_NETCAT
104#if !VIEWVIDEO_USE_NETCAT
136#if VIEWVIDEO_USE_NETCAT
150#if VIEWVIDEO_USE_NETCAT
155 printf(
"[viewvideo] Could not create netcat fork.\n");
156 }
else if (pid == 0) {
163 printf(
"[viewvideo] Failed to open netcat process.\n");
193#ifdef VIEWVIDEO_CAMERA
204#ifdef VIEWVIDEO_CAMERA2
231#if VIEWVIDEO_USE_NETCAT
239 fprintf(
fp,
"\tn=$(printf \"%%04d\" $i)\n");
245 printf(
"[viewvideo] Failed to create netcat receiver file.\n");
249#ifdef VIEWVIDEO_CAMERA
256#ifdef VIEWVIDEO_CAMERA2
264#ifdef VIEWVIDEO_CAMERA
270#ifdef VIEWVIDEO_CAMERA2
struct video_listener * cv_add_to_device_async(struct video_config_t *device, cv_function func, int nice_level, uint16_t fps, uint8_t id)
Computer vision framework for onboard processing.
void image_yuv422_downsample(struct image_t *input, struct image_t *output, uint8_t downsample)
Simplified high-speed low CPU downsample function without averaging downsample factor must be 1,...
void image_free(struct image_t *img)
Free the image.
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
Image helper functions like resizing, color filter, converters...
void * buf
Image buffer (depending on the image_type)
@ IMAGE_YUV422
UYVY format (uint16 per pixel)
@ IMAGE_JPEG
An JPEG encoded image (not per pixel encoded)
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
void jpeg_encode_image(struct image_t *in, struct image_t *out, uint32_t quality_factor, bool add_dri_header)
Encode an YUV422 image.
Encode images with the use of the JPEG encoding.
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
void rtp_frame_send(struct UdpSocket *udp, struct image_t *img, uint8_t format_code, uint8_t quality_code, uint8_t has_dri_header, float average_frame_rate, uint16_t *packet_number, uint32_t *rtp_time_counter)
Send an RTP frame.
Encodes a video stream with RTP Format 26 (Motion JPEG)
int udp_socket_create(struct UdpSocket *sock, char *host, int port_out, int port_in, bool broadcast)
Create UDP socket and bind it.
Easily create and use UDP sockets.
static struct image_t * viewvideo_function(struct UdpSocket *viewvideo_socket, struct image_t *img, uint16_t *rtp_packet_nr, uint32_t *rtp_frame_time, struct image_t *img_small, struct image_t *img_jpeg)
Handles all the video streaming and saving of the image shots This is a separate thread,...
struct UdpSocket video_sock1
#define VIEWVIDEO_USE_NETCAT
struct viewvideo_t viewvideo
#define VIEWVIDEO_NICE_LEVEL
#define VIEWVIDEO_USE_RTP
#define VIEWVIDEO_DOWNSIZE_FACTOR
void viewvideo_init(void)
Initialize the view video.
#define VIEWVIDEO_QUALITY_FACTOR
struct UdpSocket video_sock2
Get live images from a RTP/UDP stream and save pictures on internal memory.
uint8_t downsize_factor
Downsize factor during the stream.
volatile bool is_streaming
When the device is streaming.
bool use_rtp
Stream over RTP.
uint8_t quality_factor
Quality factor during the stream.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.