]> git.vomp.tv Git - vompclient.git/commitdiff
*** empty log message ***
authorChris Tallon <chris@vomp.tv>
Wed, 14 Jun 2006 21:39:47 +0000 (21:39 +0000)
committerChris Tallon <chris@vomp.tv>
Wed, 14 Jun 2006 21:39:47 +0000 (21:39 +0000)
player.cc
player.h
surface.cc
surface.h
surfacewin.cc
surfacewin.h

index 88331ab5da04e2537d87727b9e381b7242303af1..ad515497a3df366c3f4999cf3f3f6276d50ca3f8 100644 (file)
--- a/player.cc
+++ b/player.cc
@@ -285,8 +285,11 @@ int Player::playInt(bool* doUnlock)
   audio->reset();
   video->reset();
   demuxer->reset();
-  if (startFrameNum > lengthFrames) startFrameNum = 0;
-  demuxer->setFrameNum(startFrameNum);
+  if (isRecording)
+  {
+    if (startFrameNum > lengthFrames) startFrameNum = 0;
+    demuxer->setFrameNum(startFrameNum);
+  }
   if (!isRadio) demuxer->seek();
 
   videoStartup = true;
@@ -491,6 +494,7 @@ void Player::unLock()
 #endif
 }
 
+/*
 void Player::restartAt(ULLONG timecode)
 {
   if (paused) togglePauseInt();
@@ -522,6 +526,7 @@ void Player::restartAt(ULLONG timecode)
   audio->doMuting();
   fbwd = false;
 }
+*/
 
 void Player::restartAtFrame(ULONG newFrame)
 {
index 4d8a25e813d04675f89b20350f4164557ef3be11..92d3efaf5679317ca43ee9146684744c6bd51ebe 100644 (file)
--- a/player.h
+++ b/player.h
@@ -92,7 +92,7 @@ class Player : public Thread_TYPE, public Callback
 
     void setEndTS();
     void doConnectionLost();
-    void restartAt(ULLONG timeCode);
+//    void restartAt(ULLONG timeCode);
     void restartAtFrame(ULONG newFrame);
 
     MessageQueue* commandMessageQueue;
index 04c1d5acb1d62557c82fdf90919c8321ad5f7a24..8a4c42bae398e039a5c75c69b4a20af2d76885f4 100644 (file)
@@ -1,6 +1,5 @@
 /*
     Copyright 2004-2005 Chris Tallon
-    Portions copyright 2004 Jon Gettler
 
     This file is part of VOMP.
 
index 66fb5febfa73f9c3a50dcbb2894974628c3fa816..557f630ea3a095a9af34fdf83d730bc03a71930d 100644 (file)
--- a/surface.h
+++ b/surface.h
@@ -1,6 +1,5 @@
 /*
     Copyright 2004-2005 Chris Tallon
-    Portions copyright 2004 Jon Gettler
 
     This file is part of VOMP.
 
index 8cc3fbb29f593f057bbf1d3bdeb8366e24102c96..0cb251e99108f6cbe043978a72f1fc33bbc3fc2b 100644 (file)
@@ -1,6 +1,5 @@
 /*\r
-    Copyright 2004-2005 Chris Tallon\r
-    Portions copyright 2004 Jon Gettler\r
+    Copyright 2006 Marten Richter\r
 \r
     This file is part of VOMP.\r
 \r
 SurfaceWin::SurfaceWin(int id)\r
 : Surface(id)\r
 {\r
-       d3dtexture=NULL;\r
-       d3dsurface=NULL;\r
-       sheight=swidth=0;\r
-       event = CreateEvent(NULL,/*FALSE*/TRUE,FALSE,NULL);\r
+  d3dtexture=NULL;\r
+  d3dsurface=NULL;\r
+  sheight=swidth=0;\r
+  event = CreateEvent(NULL,/*FALSE*/TRUE,FALSE,NULL);\r
 }\r
 \r
 SurfaceWin::~SurfaceWin()\r
 {\r
-       if (d3dsurface) d3dsurface->Release();\r
-       if (d3dtexture) d3dtexture->Release();\r
-       CloseHandle(event);\r
+  if (d3dsurface) d3dsurface->Release();\r
+  if (d3dtexture) d3dtexture->Release();\r
+  CloseHandle(event);\r
 }\r
 \r
 int SurfaceWin::create(UINT width, UINT height)\r
 {\r
-       LPDIRECT3DDEVICE9 d3ddev=((OsdWin*)(Osd::getInstance()))->getD3dDev();\r
-       while (true) {\r
-               if (screen==this) {\r
-                       if (d3ddev->CreateTexture(1024,1024,0,0,D3DFMT_A8R8G8B8,\r
-                               // Does every adapter with alpha blending support this?\r
-                               D3DPOOL_DEFAULT,&d3dtexture ,NULL)!=D3D_OK) {\r
-                                       MILLISLEEP(50);//wait maybe next time it will work\r
-                                       continue;\r
-                       }\r
-                       if (d3dtexture->GetSurfaceLevel(0,&d3dsurface)!=D3D_OK) {\r
-                               d3dtexture->Release();\r
-                               d3dtexture=NULL;\r
-                               MILLISLEEP(50);\r
-                               continue;\r
-                       }\r
-               } else {\r
-                       HRESULT hres;\r
-                       if (hres=d3ddev->CreateOffscreenPlainSurface(width,height,D3DFMT_A8R8G8B8,\r
-                               D3DPOOL_SYSTEMMEM,&d3dsurface,NULL)!=D3D_OK) {\r
-                                       MILLISLEEP(50);//wait maybe next time it will work\r
-                                       continue;\r
-                       }\r
-\r
-               }\r
-               sheight=height;\r
-               swidth=width;\r
-               /* If someone does high performance Animations on the OSD, we have to change the types\r
-          of surface in order to address these performance issues, if we have only very few updates \r
-          per second this would be fast enough !*/\r
-               break;\r
-       }\r
-       SetEvent(event);\r
-       return 1;\r
+  LPDIRECT3DDEVICE9 d3ddev=((OsdWin*)(Osd::getInstance()))->getD3dDev();\r
+  while (true) {\r
+    if (screen==this) {\r
+      if (d3ddev->CreateTexture(1024,1024,0,0,D3DFMT_A8R8G8B8,\r
+        // Does every adapter with alpha blending support this?\r
+        D3DPOOL_DEFAULT,&d3dtexture ,NULL)!=D3D_OK) {\r
+          MILLISLEEP(50);//wait maybe next time it will work\r
+          continue;\r
+      }\r
+      if (d3dtexture->GetSurfaceLevel(0,&d3dsurface)!=D3D_OK) {\r
+        d3dtexture->Release();\r
+        d3dtexture=NULL;\r
+        MILLISLEEP(50);\r
+        continue;\r
+      }\r
+    } else {\r
+      HRESULT hres;\r
+      if (hres=d3ddev->CreateOffscreenPlainSurface(width,height,D3DFMT_A8R8G8B8,\r
+        D3DPOOL_SYSTEMMEM,&d3dsurface,NULL)!=D3D_OK) {\r
+          MILLISLEEP(50);//wait maybe next time it will work\r
+          continue;\r
+      }\r
+\r
+    }\r
+    sheight=height;\r
+    swidth=width;\r
+    /* If someone does high performance Animations on the OSD, we have to change the types\r
+     of surface in order to address these performance issues, if we have only very few updates\r
+     per second this would be fast enough !*/\r
+    break;\r
+  }\r
+  SetEvent(event);\r
+  return 1;\r
 }\r
 \r
 void SurfaceWin::display()\r
