1
0

vid_ddraw.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _VIDEO_DDRAW_H
  2. #define _VIDEO_DDRAW_H
  3. #include <ddraw.h>
  4. #include "VideoOutputChildDDraw.h"
  5. class SubsItem;
  6. class DDrawVideoOutput : public VideoOutputChildDDraw
  7. {
  8. public:
  9. DDrawVideoOutput();
  10. virtual ~DDrawVideoOutput();
  11. int create(HWND parent, VideoAspectAdjuster *_adjuster, int w, int h, unsigned int ptype, int flipit, double aspectratio);
  12. int needChange() { return needchange; }
  13. int onPaint(HWND hwnd);
  14. void displayFrame(const char *buf, int size, int time);
  15. void timerCallback();
  16. void setPalette(RGBQUAD *pal) { m_palette = pal; }
  17. void drawSubtitle(SubsItem *item);
  18. void resetSubtitle();
  19. void setVFlip(int on) { flip = on; }
  20. void Refresh();
  21. void close();
  22. private:
  23. bool LockSurface(DDSURFACEDESC *dd);
  24. bool Paint(HWND hwnd);
  25. int width, height, flip;
  26. int needchange;
  27. unsigned int type;
  28. LPDIRECTDRAW lpDD;
  29. LPDIRECTDRAWSURFACE lpddsOverlay, lpddsPrimary, lpddsSTTemp;
  30. int sttmp_w, sttmp_h;
  31. DDCAPS capsDrv;
  32. unsigned int uDestSizeAlign, uSrcSizeAlign;
  33. DWORD dwUpdateFlags;
  34. RECT rs, rd;
  35. RECT lastresizerect;
  36. bool initing;
  37. LPDIRECTDRAWCLIPPER lpddsClipper;
  38. DDPIXELFORMAT m_ddpf;
  39. int m_depth;
  40. RGBQUAD *m_palette;
  41. HFONT subFont;
  42. RECT subRect;
  43. SubsItem *m_lastsubtitle;
  44. int m_sub_needremeasure;
  45. RECT winRect;
  46. int m_fontsize;
  47. RECT m_monRect;
  48. };
  49. extern DDrawVideoOutput ddrawVideo;
  50. #endif