I want to play MPG files one bye one,and design the following framwork,
Anybody who can give me some suggestion,as I am not sure how to control break out the refresh loop,
Or is there any more better way to do it?

#include <pthread.h>
#incldue <directfb.h>

// thread according to playlist
void * video_play(void * playlist)
{
          desc.flags = DWDESC_POSX | DWDESC_POSY;
          desc.posx = 0; desc.posy = 0;
          DFBCHECK(layer->CreateWindow( layer, &desc, &videowindow ) );//create video_window
          DFBCHECK(videowindow->GetSurface( videowindow, &videosurface ) );//get video_window's surface
          videowindow->SetOpacity( videowindow, 0xFF);//set video_window's
   
         for each video file A in playlist
              DFBCHECK(dfb->CreateVideoProvider( dfb, "video file A",&videoprovider ));//create video_provider
              videoprovider->GetSurfaceDescription( videoprovider, &sdsc );//get video info
              DFBCHECK(videoprovider->PlayTo( videoprovider,videosurface,NULL,NULL,NULL));//play video
               while(some time)//how to break so play next file??by the video Length(seconds)?
               {                                      
                      DFBCHECK(videosurface->Flip(videosurface,NULL,DSFLIP_WAITFORSYNC));//refresh
               }
        end//end _for _each video file
}

main(argv)
{
      pthread_t  video_thread;//video thread
      pthread_t  image_thread;//for image
      pthread_t  font_thread;//for font

      char * play_list;//add some video files

      pthread_create(&video_thread,NULL,video_play,(void *)playlist);//create a thread to play video one by one
   
      pthread_create(&image_thread,...)//thread to slide show pictures in another surface
      ...
    
}
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to