34 #include <sys/ioctl.h>
92 struct fb_var_screeninfo varinfo;
93 struct fb_fix_screeninfo fixinfo;
103 int ret,
flags = O_RDONLY;
119 if ((fbdev->
fd = open(avctx->
filename, flags)) == -1) {
122 "Could not open framebuffer device '%s': %s\n",
127 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0) {
130 "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
134 if (ioctl(fbdev->
fd, FBIOGET_FSCREENINFO, &fbdev->
fixinfo) < 0) {
137 "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
145 "Framebuffer pixel format not supported.\n");
155 fbdev->
data = mmap(
NULL, fbdev->
fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->
fd, 0);
156 if (fbdev->
data == MAP_FAILED) {
172 "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
187 int64_t curtime, delay;
200 "time_frame:%"PRId64
" curtime:%"PRId64
" delay:%"PRId64
"\n",
208 ts.tv_sec = delay / 1000000;
209 ts.tv_nsec = (delay % 1000000) * 1000;
210 while (nanosleep(&ts, &ts) < 0 && errno == EINTR);
217 if (ioctl(fbdev->
fd, FBIOGET_VSCREENINFO, &fbdev->
varinfo) < 0)
219 "Error refreshing variable info: %s\n", strerror(errno));
228 for (i = 0; i < fbdev->
height; i++) {
230 pin += fbdev->
fixinfo.line_length;
247 #define OFFSET(x) offsetof(FBDevContext, x)
248 #define DEC AV_OPT_FLAG_DECODING_PARAM
269 .priv_class = &fbdev_class,