@@ -85,44 +84,44 @@ int SurfaceWin::fillblt(int x, int y, int width, int height, unsigned int c)
   WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
   //allocation we will wait in this case, hopefully without deadlocks\r
   OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
\r
+\r
   if (!d3dsurface) {\r
-               return 0; //why does this happen\r
+    return 0; //why does this happen\r
   }\r
 \r
   LPDIRECT3DDEVICE9 d3ddev=osd->getD3dDev();\r
-  \r
+\r
   if (screen==this) {\r
-         //This should not happen!\r
-         return 0;\r
+    //This should not happen!\r
+    return 0;\r
 \r
   } else {\r
-         osd->BeginPainting();\r
-         D3DLOCKED_RECT lockrect;\r
-         int cx,cy,cwidth,cheight;\r
-         cx=min(max(x,0),swidth);\r
-         cy=min(max(y,0),sheight);\r
-         cwidth=min(width,swidth-x);\r
-         cheight=min(height,sheight-y);\r
-         RECT rect={cx,cy,cwidth,cheight};\r
-         \r
-         if (d3dsurface->LockRect(&lockrect,&rect,D3DLOCK_DISCARD)!=D3D_OK) {\r
-                 return 0;\r
-         }\r
-         unsigned int line;\r
-         unsigned int column;\r
-         for (line=0;line<cheight;line++) {\r
-                 unsigned int*row=((unsigned int*)(((char*)lockrect.pBits)+lockrect.Pitch*line));\r
-                 for (column=0;column<cwidth;column++) {\r
-                         row[column]=c;\r
-                 }\r
-         }\r
-\r
-         if (d3dsurface->UnlockRect()!=D3D_OK) {\r
-                 osd->EndPainting();\r
-                 return 0;\r
-         }\r
-         osd->EndPainting();\r
+    osd->BeginPainting();\r
+    D3DLOCKED_RECT lockrect;\r
+    int cx,cy,cwidth,cheight;\r
+    cx=min(max(x,0),swidth);\r
+    cy=min(max(y,0),sheight);\r
+    cwidth=min(width,swidth-x);\r
+    cheight=min(height,sheight-y);\r
+    RECT rect={cx,cy,cwidth,cheight};\r
+\r
+    if (d3dsurface->LockRect(&lockrect,&rect,D3DLOCK_DISCARD)!=D3D_OK) {\r
+      return 0;\r
+    }\r
+    unsigned int line;\r
+    unsigned int column;\r
+    for (line=0;line<cheight;line++) {\r
+      unsigned int*row=((unsigned int*)(((char*)lockrect.pBits)+lockrect.Pitch*line));\r
+      for (column=0;column<cwidth;column++) {\r
+        row[column]=c;\r
+      }\r
+    }\r
+\r
+    if (d3dsurface->UnlockRect()!=D3D_OK) {\r
+      osd->EndPainting();\r
+      return 0;\r
+    }\r
+    osd->EndPainting();\r
   }\r
 \r
   return 0;\r
