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
bebop_front_camera.c File Reference
#include "modules/computer_vision/bebop_front_camera.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <math.h>
#include "lib/v4l/v4l2.h"
#include "lib/vision/image.h"
#include "lib/vision/bayer.h"
#include "lib/encoding/jpeg.h"
#include "lib/encoding/rtp.h"
#include "udp_socket.h"
#include <pthread.h>
+ Include dependency graph for bebop_front_camera.c:

Go to the source code of this file.

Macros

#define MT9F002_WIDTH   1408
 
#define MT9F002_HEIGHT   2112
 
#define BEBOP_FRONT_CAMERA_WIDTH   272
 
#define BEBOP_FRONT_CAMERA_HEIGHT   272
 
#define BEBOP_FRONT_CAMERA_SHOT_PATH   /data/ftp/internal_000/images
 

Functions

static void * bebop_front_camera_thread (void *data)
 Handles all the video streaming and saving of the image shots This is a sepereate thread, so it needs to be thread safe! More...
 
static void bebop_front_camera_save_shot (struct image_t *img_color, struct image_t *img_jpeg, struct image_t *raw_img)
 
void bebop_front_camera_periodic (void)
 A dummy for now. More...
 
void bebop_front_camera_take_shot (bool_t take)
 
void bebop_front_camera_init (void)
 Initialize the view video. More...
 
void bebop_front_camera_start (void)
 Start with streaming. More...
 
void bebop_front_camera_stop (void)
 Stops the streaming This could take some time, because the thread is stopped asynchronous. More...
 

Variables

struct bebopfrontcamera_t bebop_front_camera
 

Macro Definition Documentation

#define BEBOP_FRONT_CAMERA_HEIGHT   272

Definition at line 51 of file bebop_front_camera.c.

Referenced by bebop_front_camera_thread().

#define BEBOP_FRONT_CAMERA_SHOT_PATH   /data/ftp/internal_000/images

Definition at line 55 of file bebop_front_camera.c.

Referenced by bebop_front_camera_init(), and bebop_front_camera_save_shot().

#define BEBOP_FRONT_CAMERA_WIDTH   272

Definition at line 50 of file bebop_front_camera.c.

Referenced by bebop_front_camera_thread().

#define MT9F002_HEIGHT   2112

Definition at line 49 of file bebop_front_camera.c.

Referenced by bebop_front_camera_init().

#define MT9F002_WIDTH   1408

Definition at line 48 of file bebop_front_camera.c.

Referenced by bebop_front_camera_init().

Function Documentation

void bebop_front_camera_init ( void  )

Initialize the view video.

Definition at line 139 of file bebop_front_camera.c.

References BEBOP_FRONT_CAMERA_SHOT_PATH, bebopfrontcamera_t::dev, MT9F002_HEIGHT, MT9F002_WIDTH, v4l2_init(), and v4l2_init_subdev().

+ Here is the call graph for this function:

void bebop_front_camera_periodic ( void  )

A dummy for now.

Definition at line 62 of file bebop_front_camera.c.

static void bebop_front_camera_save_shot ( struct image_t img_color,
struct image_t img_jpeg,
struct image_t raw_img 
)
static

Definition at line 204 of file bebop_front_camera.c.

References BEBOP_FRONT_CAMERA_SHOT_PATH, image_t::buf, image_t::buf_size, jpeg_encode_image(), and bebopfrontcamera_t::shot_number.

Referenced by bebop_front_camera_thread().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void bebop_front_camera_start ( void  )

Start with streaming.

Definition at line 166 of file bebop_front_camera.c.

References bebop_front_camera_thread(), and bebopfrontcamera_t::is_streaming.

+ Here is the call graph for this function:

void bebop_front_camera_stop ( void  )

Stops the streaming This could take some time, because the thread is stopped asynchronous.

Definition at line 185 of file bebop_front_camera.c.

References bebopfrontcamera_t::dev, FALSE, bebopfrontcamera_t::is_streaming, v4l2_device::name, and v4l2_stop_capture().

+ Here is the call graph for this function:

void bebop_front_camera_take_shot ( bool_t  take)

Definition at line 73 of file bebop_front_camera.c.

References bebopfrontcamera_t::take_shot, and TRUE.

static void * bebop_front_camera_thread ( void *  data)
static

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 81 of file bebop_front_camera.c.

References BayerToYUV(), BEBOP_FRONT_CAMERA_HEIGHT, bebop_front_camera_save_shot(), BEBOP_FRONT_CAMERA_WIDTH, bebopfrontcamera_t::dev, FALSE, image_create(), IMAGE_JPEG, IMAGE_YUV422, bebopfrontcamera_t::is_streaming, jpeg_encode_image(), v4l2_device::name, rtp_frame_send(), bebopfrontcamera_t::take_shot, TRUE, udp_socket_create(), v4l2_image_free(), v4l2_image_get(), and v4l2_start_capture().

Referenced by bebop_front_camera_start().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

struct bebopfrontcamera_t bebop_front_camera
Initial value:
= {
.is_streaming = FALSE,
.take_shot = FALSE,
.shot_number = 0,
.take_shot = FALSE,
.shot_number = 0
}
#define FALSE
Definition: std.h:5

Definition at line 65 of file bebop_front_camera.c.