포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 20MB 입니다.

간단하게 작성해 보았습니다.

320x240 16bpp를 target으로 했는데, 제 동작할지는 의문이네요......ㅎㅎ

실제로 잘 동작하던 소스에서 발췌만 한 겁니다. 혹 컴파일 안되더라도 몇가지만 수정하시면 될겁니다.
raw format으로 capture가 되니, display쪽은 따로 작성해 주셔야 할겁니다.

s3c24x0 자료실의 logodisp 라는 프로그램이 아마도 있을텐데, 그거 참조하시면 도움이 될겁니다.

그럼....


#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <stdio.h>
#include <sys/mman.h>
#include <errno.h>
#include <math.h>

#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/videodev.h>


#if 1
    #define gprintf(fmt, x... ) printf( "%s: " fmt, __FUNCTION__ , ## x)
#else
    #define gprintf(x...) do { } while (0)
#endif


#define VID_WIDTH      320 /* Default Width */
#define VID_HEIGHT     240 /* Default Height */



#define FB_DEV0     "/dev/fb0" /* Device Name */
//#define FB_DEV2     "/dev/fb2" /* Device Name */

char fb_device[] = FB_DEV0;


int main (int argc, char *argv[])
{
    int fd_fb;
    struct fb_var_screeninfo fbvar;
    struct fb_fix_screeninfo fbfix;
    char *frame_buffer;
    int y, format;
   
   
    int captured = 0;

    fd_fb = open(fb_device, O_RDWR);
    if (fd_fb < 0)
    {
        perror("fbdev open");
        return 0;
    }
    memset(&fbvar, 0, sizeof(fbvar));
    memset(&fbfix, 0, sizeof(fbfix));
    ioctl(fd_fb, FBIOGET_VSCREENINFO, &fbvar);
    ioctl(fd_fb, FBIOGET_FSCREENINFO, &fbfix);

    frame_buffer = (char *) mmap(0, fbfix.smem_len, PROT_READ | PROT_WRITE,MAP_SHARED, fd_fb, 0);
   
    {
        unsigned char r, g, b;
        unsigned short *ghc, data;
        FILE *out;
        int i, j;
       
        out = fopen("./320x240_16bpp.raw", "wb");
        if( out == NULL )
        {
            printf("fopen errorn");
            exit(1);
        }
           
        fwrite(frame_buffer, 320*240*2, 1, out);                   
       
        fclose(out);
    }
               

    return 0;
}



고현철

2009.03.30 00:27:53
*.32.117.22

맨 밑에 return 0 하기전에 framebuffer umap이랑 fb close를 안 했네요......ㅎㅎ
List of Articles
번호 제목 글쓴이 날짜 조회 수
53 The GNU Make - How to Using Make file 김재훈 2009-04-03 6064
52 The GNU Linker - How to Using ld file 김재훈 2009-04-03 6044
51 The GNU Binary Utilities - How to Using binutils file 김재훈 2009-04-03 6084
50 The GNU Assembler - How to Using AS file 김재훈 2009-04-03 6017
49 C Library ABI for the ARM®Architecture file 김재훈 2009-03-31 6077
48 ARM Developer Suiite (ADS) 메뉴얼 모음 file 김재훈 2009-03-31 7397
» framebuffer capture하기 [1] 고현철 2009-03-30 6107
46 우분투 리눅스 8.10 네트워크 수동 설정 방법 [2] 김재훈 2009-03-23 6367
45 우분투 리눅스 8.10 업데이트 서버 변경 방법 김재훈 2009-03-23 6144
44 VirtualBox 설치 및 환경 설정 가이드 file 김재훈 2009-03-23 6267
43 SDL에서 touchscreen enable 시키는 방법 고현철 2009-03-04 6046
42 ARM 어셈블러 설명서 한글판. file [7] 유형목 2007-12-15 7697
41 ARM 7 강좌를 다른 분이 편집한 자료 같네요. file [2] 황순일 2007-12-13 6228
40 ARM7 강좌를 PDF로 변환했습니다. start.S 분석자료 추가.. file [8] 유형목 2007-12-12 7721
39 mp4 container file format 고현철 2009-02-24 7818
38 응용프로그램 컴파일 시 "config.h"가 없다고 나오는 경우 [1] 김재훈 2009-02-18 6137
37 QT-Embedded 4.4.3 컴파일 방법 [1] 김재훈 2009-02-17 8042
36 Linux 101 Hacks file [1] 유형목 2009-02-15 6107
35 POSIX Serial Programming Guide file 김재훈 2009-02-12 6075
34 ARM ADS Errors and Warning 코드 설명 file 김재훈 2009-02-12 6040

사용자 로그인