FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
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"

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 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 OFFSET (   x)    offsetof(FBDevContext, x)

Definition at line 247 of file fbdev.c.

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 248 of file fbdev.c.

Function Documentation

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().

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 av_cold int fbdev_read_close ( AVFormatContext avctx)
static

Definition at line 237 of file fbdev.c.

Variable Documentation

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 },
}

Definition at line 54 of file fbdev.c.

const AVOption options[]
static
Initial value:
= {
{ "framerate","", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ NULL },
}

Definition at line 249 of file fbdev.c.

const AVClass fbdev_class
static
Initial value:
= {
.class_name = "fbdev indev",
.item_name = av_default_item_name,
.option = options,
}

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,
}

Definition at line 261 of file fbdev.c.