|
From: =?iso-8859-1?Q?<p.g...@li...> - 2003-02-06 15:27:27
|
Hi,=0D=0AI have a problem when I change the bpp value, here is the code:=0D=
=0A=0D=0Aif( ioctl(fbd, FBIOGET_VSCREENINFO, &var_info) =3D=3D -1){=0D=0A=
perror("\nError IOCTL 1");=0D=0A exit(0);=0D=0A} =0D=0Aprintf(=
"\n bpp: %d", var_info.bits_per_pixel); // output is bpp: 16=0D=0Avar_=
info.bits_per_pixel =3D 24;=0D=0Aif( ioctl(fbd, FBIOPUT_VSCREENINFO, &var=
_info) =3D=3D -1){=0D=0A perror("\nError IOCTL 2");=0D=0A exit(0);=0D=0A}=
=0D=0AThe program exit with the following message error: =0D=0A=
Error IOCTL 2: Invalid argument=0D=0A=0D=0AHow can I set the bpp value? S=
hould I modify the file /etc/X11/XF86Config?=0D=0A=0D=0AI have another pr=
oblem, I try to write a simple program that reads frame from framebuffer =
and then creates a Divx file of a few seconds.=0D=0AI map the framebuffer=
to a buffer, but the program crash with a segmentation fault:=0D=0A =
=0D=0A screen_buffer =3D (=
char *)malloc(DIM_BUFFER * sizeof(char));=0D=0A screen_buffer =3D (voi=
d *)mmap(0, DIM_BUFFER, PROT_READ, MAP_SHARED, fbd, 0); =0D=
=0A =0D=0A encFrame.image =3D (void *)screen_buffer; <--- causes seg =
fault=0D=0A=0D=0AWhat's wrong? =0D=0A=0D=0AThanks,=0D=0APaolo Gilardetti=
=0D=0A =0D=0A
|