1
0

vid_overlay.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef NULLSOFT_VIDEO_OVERLAY_H
  2. #define NULLSOFT_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() { if (parent) InvalidateRect(parent, NULL, TRUE); }
  21. void SetFrame(void *_frame) { frame = _frame; }
  22. private:
  23. void *frame;
  24. int width, height, flip;
  25. int m_closed;
  26. int needchange;
  27. unsigned int type;
  28. LPDIRECTDRAW lpDD;
  29. LPDIRECTDRAWSURFACE lpddsOverlay, lpddsPrimary;
  30. LPDIRECTDRAWSURFACE lpBackBuffer;
  31. DDCAPS capsDrv;
  32. unsigned int uDestSizeAlign, uSrcSizeAlign;
  33. DWORD dwUpdateFlags;
  34. DDOVERLAYFX ovfx;
  35. RECT rs,rd;
  36. RECT m_oldrd;
  37. RECT winRect;
  38. int overlay_color;
  39. bool initing;
  40. int yuy2_output, uyvy_output;
  41. void getRects(RECT *drs, RECT *drd, int fixmultimon=1) const;
  42. int m_fontsize;
  43. };
  44. extern OverlayVideoOutput overlay;
  45. #endif