paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/plugins/mpeg pgmpeg-test.cc,1.1.2.1,1.1.2.2 p


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/plugins/mpeg pgmpeg-test.cc,1.1.2.1,1.1.2.2 pgmpeg2.cc,1.1.2.1,1.1.2.2 pgmpeg2.hh,1.1.2.1,1.1.2.2
Date: Mon, 03 Feb 2003 11:40:02 -0500

Update of /cvsroot/paragui/paragui/plugins/mpeg
In directory subversions:/tmp/cvs-serv7702/plugins/mpeg

Modified Files:
      Tag: devel-opengl
        pgmpeg-test.cc pgmpeg2.cc pgmpeg2.hh 
Log Message:
updates to handle multiframe pictures - specifically for building font 
accelerations.


Index: pgmpeg-test.cc
===================================================================
RCS file: /cvsroot/paragui/paragui/plugins/mpeg/Attic/pgmpeg-test.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** pgmpeg-test.cc      4 Nov 2002 11:12:50 -0000       1.1.2.1
--- pgmpeg-test.cc      3 Feb 2003 16:39:59 -0000       1.1.2.2
***************
*** 7,10 ****
--- 7,12 ----
  #include "pgnavigator.h"
  #include "pgdraw.h"
+ #include "pglog.h"
+ #include "pgdriver.h"
  
  class PG_MyMPEGPlayerWindow : public PG_MoveableMPEGPLayerWindow {
***************
*** 308,314 ****
  }
  
! int main(int argc, char* argv[]) 
! {
!       if (argc != 2){
                printf("Use: %s archivo_mpeg\n", argv[0]);
                return -1;
--- 310,355 ----
  }
  
! int main(int argc, char* argv[]) {
! 
!         /* PG_Application& app = PG_Application::GetInstance(); */
!       MyApplication app;
!       PG_VideoDriver* gldriver = NULL;
!       char* fname;
!       fname = NULL;
!       while ( argc > 1 ) {
!         --argc;
! #ifdef HAVE_OPENGL
!         if (strcmp(argv[argc], "-gl") == 0) {
!           PG_LogMSG("Initializing OpenGL driver\n");
!           gldriver = new PG_VideoDriver(app, PG_GLVIDEO);
!         }
! #endif
! #ifdef HAVE_DUMMYVIDEO
!         else if(strcmp(argv[argc], "-dummy") == 0) {
!           PG_LogMSG("Initializing Dummy driver\n");
!           gldriver = new PG_VideoDriver(app, PG_DUMMYVIDEO);
!         }
! #endif
! #ifdef HAVE_DIRECTX
!         else if(strcmp(argv[argc], "-DX") == 0) {
!           PG_LogMSG("Initializing DirectX driver\n");
!           gldriver = new PG_VideoDriver(app, PG_DXVIDEO);
!         }
! #endif
!         else {
!           fname = argv[argc];
!         };
!       }
! 
!       if (gldriver != NULL) {
!         if (gldriver->valid()) {
!           PG_LogMSG("Initializing provided graphics driver\n");
!           gldriver->attach();
!         } else {
!           PG_LogERR("graphics driver failed to initialize! - Quitting...");
!           return -1;
!         };
!       };
!       if (fname == NULL) {
                printf("Use: %s archivo_mpeg\n", argv[0]);
                return -1;
***************
*** 320,333 ****
          int bpp = 0;
        // PG_Application app;
-       MyApplication app;
        /* flags |= SDL_RESIZABLE */ /* need hooks to make this useful */
  
!       if(!app.LoadTheme("default")) {
!                 printf("Unable to load theme!\n");
                  exit(-1);
          }
  
!       if(!app.InitScreen(800, 600 , bpp, flags)){
!                 printf("Resolution not supported\n");
                  exit(-1);
          }
--- 361,373 ----
          int bpp = 0;
        // PG_Application app;
        /* flags |= SDL_RESIZABLE */ /* need hooks to make this useful */
  
!       if(!app.InitScreen(800, 600 , bpp, flags)){
!                 printf("Resolution not supported\n");
                  exit(-1);
          }
  
!       if(!app.LoadTheme("default")) {
!                 printf("Unable to load theme!\n");
                  exit(-1);
          }
***************
*** 365,376 ****
        // #define CMPEG PG_MyMPEGPlayerWindow
  #if 0
!       thePlayer = new CMPEG(argv[1], NULL, PG_Rect(100, 100, 640, 480));
  #else
        PG_Panel fq(NULL, PG_Rect(0, 0, 700, 600-23));
        fq.Show();
!       thePlayer = new CMPEG(argv[1], &fq, PG_Rect(100, 100, 640, 480));
  #endif
  #else
!       PG_PlayerWindow vid(NULL, PG_Rect(100, 100, 640+4, 480+29), argv[1]);
        thePlayer = vid.player;
        vid.Show();
--- 405,416 ----
        // #define CMPEG PG_MyMPEGPlayerWindow
  #if 0
!       thePlayer = new CMPEG(fname, NULL, PG_Rect(100, 100, 640, 480));
  #else
        PG_Panel fq(NULL, PG_Rect(0, 0, 700, 600-23));
        fq.Show();
!       thePlayer = new CMPEG(fname, &fq, PG_Rect(100, 100, 640, 480));
  #endif
  #else
!       PG_PlayerWindow vid(NULL, PG_Rect(100, 100, 640+4, 480+29), fname);
        thePlayer = vid.player;
        vid.Show();

Index: pgmpeg2.cc
===================================================================
RCS file: /cvsroot/paragui/paragui/plugins/mpeg/Attic/pgmpeg2.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** pgmpeg2.cc  4 Nov 2002 11:12:50 -0000       1.1.2.1
--- pgmpeg2.cc  3 Feb 2003 16:39:59 -0000       1.1.2.2
***************
*** 43,47 ****
    double v = currenttime() / totaltime();
    pos->SetRange(0,PLAYERSCALE);
!   pos->SetPosition(v * PLAYERSCALE);
  };
  
--- 43,47 ----
    double v = currenttime() / totaltime();
    pos->SetRange(0,PLAYERSCALE);
!   pos->SetPosition((int)(v * PLAYERSCALE));
  };
  
***************
*** 90,94 ****
          (double)(slider->GetMaxRange() - slider->GetMinRange()));
    if (v == SMPEG_PLAYING) Stop();
