25 #include <sys/ioctl.h>
66 const char *dev = getenv(
"FRAMEBUFFER");
74 struct fb_var_screeninfo varinfo;
75 struct fb_fix_screeninfo fixinfo;
84 for (i = 0; i <= 31; i++) {
85 snprintf(device_file,
sizeof(device_file),
"/dev/fb%d", i);
94 if (ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) == -1)
96 if (ioctl(fd, FBIOGET_FSCREENINFO, &fixinfo) == -1)
115 if (default_device && !strcmp(device->
device_name, default_device)) {
117 default_device =
NULL;
Structure describes basic parameters of the device.
char * device_description
human friendly name
packed RGB 8:8:8, 24bpp, RGBRGB...
char * device_name
device name, format depends on device
const char * ff_fbdev_default_device()
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
Main libavdevice API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
Add an element to a dynamic array.
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
enum AVPixelFormat pixfmt
AVDeviceInfo ** devices
list of autodetected devices
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
packed RGB 8:8:8, 24bpp, BGRBGR...
#define FF_ARRAY_ELEMS(a)
char * av_strdup(const char *s)
Duplicate the string s.
static const struct rgb_pixfmt_map_entry rgb_pixfmt_map[]
int ff_fbdev_get_device_list(AVDeviceInfoList *device_list)
int default_device
index of default device or -1 if no default
common internal and external API header
enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
#define AV_PIX_FMT_RGB565
int nb_devices
number of autodetected devices
AVPixelFormat
Pixel format.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...