fbdev.c File Reference

Linux framebuffer input device, inspired by code from fbgrab.c by Gunnar Monell. More...

#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <time.h>
#include <linux/fb.h>
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avdevice.h"
#include "libavformat/internal.h"
Include dependency graph for fbdev.c:

Go to the source code of this file.

Data Structures

struct  rgb_pixfmt_map_entry
 
struct  FBDevContext
 

Macros

#define OFFSET(x)   offsetof(FBDevContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static enum AVPixelFormat get_pixfmt_from_fb_varinfo (struct fb_var_screeninfo *varinfo)
 
static av_cold int fbdev_read_header (AVFormatContext *avctx)
 
static int fbdev_read_packet (AVFormatContext *avctx, AVPacket *pkt)
 
static av_cold int fbdev_read_close (AVFormatContext *avctx)
 

Variables

static const struct rgb_pixfmt_map_entry rgb_pixfmt_map []
 
static const AVOption options []
 
static const AVClass fbdev_class
 
AVInputFormat ff_fbdev_demuxer
 

Detailed Description

Linux framebuffer input device, inspired by code from fbgrab.c by Gunnar Monell.

See also
http://linux-fbdev.sourceforge.net/

Definition in file fbdev.c.

Macro Definition Documentation

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 248 of file fbdev.c.

#define OFFSET (   x)    offsetof(FBDevContext, x)

Definition at line 247 of file fbdev.c.

Function Documentation

static av_cold int fbdev_read_close ( AVFormatContext avctx)
static

Definition at line 237 of file fbdev.c.

static av_cold int fbdev_read_header ( AVFormatContext avctx)
static

Definition at line 98 of file fbdev.c.

static int fbdev_read_packet ( AVFormatContext avctx,
AVPacket pkt 
)
static

Definition at line 184 of file fbdev.c.

static enum AVPixelFormat get_pixfmt_from_fb_varinfo ( struct fb_var_screeninfo *  varinfo)
static

Definition at line 64 of file fbdev.c.

Referenced by fbdev_read_header().

Variable Documentation

const AVClass fbdev_class
static
Initial value:
= {
.class_name = "fbdev indev",
.item_name = av_default_item_name,
.option = options,
}
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVOption options[]
Definition: fbdev.c:249

Definition at line 254 of file fbdev.c.

AVInputFormat ff_fbdev_demuxer
Initial value:
= {
.name = "fbdev",
.long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
.priv_data_size = sizeof(FBDevContext),
.priv_class = &fbdev_class,
}
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static av_cold int fbdev_read_header(AVFormatContext *avctx)
Definition: fbdev.c:98
static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
Definition: fbdev.c:184
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
static av_cold int fbdev_read_close(AVFormatContext *avctx)
Definition: fbdev.c:237
static int flags
Definition: cpu.c:23
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:345
static const AVClass fbdev_class
Definition: fbdev.c:254

Definition at line 261 of file fbdev.c.

const AVOption options[]
static
Initial value:
= {
{ "framerate","", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ NULL },
}
#define DEC
Definition: fbdev.c:248
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: fbdev.c:247

Definition at line 249 of file fbdev.c.

const struct rgb_pixfmt_map_entry rgb_pixfmt_map[]
static
Initial value:
= {
{ 32, 0, 8, 16, 24, AV_PIX_FMT_RGBA },
{ 32, 16, 8, 0, 24, AV_PIX_FMT_BGRA },
{ 32, 8, 16, 24, 0, AV_PIX_FMT_ARGB },
{ 32, 3, 2, 8, 0, AV_PIX_FMT_ABGR },
{ 24, 0, 8, 16, 0, AV_PIX_FMT_RGB24 },
{ 24, 16, 8, 0, 0, AV_PIX_FMT_BGR24 },
}
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:70
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:98
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:99
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:96
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:97
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:71

Definition at line 54 of file fbdev.c.