libavdevice/v4l2.c File Reference

#include "config.h"
#include "libavformat/avformat.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <asm/types.h>
#include <linux/videodev2.h>
#include <time.h>
#include <strings.h>

Go to the source code of this file.

Data Structures

struct  video_data
struct  buff_data
struct  fmt_map

Enumerations

enum  io_method { io_read, io_mmap, io_userptr }

Functions

static int device_open (AVFormatContext *ctx, uint32_t *capabilities)
static int device_init (AVFormatContext *ctx, int *width, int *height, int pix_fmt)
static int first_field (int fd)
static uint32_t fmt_ff2v4l (enum PixelFormat pix_fmt)
static enum PixelFormat fmt_v4l2ff (uint32_t pix_fmt)
static int mmap_init (AVFormatContext *ctx)
static int read_init (AVFormatContext *ctx)
static void mmap_release_buffer (AVPacket *pkt)
static int mmap_read_frame (AVFormatContext *ctx, AVPacket *pkt)
static int read_frame (AVFormatContext *ctx, AVPacket *pkt)
static int mmap_start (AVFormatContext *ctx)
static void mmap_close (struct video_data *s)
static int v4l2_set_parameters (AVFormatContext *s1, AVFormatParameters *ap)
static int v4l2_read_header (AVFormatContext *s1, AVFormatParameters *ap)
static int v4l2_read_packet (AVFormatContext *s1, AVPacket *pkt)
static int v4l2_read_close (AVFormatContext *s1)

Variables

static const int desired_video_buffers = 256
static struct fmt_map fmt_conversion_table []
AVInputFormat v4l2_demuxer


Enumeration Type Documentation

enum io_method

Enumerator:
io_read 
io_mmap 
io_userptr 

Definition at line 49 of file v4l2.c.


Function Documentation

static int device_init ( AVFormatContext ctx,
int *  width,
int *  height,
int  pix_fmt 
) [static]

Definition at line 174 of file v4l2.c.

Referenced by v4l2_read_header().

static int device_open ( AVFormatContext ctx,
uint32_t *  capabilities 
) [static]

Definition at line 129 of file v4l2.c.

Referenced by v4l2_read_header().

static int first_field ( int  fd  )  [static]

Definition at line 202 of file v4l2.c.

Referenced by dnxhd_decode_frame(), dnxhd_encode_picture(), and v4l2_read_header().

static uint32_t fmt_ff2v4l ( enum PixelFormat  pix_fmt  )  [static]

Definition at line 218 of file v4l2.c.

Referenced by v4l2_read_header().

static enum PixelFormat fmt_v4l2ff ( uint32_t  pix_fmt  )  [static]

Definition at line 231 of file v4l2.c.

Referenced by v4l2_read_header().

static void mmap_close ( struct video_data s  )  [static]

Definition at line 437 of file v4l2.c.

Referenced by v4l2_read_close().

static int mmap_init ( AVFormatContext ctx  )  [static]

Definition at line 244 of file v4l2.c.

Referenced by v4l2_read_header().

static int mmap_read_frame ( AVFormatContext ctx,
AVPacket pkt 
) [static]

Definition at line 347 of file v4l2.c.

Referenced by v4l2_read_packet().

static void mmap_release_buffer ( AVPacket pkt  )  [static]

Definition at line 322 of file v4l2.c.

Referenced by mmap_read_frame().

static int mmap_start ( AVFormatContext ctx  )  [static]

Definition at line 404 of file v4l2.c.

Referenced by v4l2_read_header().

static int read_frame ( AVFormatContext ctx,
AVPacket pkt 
) [static]

Definition at line 399 of file v4l2.c.

Referenced by v4l2_read_packet(), and vid_read_packet().

static int read_init ( AVFormatContext ctx  )  [static]

Definition at line 317 of file v4l2.c.

Referenced by v4l2_read_header().

static int v4l2_read_close ( AVFormatContext s1  )  [static]

Definition at line 631 of file v4l2.c.

static int v4l2_read_header ( AVFormatContext s1,
AVFormatParameters ap 
) [static]

Definition at line 509 of file v4l2.c.

static int v4l2_read_packet ( AVFormatContext s1,
AVPacket pkt 
) [static]

Definition at line 603 of file v4l2.c.

static int v4l2_set_parameters ( AVFormatContext s1,
AVFormatParameters ap 
) [static]

Definition at line 454 of file v4l2.c.

Referenced by v4l2_read_header().


Variable Documentation

const int desired_video_buffers = 256 [static]

Definition at line 47 of file v4l2.c.

Referenced by mmap_init().

struct fmt_map fmt_conversion_table[] [static]

Definition at line 78 of file v4l2.c.

Initial value:

 {
    "video4linux2",
    NULL_IF_CONFIG_SMALL("Video4Linux2 device grab"),
    sizeof(struct video_data),
    NULL,
    v4l2_read_header,
    v4l2_read_packet,
    v4l2_read_close,
    .flags = AVFMT_NOFILE,
}

Definition at line 643 of file v4l2.c.


Generated on Fri Oct 26 02:35:45 2012 for FFmpeg by  doxygen 1.5.8