Hi, had a short look.
Not quite sure what is your issue so I need to ask a few questions.

You might want to remove DSFLIP_WAITFORSYNC to see how close you are to 30.
Did you do the math to check for the maximum theoretical throughput?
Also curious if the layer really switched to UYVY, not sure if your gfx 
driver supports this. You can check with dfbdump, best is to run this at 
the same time as your test code (you need to have directfb configured 
multi-app in this case).
Also, you mention 'primarysurface' but if I understand the code, it 
doesn't take the primary layer.

Is your example displaying the little movie correctly?

Greets
Niels

Lidj wrote:
> Dear all,
>    I am new to DFB, here I modify df_layer.c to play UYVY data on XGI
> graphic card,
>   this graphic card support yuv to rgb. Now I playing XGA(1024x768
> 16it)picture(about 1.5 mb/frame), 
> the frame rate is just 15 frame/s,I want to achieve 30 frame/s at least. 
>
> Here is my flow.
> 1. Create "dfb" super interface.
> 2. Enumerate display layers "videolayer"  from dfb.
> 3. "videolayer" get "videosurface" ,"dfb" create "primarysurface" 
> 4. copy yuv data into "videosurface", then flip.
>
>   yuv data already buffer to memory, just playing yuv date cyclically.
>
> Here is slice code.
> <=========
> while (!quit) {
>
> lastftick = myclock();
> for(i=0;i<FRAME_NUMBER;I++){
> CopyYUVData(temp[i], videosurface);
>
> /*Flip the buffers of videosurface on the video layer*/
> videosurface->Flip(videosurface, NULL, DSFLIP_WAITFORSYNC);
> }
> lastftick = myclock()-lastftick; 
> printf("playing %d buffer time used: %ld s\n", frame_number,lastftick); 
>
> }
> =========>
>
>
> <=========
> #define YUVSRC_W 1024
> #define YUVSRC_H 768
>
> #define YUVFRAME_BYTESPerPixel 2
> #define YUVFRAME_SIZE (YUVSRC_W * YUVSRC_H)
> #define YUVFRAME_Pitch (YUVSRC_W * YUVFRAME_BYTESPerPixel)
>
> void CopyYUVData(unsigned char *src, IDirectFBSurface *des)
> {
> int y;
> void             *data;
> unsigned int      pitch;
> DFBResult         ret;
> ret = des->Lock (des, DSLF_WRITE, &data, &pitch);
> if (ret)
> {
>   fprintf(stderr,"IDirectFBSurface:ock error code =%d", ret);
>   return;
> }
> for(y=0; y<YUVSRC_H; y++)
> {
>   memcpy(data, src+YUVFRAME_Pitch*y, YUVFRAME_Pitch);
>   data += pitch;
> }
> des->Unlock (des);
> }
> =========>
>
>    here is entire code. please go to below link, and simply click dowoload.
>    http://www.box.net/shared/7dafavyvrz
>
>    Any comment will be very appreciated :D
>
>    Best regard~
>    Lidj.
>
>   


-- 

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------" 

_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to