From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Abhilash" Subject: Frame buffer Reading fails!! Date: Fri, 3 Jan 2003 21:18:51 +0530 Sender: linux-fbdev-devel-admin@lists.sourceforge.net Message-ID: <00df01c2b33f$a1354690$bd00000a@abhilash> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00DC_01C2B36D.B6843500" Return-path: Received: from mail2.sonytel.be ([195.0.45.172] helo=mail.sonytel.be) by sc8-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 18UlC3-0001AL-00 for ; Sat, 04 Jan 2003 02:06:16 -0800 Received: from vervain.sonytel.be (mail.sonytel.be [10.17.0.27]) by mail.sonytel.be (8.9.0/8.8.6) with ESMTP id LAA07513 for ; Sat, 4 Jan 2003 11:05:36 +0100 (MET) ReSent-To: Linux Frame Buffer Device Development ReSent-Message-ID: Errors-To: linux-fbdev-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: inux-fbdev-devel@lists.sourceforge.net, Geert Uytterhoeven This is a multi-part message in MIME format. ------=_NextPart_000_00DC_01C2B36D.B6843500 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, As u suggested I tried following code in RedHat7.1. But it shows "The framebuffer device was opened successfully." "Error reading fixed information." What could be the problem? I am new to this. Thank you, Abhilash. #include #include #include #include #include int main() { int fbfd =3D 0; struct fb_var_screeninfo vinfo; struct fb_fix_screeninfo finfo; long int screensize =3D 0; char *fbp =3D 0; int x =3D 0, y =3D 0; long int location =3D 0; // Open the file for reading and writing fbfd =3D open("/dev/fb0", O_RDWR); if (!fbfd) { printf("Error: cannot open framebuffer device.\n"); exit(1); } printf("The framebuffer device was opened successfully.\n"); // Get fixed screen information if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) { printf("Error reading fixed information.\n"); exit(2); } } ----- Original Message ----- From: "Geert Uytterhoeven" To: "Abhilash" Cc: "Linux Frame Buffer Device Development" Sent: Friday, December 27, 2002 5:03 PM Subject: Re: [Linux-fbdev-devel] Screen Capturing > On Fri, 27 Dec 2002, Abhilash wrote: > > I need to capture the screen .For that I use mirror driver in Windows for > > capturing screen. > > ie, its basically overloading the driver functions. > > > > So in case of Linux, is there any method like this or which is the best > > method? > > In Xlib there are some functions to capture screen and also heard abt VESA > > which is better? > > If you are using a frame buffer device, you can capture the contents of > /dev/fb*. Either read from /dev/fb*, or mmap() it. The data you receive are in > the native format of the graphics chip. For CLUT modes, you have to use an > ioctl() to get the colormap. > > Gr{oetje,eeting}s, > > Geert ------=_NextPart_000_00DC_01C2B36D.B6843500 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,

As u suggested I tried = following code=20 in RedHat7.1.
But it shows

 "The framebuffer device was = opened=20 successfully."
 "Error reading fixed information."

What = could be=20 the problem?
I am new to this.

Thank=20 you,
Abhilash.


#include <unistd.h>
#include=20 <stdio.h>
#include <fcntl.h>
#include=20 <linux/fb.h>
#include <sys/mman.h>

int=20 main()
{
    int fbfd =3D 0;
    = struct=20 fb_var_screeninfo vinfo;
    struct fb_fix_screeninfo=20 finfo;
    long int screensize =3D = 0;
    char=20 *fbp =3D 0;
    int x =3D 0, y =3D = 0;
    long int=20 location =3D 0;

    // Open the file for reading = and=20 writing
    fbfd =3D open("/dev/fb0",=20 O_RDWR);
    if (!fbfd)=20 {
        printf("Error: cannot = open=20 framebuffer device.\n");
       =20 exit(1);
    }
    printf("The = framebuffer=20 device was opened successfully.\n");

    // Get = fixed=20 screen information
    if (ioctl(fbfd, = FBIOGET_FSCREENINFO,=20 &finfo)) {
        = printf("Error=20 reading fixed = information.\n");
       =20 exit(2);
    }
}

----- Original Message=20 -----
From: "Geert Uytterhoeven" <geert@linux-m68k.org>
To: = "Abhilash" <abhilash@avenir.net>
Cc: = "Linux=20 Frame Buffer Device Development"
<linux-fbdev-devel= @lists.sourceforge.net>
Sent:=20 Friday, December 27, 2002 5:03 PM
Subject: Re: [Linux-fbdev-devel] = Screen=20 Capturing


> On Fri, 27 Dec 2002, Abhilash wrote:
> = > I=20 need to capture the screen .For that I use mirror driver=20 in
Windows
for
> > capturing screen.
> > ie, its = basically overloading the driver functions.
> >
> > So = in case=20 of Linux, is there any method like this or which is the
best
> = >=20 method?
> > In Xlib there are some functions to capture screen = and also=20 heard
abt
VESA
> > which is better?
>
> If = you are=20 using a frame buffer device, you can capture the contents
of
>=20 /dev/fb*. Either read from /dev/fb*, or mmap() it. The data=20 you
receive
are in
> the native format of the graphics chip. = For=20 CLUT modes, you have to
use an
> ioctl() to get the=20 colormap.
>
> Gr{oetje,eeting}s,
>
>=20 Geert


------=_NextPart_000_00DC_01C2B36D.B6843500-- ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf