xine-lib: xine-lib-1.2.12/src/input/input_v4l2.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Functions | Variables
input_v4l2.c File Reference
`#include <xine/input_plugin.h>`
`#include <xine/xine_plugin.h>`
`#include <xine/xine_internal.h>`
`#include <string.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <linux/videodev2.h>`
`#include <sys/mman.h>`
`#include <stdio.h>`
`#include <errno.h>`
`#include <unistd.h>`
`#include <sys/ioctl.h>`

## Data Structures
struct | buffer_data
struct | resolution_t
struct | v4l2_video_t
struct | v4l2_radio_t
struct | v4l2_input_plugin_t

## Macros
#define | LOG_MODULE "v4l2"
#define | v4l2_open(f, d) open(f,d)
#define | v4l2_ioctl(f, c, a) ioctl(f,c,a)
#define | v4l2_mmap(p, l, d, m, f, o) mmap(p,l,d,m,f,o)
#define | v4l2_munmap(s, l) munmap(s,l)
#define | v4l2_close(f) close(f)

## Functions
static int | v4l2_input_enqueue_video_buffer (v4l2_input_plugin_t *this, int idx)
static int | v4l2_input_dequeue_video_buffer (v4l2_input_plugin_t *this, buf_element_t *input)
static int | v4l2_input_setup_video_streaming (v4l2_input_plugin_t *this)
static int | v4l2_input_open (input_plugin_t *this_gen)
static buf_element_t * | v4l2_input_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t len)
static uint32_t | v4l2_input_blocksize (input_plugin_t *this_gen)
static void | v4l2_input_dispose (input_plugin_t *this_gen)
static off_t | v4l2_input_read (input_plugin_t *this_gen, void *buf, off_t nlen)
static uint32_t | v4l2_input_get_capabilities (input_plugin_t *this_gen)
static const char * | v4l2_input_get_mrl (input_plugin_t *this_gen)
static int | v4l2_input_get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
static off_t | v4l2_input_seek (input_plugin_t *this_gen, off_t offset, int origin)
static off_t | v4l2_input_pos (input_plugin_t *this_gen)
static off_t | v4l2_input_length (input_plugin_t *this_gen)
static input_plugin_t * | v4l2_class_get_instance (input_class_t *gen_cls, xine_stream_t *stream, const char *mrl)
static void * | v4l2_init_class (xine_t *xine, const void *data)

## Variables
const input_info_t | input_info_v4l2
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "v4l2"

## ◆ v4l2_close

#define v4l2_close | ( |  | f | ) | close(f)

## ◆ v4l2_ioctl

#define v4l2_ioctl | ( |  | f,
|  |  | c,
|  |  | a
| ) |  | ioctl(f,c,a)

## ◆ v4l2_mmap

#define v4l2_mmap | ( |  | p,
|  |  | l,
|  |  | d,
|  |  | m,
|  |  | f,
|  |  | o
| ) |  | mmap(p,l,d,m,f,o)

## ◆ v4l2_munmap

#define v4l2_munmap | ( |  | s,
|  |  | l
| ) |  | munmap(s,l)

## ◆ v4l2_open

#define v4l2_open | ( |  | f,
|  |  | d
| ) |  | open(f,d)

## Function Documentation

## ◆ v4l2_class_get_instance()

static input_plugin_t * v4l2_class_get_instance | ( | input_class_t * | gen_cls,
|  | xine_stream_t * | stream,
|  | const char * | mrl
| ) |  |
| static

References LOG_MODULE, lprintf, NULL, v4l2_input_blocksize(), v4l2_input_dispose(), v4l2_input_get_capabilities(), v4l2_input_get_mrl(), v4l2_input_get_optional_data(), v4l2_input_length(), v4l2_input_open(), v4l2_input_pos(), v4l2_input_read(), v4l2_input_read_block(), v4l2_input_seek(), xine_stream_s::xine, XINE_VERBOSITY_NONE, and xprintf.

Referenced by v4l2_init_class().

## ◆ v4l2_init_class()

static void * v4l2_init_class | ( | xine_t * | xine,
|  | const void * | data
| ) |  |
| static

References input_class_s::get_instance, N_, NULL, and v4l2_class_get_instance().

## ◆ v4l2_input_blocksize()

static uint32_t v4l2_input_blocksize | ( | input_plugin_t * | this_gen | ) |
| static

