Changeset 3870

Show
Ignore:
Timestamp:
02/26/07 12:36:48 (2 years ago)
Author:
hverkuil
Message:

Add framebuffer experimental code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ivtvtv/trunk/ivtvtv.cpp

    r3711 r3870  
    1616int g_spd = 0; 
    1717int idx = 0; 
     18 
     19static unsigned int osd[576][720]; 
    1820 
    1921#if 0 
     
    143145 
    144146static int dir = 0; 
    145 static int av = 0; 
    146147 
    147148void speed(int fh, int delta) 
     
    171172                dir = 0; 
    172173                speed(fh, 0); 
    173               ioctl(fh, IVTV_IOC_PLAY, 0); 
     174//            ioctl(fh, IVTV_IOC_PLAY, 0); 
    174175                break; 
    175176        case 'd': 
     
    228229        int fin, fout, fmax = 0; 
    229230        int fidx; 
     231        int ffb; 
    230232        char *buf; 
    231233        int bufsz = 0; 
     
    242244        if (fin < 0) { 
    243245                fprintf(stderr, "Cannot open file %s\n", argv[1]); 
     246                exit(1); 
     247        } 
     248        ffb = open("/dev/fb0", O_RDWR); 
     249        if (fin < 0) { 
     250                fprintf(stderr, "Cannot open file %s\n", "/dev/fb0"); 
    244251                exit(1); 
    245252        } 
     
    281288        int cnt = 0; 
    282289        int quit = 0; 
    283  
     290         
     291        for (int y = 0; y < 576; y++) { 
     292                for (int x = 0; x < 720; x++) { 
     293                        osd[y][x] = ((x >> 2) &1) ? 0xff00ff00: 0xff0000ff; 
     294                } 
     295        } 
     296#if 0 
     297        struct ivtvfb_ioctl_dma_host_to_ivtv_args fbargs; 
     298        fbargs.source = osd; 
     299        fbargs.dest_offset = 0; 
     300        fbargs.count = sizeof(osd); 
     301        ioctl(ffb, IVTVFB_IOCTL_PREP_FRAME, &fbargs); 
     302        struct ivtvfb_alpha alpha; 
     303        ioctl(ffb, IVTVFB_IOCTL_GET_ALPHA, &alpha); 
     304        printf("%d %d %d %x %x\n", alpha.global_alpha_state, alpha.local_alpha_state, alpha.color_key_state, alpha.global_alpha, alpha.color_key); 
     305        alpha.color_key_state = 1; 
     306        alpha.color_key = 0xff0000ff; 
     307        ioctl(ffb, IVTVFB_IOCTL_SET_ALPHA, &alpha); 
     308        exit(0); 
     309#endif 
    284310        t1 = time(NULL); 
    285311        if (argc >= 4) {