!   Seek(setp * totalsize());
    if (v == SMPEG_PLAYING) Play();
    return true;
--- 90,94 ----
          (double)(slider->GetMaxRange() - slider->GetMinRange()));
    if (v == SMPEG_PLAYING) Stop();
!   Seek((int)(setp * totalsize()));
    if (v == SMPEG_PLAYING) Play();
    return true;
***************
*** 99,103 ****
    if (pos != NULL) {
      double v = currenttime() / totaltime();
!     pos->SetPosition(v * PLAYERSCALE);
    };
  };
--- 99,103 ----
    if (pos != NULL) {
      double v = currenttime() / totaltime();
!     pos->SetPosition((int)(v * PLAYERSCALE));
    };
  };
***************
*** 109,115 ****
    SetDirtyUpdate(true);
    f = SMPEG_new(file, &info, true);
!   SMPEG_setdisplay(f, my_srfObject->SDL(), NULL, cb);
!   hash[my_srfObject->SDL()] = this;
!   currentscreen = my_srfObject->SDL();
    bFastMode = false;
  }
--- 109,123 ----
    SetDirtyUpdate(true);
    f = SMPEG_new(file, &info, true);
!   mps = NULL;
!   if (my_srfObject->GetPixels() == NULL) {
!     mps = 
PG_Application::GetDrawingEnvironment()->CreateDrawableSurface(my_srfObject->GetWidth(),
 my_srfObject->GetHeight());
!     SMPEG_setdisplay(f, mps->SDL(), NULL, cb);
!     hash[mps->SDL()] = this;
!     currentscreen = mps->SDL();
!   } else {
!     SMPEG_setdisplay(f, my_srfObject->SDL(), NULL, cb);
!     hash[my_srfObject->SDL()] = this;
!     currentscreen = my_srfObject->SDL();
!   };
    bFastMode = false;
  }
