vid_overlay.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _VIDEO_OVERLAY_H
  2. #define _VIDEO_OVERLAY_H
  3. #include <ddraw.h>
  4. #include <multimon.h>
  5. #include "VideoOutputChildDDraw.h"
  6. class SubsItem;
  7. class OverlayVideoOutput : public VideoOutputChildDDraw {
  8. public:
  9. OverlayVideoOutput();
  10. virtual ~OverlayVideoOutput();
  11. int create(HWND parent,VideoAspectAdjuster *_adjuster, int w, int h, unsigned int type, int flipit, double aspectratio); //return 1 if ok
  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 close();
  17. void drawSubtitle(SubsItem *item);
  18. void resetSubtitle();
  19. void setVFlip(int on) { flip=on; }
  20. void Refresh() { InvalidateRect(parent, NULL, TRUE); }
  21. private:
  22. bool LockSurface(DDSURFACEDESC *dd);
  23. int width, height, flip;
  24. int m_closed;
  25. int needchange;
  26. unsigned int type;
  27. LPDIRECTDRAW lpDD;
  28. LPDIRECTDRAWSURFACE lpddsOverlay, lpddsPrimary;
  29. LPDIRECTDRAWSURFACE lpBackBuffer;
  30. DDCAPS capsDrv;
  31. unsigned int uDestSizeAlign, uSrcSizeAlign;
  32. DWORD dwUpdateFlags;
  33. DDOVERLAYFX ovfx;
  34. RECT rs,rd;
  35. RECT m_oldrd;
  36. RECT winRect;
  37. int overlay_color;
  38. bool initing;
  39. int yuy2_output, uyvy_output;
  40. void getRects(RECT *drs, RECT *drd, int fixmultimon=1) const;
  41. HFONT subFont;
  42. RECT subRect;
  43. SubsItem *curSubtitle;
  44. int m_fontsize;
  45. };
  46. extern OverlayVideoOutput overlayVideo;
  47. #endif