Go to the documentation of this file.
23 #include <sys/ioctl.h>
38 struct fb_var_screeninfo varinfo;
39 struct fb_fix_screeninfo fixinfo;
64 "Could not open framebuffer device '%s': %s\n",
69 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
75 if (ioctl(fbdev->
fd, FBIOGET_FSCREENINFO, &fbdev->
fixinfo) < 0) {
88 fbdev->
data = mmap(
NULL, fbdev->
fixinfo.smem_len, PROT_WRITE, MAP_SHARED, fbdev->
fd, 0);
89 if (fbdev->
data == MAP_FAILED) {
111 int video_width = par->
width;
112 int video_height = par->
height;
114 int src_line_size = video_width * bytes_per_pixel;
117 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0)
123 if (fb_pix_fmt != video_pix_fmt) {
130 bytes_to_copy =
FFMIN(fbdev->
varinfo.xres, video_width) * bytes_per_pixel;
134 bytes_per_pixel * fbdev->
varinfo.xoffset +
139 if (-fbdev->
xoffset >= video_width)
141 bytes_to_copy += fbdev->
xoffset * bytes_per_pixel;
142 pin -= fbdev->
xoffset * bytes_per_pixel;
146 if (
diff >= video_width)
148 bytes_to_copy -=
diff * bytes_per_pixel;
150 pout += bytes_per_pixel * fbdev->
xoffset;
156 if (-fbdev->
yoffset >= video_height)
159 pin -= fbdev->
yoffset * src_line_size;
163 if (
diff >= video_height)
171 for (
i = 0;
i < disp_height;
i++) {
172 memcpy(pout, pin, bytes_to_copy);
173 pout += fbdev->
fixinfo.line_length;
174 pin += src_line_size;
193 #define OFFSET(x) offsetof(FBDevContext, x)
194 #define ENC AV_OPT_FLAG_ENCODING_PARAM
196 {
"xoffset",
"set x coordinate of top left corner",
OFFSET(xoffset),
AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX,
ENC },
197 {
"yoffset",
"set y coordinate of top left corner",
OFFSET(yoffset),
AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX,
ENC },
const char * ff_fbdev_default_device()
#define AV_LOG_WARNING
Something somehow does not look correct.
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
This struct describes the properties of an encoded stream.
int xoffset
x coordinate of top left corner
struct fb_fix_screeninfo fixinfo
fixed info;
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
int yoffset
y coordinate of top left corner
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int fbdev_write_packet(AVFormatContext *h, AVPacket *pkt)
int ff_fbdev_get_device_list(AVDeviceInfoList *device_list)
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
static enum AVPixelFormat pix_fmt
int fd
framebuffer device file descriptor
static av_cold int fbdev_write_trailer(AVFormatContext *h)
static int fbdev_get_device_list(AVFormatContext *s, AVDeviceInfoList *device_list)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static int write_trailer(AVFormatContext *s1)
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
const AVOutputFormat ff_fbdev_muxer
#define i(width, name, range_min, range_max)
static av_cold int fbdev_write_header(AVFormatContext *h)
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
struct fb_var_screeninfo varinfo
variable info;
int bits_per_coded_sample
The number of bits per sample in the codedwords.
static const AVOption options[]
This structure stores compressed data.
#define flags(name, subs,...)
static void write_header(FFV1Context *f)
uint8_t * data
framebuffer data
static const AVClass fbdev_class
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.