32 #include <sys/ioctl.h>
38 #include "libavutil/log.h"
39 #include "libavutil/mem.h"
40 #include "libavutil/opt.h"
41 #include "libavutil/time.h"
42 #include "libavutil/parseutils.h"
43 #include "libavutil/pixdesc.h"
59 struct fb_var_screeninfo varinfo;
60 struct fb_fix_screeninfo fixinfo;
83 "Could not open framebuffer device '%s': %s\n",
88 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
95 if (ioctl(fbdev->
fd, FBIOGET_FSCREENINFO, &fbdev->
fixinfo) < 0) {
106 "Framebuffer pixel format not supported.\n");
116 fbdev->
data = mmap(NULL, fbdev->
fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->
fd, 0);
117 if (fbdev->
data == MAP_FAILED) {
133 "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
148 int64_t curtime, delay;
161 "time_frame:%"PRId64
" curtime:%"PRId64
" delay:%"PRId64
"\n",
169 ts.tv_sec = delay / 1000000;
170 ts.tv_nsec = (delay % 1000000) * 1000;
171 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
178 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0)
180 "Error refreshing variable info: %s\n",
av_err2str(ret));
189 for (i = 0; i < fbdev->
height; i++) {
191 pin += fbdev->
fixinfo.line_length;
208 #define OFFSET(x) offsetof(FBDevContext, x)
209 #define DEC AV_OPT_FLAG_DECODING_PARAM
230 .priv_class = &fbdev_class,
int height
assumed frame resolution
static const AVClass fbdev_class
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
AVCodecContext * codec
Codec context associated with this stream.
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.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
int frame_linesize
linesize of the output frame, it is assumed to be constant
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int frame_size
size in bytes of a grabbed frame
const char * av_default_item_name(void *ctx)
Return the context name.
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 avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
int64_t time_frame
time for the next frame to output (in 1/1000000 units)
static double av_q2d(AVRational a)
Convert rational to double.
static av_cold int read_close(AVFormatContext *ctx)
enum AVPixelFormat pix_fmt
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
const OptionDef options[]
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define av_err2str(errnum)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
char filename[1024]
input or output filename
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
AVPixelFormat
Pixel format.
static av_cold int fbdev_read_close(AVFormatContext *avctx)
struct fb_fix_screeninfo fixinfo
fixed info;
common internal API header
int64_t av_gettime(void)
Get the current time in microseconds.
int bit_rate
the average bitrate
int width
picture width / height.
AVRational framerate_q
framerate
static int read_header(FFV1Context *f)
#define AV_LOG_INFO
Standard information.
enum AVMediaType codec_type
AVInputFormat ff_fbdev_demuxer
static void close(AVCodecParserContext *s)
Main libavdevice API header.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
rational number numerator/denominator
offset must point to AVRational
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
static av_cold int fbdev_read_header(AVFormatContext *avctx)
uint8_t * data
framebuffer data
This structure stores compressed data.
int fd
framebuffer device file descriptor
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.