#include "config.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <poll.h>
#include <linux/videodev2.h>
#include "libavutil/atomic.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "libavutil/mathematics.h"
Go to the source code of this file.
|
static int | device_open (AVFormatContext *ctx) |
|
static int | device_init (AVFormatContext *ctx, int *width, int *height, uint32_t pix_fmt) |
|
static int | first_field (int fd) |
|
static uint32_t | fmt_ff2v4l (enum AVPixelFormat pix_fmt, enum AVCodecID codec_id) |
|
static enum AVPixelFormat | fmt_v4l2ff (uint32_t v4l2_fmt, enum AVCodecID codec_id) |
|
static enum AVCodecID | fmt_v4l2codec (uint32_t v4l2_fmt) |
|
static void | list_formats (AVFormatContext *ctx, int fd, int type) |
|
static int | mmap_init (AVFormatContext *ctx) |
|
static void | mmap_release_buffer (void *opaque, uint8_t *data) |
|
static int | mmap_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) |
|
static uint32_t | device_try_init (AVFormatContext *s1, enum AVPixelFormat pix_fmt, int *width, int *height, enum AVCodecID *codec_id) |
|
static int | v4l2_read_header (AVFormatContext *s1) |
|
static int | v4l2_read_packet (AVFormatContext *s1, AVPacket *pkt) |
|
static int | v4l2_read_close (AVFormatContext *s1) |
|
#define V4L_COMPFORMATS 2 |
#define OFFSET |
( |
|
x | ) |
offsetof(struct video_data, x) |
static int device_init |
( |
AVFormatContext * |
ctx, |
|
|
int * |
width, |
|
|
int * |
height, |
|
|
uint32_t |
pix_fmt |
|
) |
| |
|
static |
static int first_field |
( |
int |
fd | ) |
|
|
static |
static enum AVCodecID fmt_v4l2codec |
( |
uint32_t |
v4l2_fmt | ) |
|
|
static |
const int desired_video_buffers = 256 |
|
static |
struct fmt_map fmt_conversion_table[] |
|
static |
Initial value:= {
}
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
packed RGB 8:8:8, 24bpp, RGBRGB...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
packed RGB 8:8:8, 24bpp, BGRBGR...
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define AV_PIX_FMT_RGB555
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define AV_PIX_FMT_RGB565
Definition at line 97 of file v4l2.c.
Initial value:= {
{
"list_formats",
"List available formats and exit",
OFFSET(list_format),
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX,
DEC,
"list_formats" },
}
static int64_t video_size
Definition at line 870 of file v4l2.c.
Initial value:= {
.class_name = "V4L2 indev",
}
static const AVOption options[]
Definition at line 884 of file v4l2.c.
Initial value:= {
.name = "video4linux2",
}
static int v4l2_read_packet(AVFormatContext *s1, AVPacket *pkt)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int read_header(FFV1Context *f)
static const AVClass v4l2_class
static int v4l2_read_header(AVFormatContext *s1)
static int v4l2_read_close(AVFormatContext *s1)
Definition at line 891 of file v4l2.c.