***************
*** 125,129 ****
    Stop();
    SMPEG_delete(f);
!   hash.erase(my_srfObject->SDL());
  }
  
--- 133,142 ----
    Stop();
    SMPEG_delete(f);
!   if (mps != NULL) {
!     hash.erase(mps->SDL());
!     delete mps;
!   } else {
!     hash.erase(my_srfObject->SDL());
!   };
  }
  
***************
*** 182,193 ****
        // screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 
screen->format->BitsPerPixel, screen->flags);
        fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!       if (my_srfObject->SDL() != currentscreen)
!       {
!         fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!         hash.erase(currentscreen);
!         currentscreen = my_srfObject->SDL();
!         hash[my_srfObject->SDL()] = this;
!         SMPEG_setdisplay(f, my_srfObject->SDL(), NULL, cb);
!       };
        fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        SMPEG_scaleXY(f, my_srfObject->GetWidth(), my_srfObject->GetHeight());
--- 195,212 ----
        // screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 
screen->format->BitsPerPixel, screen->flags);
        fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!       if (mps != NULL) {
!       hash.erase(currentscreen);
!       delete mps;
!       mps = 
PG_Application::GetDrawingEnvironment()->CreateDrawableSurface(my_srfObject->GetWidth(),
 my_srfObject->GetHeight());
!       hash[mps->SDL()] = this;
!       currentscreen = mps->SDL();
!       SMPEG_setdisplay(f, mps->SDL(), NULL, cb);
!       } else if (my_srfObject->SDL() != currentscreen) {
!       fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
!       hash.erase(currentscreen);
!       currentscreen = my_srfObject->SDL();
!       hash[my_srfObject->SDL()] = this;
!       SMPEG_setdisplay(f, my_srfObject->SDL(), NULL, cb);
!       };
        fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        SMPEG_scaleXY(f, my_srfObject->GetWidth(), my_srfObject->GetHeight());
***************
*** 197,199 ****
--- 216,240 ----
      };
    return rv;
+ };
+ 
+ /* PG_Draw::PG_DrawableSurface* mps; */ /* mpeg surface */
+ void PG_MPEGPlayer::eventDraw(PG_Draw::PG_DrawableSurface* surface, const 
PG_Rect& rect) {
+ };
+ 
+ void PG_MPEGPlayer::eventBlit(PG_Draw::PG_DrawableSurface* srf, const 
PG_Rect& src, const PG_Rect& dst) {
+       if(mps == NULL) {
+               PG_Widget::eventBlit(srf,src,dst);
+       }
+       /* mps-> how dow I download again? */
+ 
+       // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
+ #if 1
+       PG_Rect my_src;
+       PG_Rect my_dst;
+       
+       GetClipRects(my_src, my_dst, *this);
+       PG_Widget::eventBlit(mps, my_src, my_dst);
+ #else
+       PG_Widget::eventBlit(mps, src, dst);
+ #endif
  };

Index: pgmpeg2.hh
===================================================================
RCS file: /cvsroot/paragui/paragui/plugins/mpeg/Attic/pgmpeg2.hh,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** pgmpeg2.hh  4 Nov 2002 11:12:50 -0000       1.1.2.1
--- pgmpeg2.hh  3 Feb 2003 16:39:59 -0000       1.1.2.2
***************
*** 164,167 ****
--- 164,174 ----
          virtual void frameupdate();
  
+         PG_Draw::PG_DrawableSurface* mps; /* mpeg surface */
+       /** */
+       void eventDraw(PG_Draw::PG_DrawableSurface* surface, const PG_Rect& 
rect);
+ 
+       /** */
+       void eventBlit(PG_Draw::PG_DrawableSurface* srf, const PG_Rect& src, 
const PG_Rect& dst);
+ 
  private:
          static std::map<SDL_Surface*, PG_MPEGPlayer *> hash;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]