32 #include <sys/ioctl.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;
213 #define OFFSET(x) offsetof(FBDevContext, x)
214 #define DEC AV_OPT_FLAG_DECODING_PARAM
237 .priv_class = &fbdev_class,