@@ -134,65 +133,65 @@ void SurfaceWin::drawPixel(int x, int y, unsigned int c)
   WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
   //allocation we will wait in this case, hopefully without deadlocks\r
   if (!d3dsurface) {\r
-               return; //why does this happen\r
+    return; //why does this happen\r
   }\r
   OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
   LPDIRECT3DDEVICE9 d3ddev=osd->getD3dDev();\r
   if (x>swidth || y>sheight) return; //do not draw outside the surface\r
   if (screen==this) {\r
-         //This should not happen!\r
-         return ;\r
+    //This should not happen!\r
+    return ;\r
 \r
   } else {\r
-         osd->BeginPainting();\r
-         D3DLOCKED_RECT lockrect;\r
-         RECT rect={x,y,x+1,y+1};\r
-         if (d3dsurface->LockRect(&lockrect,&rect,D3DLOCK_DISCARD)!=D3D_OK) {\r
-                 osd->EndPainting();\r
-                 return ;\r
-         }\r
-         unsigned int*row=(unsigned int*)(((char*)lockrect.pBits));\r
-         row[0]=c;\r
-         if (d3dsurface->UnlockRect()!=D3D_OK) {\r
-                 osd->EndPainting();\r
-                 return ;\r
-         }\r
-         osd->EndPainting();\r
+    osd->BeginPainting();\r
+    D3DLOCKED_RECT lockrect;\r
+    RECT rect={x,y,x+1,y+1};\r
+    if (d3dsurface->LockRect(&lockrect,&rect,D3DLOCK_DISCARD)!=D3D_OK) {\r
+      osd->EndPainting();\r
+      return ;\r
+    }\r
+    unsigned int*row=(unsigned int*)(((char*)lockrect.pBits));\r
+    row[0]=c;\r
+    if (d3dsurface->UnlockRect()!=D3D_OK) {\r
+      osd->EndPainting();\r
+      return ;\r
+    }\r
+    osd->EndPainting();\r
   }\r
 \r
 }\r
 \r
 void SurfaceWin::drawHorzLine(int x1, int x2, int y, unsigned int c)\r
 {\r
-        fillblt(x1, y, x2-x1, 1, c);\r
+   fillblt(x1, y, x2-x1, 1, c);\r
 }\r
 \r
 void SurfaceWin::drawVertLine(int x, int y1, int y2, unsigned int c)\r
 {\r
-       fillblt(x, y1, 1, y2-y1, c);\r
+  fillblt(x, y1, 1, y2-y1, c);\r
 }\r
 \r
 int SurfaceWin::updateToScreen(int sx, int sy, int w, int h, int dx, int dy) // FIXME new, replace others with this FIXME\r
 {\r
-       WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
+  WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
   //allocation we will wait in this case, hopefully without deadlocks\r
-       if (!d3dsurface) {\r
-               return 0; //why does this happen\r
-       }\r
-       OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
-       LPDIRECT3DDEVICE9 d3ddev=osd->getD3dDev();\r
+  if (!d3dsurface) {\r
+    return 0; //why does this happen\r
+  }\r
+  OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
+  LPDIRECT3DDEVICE9 d3ddev=osd->getD3dDev();\r
     LPDIRECT3DSURFACE9 screensurface=((SurfaceWin*)screen)->getD3dsurface();\r
-       if (!screensurface) return 0;\r
-       RECT sourcerect={sx,sy,sx+w,sy+h};\r
-       POINT destpoint={dx,dy};\r
-       osd->BeginPainting();\r
-       if (d3ddev->UpdateSurface(d3dsurface,&sourcerect,screensurface,&destpoint)!=D3D_OK) {\r
-               Log::getInstance()->log("Surface", Log::DEBUG, "Could not update to Screen!");\r
-               osd->EndPainting();\r
-               return 0;\r
-       }\r
-       osd->EndPainting();\r
-       return 0;\r
+  if (!screensurface) return 0;\r
+  RECT sourcerect={sx,sy,sx+w,sy+h};\r
+  POINT destpoint={dx,dy};\r
+  osd->BeginPainting();\r
+  if (d3ddev->UpdateSurface(d3dsurface,&sourcerect,screensurface,&destpoint)!=D3D_OK) {\r
+    Log::getInstance()->log("Surface", Log::DEBUG, "Could not update to Screen!");\r
+    osd->EndPainting();\r
+    return 0;\r
+  }\r
+  osd->EndPainting();\r
+  return 0;\r
 }\r
 \r
 int SurfaceWin::blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy)\r