References lprintf.

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_dequeue_video_buffer()

static int v4l2_input_dequeue_video_buffer | ( | v4l2_input_plugin_t * | this,
|  | buf_element_t * | input
| ) |  |
| static

References BUF_FLAG_FRAME_END, BUF_FLAG_FRAME_START, BUF_VIDEO_YUY2, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::max_size, buf_element_s::mem, buf_element_s::size, buf_element_s::type, v4l2_input_enqueue_video_buffer(), v4l2_ioctl, and xine_fast_memcpy.

Referenced by v4l2_input_read_block().

## ◆ v4l2_input_dispose()

static void v4l2_input_dispose | ( | input_plugin_t * | this_gen | ) |
| static

References lprintf, NULL, type, v4l2_close, v4l2_ioctl, and v4l2_munmap.

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_enqueue_video_buffer()

static int v4l2_input_enqueue_video_buffer | ( | v4l2_input_plugin_t * | this,
|  | int | idx
| ) |  |
| static

References v4l2_ioctl.

Referenced by v4l2_input_dequeue_video_buffer(), and v4l2_input_setup_video_streaming().

## ◆ v4l2_input_get_capabilities()

static uint32_t v4l2_input_get_capabilities | ( | input_plugin_t * | this_gen | ) |
| static

References INPUT_CAP_BLOCK.

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_get_mrl()

static const char * v4l2_input_get_mrl | ( | input_plugin_t * | this_gen | ) |
| static

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_get_optional_data()

static int v4l2_input_get_optional_data | ( | input_plugin_t * | this_gen,
|  | void * | data,
|  | int | data_type
| ) |  |
| static

References INPUT_OPTIONAL_UNSUPPORTED.

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_length()

static off_t v4l2_input_length | ( | input_plugin_t * | this_gen | ) |
| static

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_open()

static int v4l2_input_open | ( | input_plugin_t * | this_gen | ) |
| static

References LOG_MODULE, lprintf, v4l2_input_setup_video_streaming(), v4l2_ioctl, v4l2_open, xine_event_new_queue(), XINE_VERBOSITY_LOG, and xprintf.

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_pos()

static off_t v4l2_input_pos | ( | input_plugin_t * | this_gen | ) |
| static

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_read()

static off_t v4l2_input_read | ( | input_plugin_t * | this_gen,
|  | void * | buf,
|  | off_t | nlen
| ) |  |
| static

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_read_block()

static buf_element_t * v4l2_input_read_block | ( | input_plugin_t * | this_gen,
|  | fifo_buffer_t * | fifo,
|  | off_t | len
| ) |  |
| static

References xine_bmiheader::biHeight, xine_bmiheader::biSize, xine_bmiheader::biWidth, BUF_FLAG_FRAME_START, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, BUF_VIDEO_YUY2, fifo_buffer_s::buffer_pool_alloc, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::free_buffer, lprintf, NULL, buf_element_s::pts, buf_element_s::size, buf_element_s::type, v4l2_input_dequeue_video_buffer(), and xine_monotonic_clock().

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_seek()

static off_t v4l2_input_seek | ( | input_plugin_t * | this_gen,
|  | off_t | offset,
|  | int | origin
| ) |  |
| static

Referenced by v4l2_class_get_instance().

## ◆ v4l2_input_setup_video_streaming()

static int v4l2_input_setup_video_streaming | ( | v4l2_input_plugin_t * | this | ) |
| static

References _x_assert, _x_stream_info_set(), lprintf, NULL, v4l2_input_enqueue_video_buffer(), v4l2_ioctl, v4l2_mmap, v4l2_munmap, XINE_STREAM_INFO_HAS_AUDIO, and XINE_STREAM_INFO_HAS_VIDEO.

Referenced by v4l2_input_open().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_INPUT, 18, "v4l2", XINE_VERSION_CODE, &input_info_v4l2, v4l2_init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
input_info_v4l2
const input_info_t input_info_v4l2
Definition: input_v4l2.c:457
v4l2_init_class
static void * v4l2_init_class(xine_t *xine, const void *data)
Definition: input_v4l2.c:441
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
NULL
NULL
Definition: xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition: xine_plugin.h:29
PLUGIN_INPUT
#define PLUGIN_INPUT
Definition: xine_plugin.h:30

## ◆ input_info_v4l2

const input_info_t input_info_v4l2

Initial value:
= {
4000
}