32 #include <sys/ioctl.h>
91 struct fb_var_screeninfo varinfo;
92 struct fb_fix_screeninfo fixinfo;
102 int ret,
flags = O_RDONLY;
121 "Could not open framebuffer device '%s': %s\n",
126 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
129 "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
133 if (ioctl(fbdev->
fd, FBIOGET_FSCREENINFO, &fbdev->
fixinfo) < 0) {
136 "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
144 "Framebuffer pixel format not supported.\n");
154 fbdev->
data = mmap(
NULL, fbdev->
fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->
fd, 0);
155 if (fbdev->
data == MAP_FAILED) {
171 "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
186 int64_t curtime, delay;
198 "time_frame:%"PRId64
" curtime:%"PRId64
" delay:%"PRId64
"\n",
203 ts.tv_sec = delay / 1000000;
204 ts.tv_nsec = (delay % 1000000) * 1000;
205 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
214 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0)
216 "Error refreshing variable info: %s\n", strerror(errno));
226 for (i = 0; i < fbdev->
height; i++) {
228 pin += fbdev->
fixinfo.line_length;
245 #define OFFSET(x) offsetof(FBDevContext, x)
246 #define DEC AV_OPT_FLAG_DECODING_PARAM
267 .priv_class = &fbdev_class,
int height
assumed frame resolution
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
#define AV_LOG_WARNING
Something somehow does not look correct.
char * framerate
framerate string set by a private option
packed RGB 8:8:8, 24bpp, RGBRGB...
memory handling functions
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVInputFormat ff_fbdev_demuxer
#define FF_ARRAY_ELEMS(a)
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 * 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;
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
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)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
enum AVPixelFormat pixfmt
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
struct fb_fix_screeninfo fixinfo
fixed info;
AVCodecContext * codec
Codec context associated with this stream.
common internal API header
int bit_rate
the average bitrate
char filename[1024]
input or output filename
int width
picture width / height.
packed RGB 8:8:8, 24bpp, BGRBGR...
enum AVPixelFormat pix_fmt
AVRational framerate_q
framerate
static int read_header(FFV1Context *f)
int64_t av_gettime(void)
Get the current time in microseconds.
#define AV_LOG_INFO
Standard information.
enum AVMediaType codec_type
static av_cold int fbdev_read_header(AVFormatContext *avctx)
static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
static void close(AVCodecParserContext *s)
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
static av_cold int fbdev_read_close(AVFormatContext *avctx)
Describe the class of an AVClass context structure.
rational number numerator/denominator
uint8_t * data
framebuffer data
static enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
static struct rgb_pixfmt_map_entry rgb_pixfmt_map[]
void * priv_data
Format private data.
static const AVClass fbdev_class
static const AVOption options[]
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.
AVPixelFormat
Pixel format.
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.