Go to the documentation of this file.
32 #include <sys/ioctl.h>
88 "Could not open framebuffer device '%s': %s\n",
93 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
100 if (ioctl(fbdev->
fd, FBIOGET_FSCREENINFO, &fbdev->
fixinfo) < 0) {
111 "Framebuffer pixel format not supported.\n");
121 fbdev->
data = mmap(
NULL, fbdev->
fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->
fd, 0);
122 if (fbdev->
data == MAP_FAILED) {
138 "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%"PRId64
"\n",
153 int64_t curtime, delay;
166 "time_frame:%"PRId64
" curtime:%"PRId64
" delay:%"PRId64
"\n",
174 ts.tv_sec = delay / 1000000;
175 ts.tv_nsec = (delay % 1000000) * 1000;
176 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
183 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
197 pin += fbdev->
fixinfo.line_length;
219 #define OFFSET(x) offsetof(FBDevContext, x)
220 #define DEC AV_OPT_FLAG_DECODING_PARAM
int64_t av_gettime_relative(void)
Get the current time in microseconds since some unspecified starting point.
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
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
AVRational avg_frame_rate
Average framerate.
static const AVClass fbdev_class
struct fb_fix_screeninfo fixinfo
fixed info;
static av_cold int read_close(AVFormatContext *ctx)
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int ff_fbdev_get_device_list(AVDeviceInfoList *device_list)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
int flags
Flags modifying the (de)muxer behaviour.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static int fbdev_get_device_list(AVFormatContext *s, AVDeviceInfoList *device_list)
static enum AVPixelFormat pix_fmt
int fd
framebuffer device file descriptor
int frame_size
size in bytes of a grabbed frame
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
static av_cold int fbdev_read_close(AVFormatContext *avctx)
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
int64_t time_frame
time for the next frame to output (in 1/1000000 units)
const AVInputFormat ff_fbdev_demuxer
#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...
char * url
input or output URL.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int frame_linesize
linesize of the output frame, it is assumed to be constant
int64_t av_gettime(void)
Get the current time in microseconds.
struct fb_var_screeninfo varinfo
variable info;
static av_cold int fbdev_read_header(AVFormatContext *avctx)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
uint8_t * data
framebuffer data
static const AVOption options[]
void * priv_data
Format private data.
int height
assumed frame resolution
AVRational framerate_q
framerate
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.