@@ -203,68 +202,68 @@ int SurfaceWin::blt(int fd, unsigned long shandle, int sx, int sy, int width, in
 \r
 void SurfaceWin::screenShot(char* fileName)\r
 {\r
-       //Isn't this for debugging only, so I won't implement it yet\r
+  //Isn't this for debugging only, so I won't implement it yet\r
 }\r
 \r
 void SurfaceWin::readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b)\r
 {\r
-       //Isn't this for debugging only, so I won't implement it yet\r
+  //Isn't this for debugging only, so I won't implement it yet\r
 }\r
 void SurfaceWin::ReleaseSurface()\r
 {\r
-       ResetEvent(event);\r
-       LPDIRECT3DSURFACE9 temp_surf=d3dsurface;\r
-       LPDIRECT3DTEXTURE9 temp_text=d3dtexture;\r
-       d3dsurface=NULL;\r
-       d3dtexture=NULL;\r
-       sheight=swidth=0;\r
-       if (temp_surf) temp_surf->Release();\r
-       if (temp_text) temp_text->Release();\r
+  ResetEvent(event);\r
+  LPDIRECT3DSURFACE9 temp_surf=d3dsurface;\r
+  LPDIRECT3DTEXTURE9 temp_text=d3dtexture;\r
+  d3dsurface=NULL;\r
+  d3dtexture=NULL;\r
+  sheight=swidth=0;\r
+  if (temp_surf) temp_surf->Release();\r
+  if (temp_text) temp_text->Release();\r
 }\r
 \r
 void SurfaceWin::drawJpeg(char *fileName,DWORD x, DWORD y,DWORD *width, DWORD *height){\r
-       WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
+  WaitForSingleObject(event,INFINITE); //since this might be called before surface\r
   //allocation we will wait in this case, hopefully without deadlocks\r
-       if (!d3dsurface) {\r
-               return ; //why does this happen\r
-       }\r
-       OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
-\r
-       \r
-       D3DXIMAGE_INFO image_inf;\r
-       osd->BeginPainting();\r
-//     D3DXGetImageInfoFromFile(fileName,&image_inf);\r
-       D3DXGetImageInfoFromResource(NULL,fileName,&image_inf);\r
-       RECT dest_rec={x,y,x+image_inf.Width,\r
-               y+image_inf.Height};\r
-/*     if (D3DXLoadSurfaceFromFile(\r
-               d3dsurface,\r
-               NULL,\r
-               &dest_rec,\r
-               fileName,\r
-               NULL,\r
-               D3DX_FILTER_NONE,\r
-               0,\r
-               &image_inf)!=D3D_OK) {\r
-                       Log::getInstance()->log("Surface", Log::DEBUG, "Could not open jpeg!");\r
-                       \r
-       }*/\r
-       if (D3DXLoadSurfaceFromResource(\r
-               d3dsurface,\r
-               NULL,\r
-               &dest_rec,\r
-               NULL,\r
-               fileName,\r
-               NULL,\r
-               D3DX_FILTER_NONE,\r
-               0,\r
-               &image_inf)!=D3D_OK) {\r
-                       Log::getInstance()->log("Surface", Log::DEBUG, "Could not open jpeg!");\r
-                       \r
-       }\r
-       osd->EndPainting();\r
-       *width=image_inf.Width;\r
-       *height=image_inf.Height;\r
-        \r
+  if (!d3dsurface) {\r
+    return ; //why does this happen\r
+  }\r
+  OsdWin* osd=((OsdWin*)(Osd::getInstance()));\r
+\r
+\r
+  D3DXIMAGE_INFO image_inf;\r
+  osd->BeginPainting();\r
+//  D3DXGetImageInfoFromFile(fileName,&image_inf);\r
+  D3DXGetImageInfoFromResource(NULL,fileName,&image_inf);\r
+  RECT dest_rec={x,y,x+image_inf.Width,\r
+    y+image_inf.Height};\r
+/*  if (D3DXLoadSurfaceFromFile(\r
+    d3dsurface,\r
+    NULL,\r
+    &dest_rec,\r
+    fileName,\r
+    NULL,\r
+    D3DX_FILTER_NONE,\r
+    0,\r
+    &image_inf)!=D3D_OK) {\r
+      Log::getInstance()->log("Surface", Log::DEBUG, "Could not open jpeg!");\r
+\r
+  }*/\r
+  if (D3DXLoadSurfaceFromResource(\r
+    d3dsurface,\r
+    NULL,\r
+    &dest_rec,\r
+    NULL,\r
+    fileName,\r
+    NULL,\r
+    D3DX_FILTER_NONE,\r
+    0,\r
+    &image_inf)!=D3D_OK) {\r
+      Log::getInstance()->log("Surface", Log::DEBUG, "Could not open jpeg!");\r
+\r
+  }\r
+  osd->EndPainting();\r
+  *width=image_inf.Width;\r
+  *height=image_inf.Height;\r
+\r
 }\r
 \r
index 104aec6d89abc1c9f5e84a8c53e8e9c5ee60bc55..6409103b7f71807e363964ae3c8a970d39e46da9 100644 (file)
@@ -1,6 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
-    Portions copyright 2004 Jon Gettler
+    Copyright 2006 Marten Richter
 
     This file is part of VOMP.