1
0

vid_gdi+.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _VID_GDIPLUS_H_
  2. #define _VID_GDIPLUS_H_
  3. #include <windows.h>
  4. #include <gdiplus.h>
  5. #include "VideoOutputChild.h"
  6. using namespace Gdiplus;
  7. class GDIPVideoOutput : public VideoRenderer {
  8. public:
  9. GDIPVideoOutput();
  10. virtual ~GDIPVideoOutput();
  11. virtual int create(HWND parent, VideoAspectAdjuster *_adjuster, int w, int h, unsigned int type, int flipit, double aspectratio); //return 1 if ok
  12. virtual int needChange(); //return 1 if need to renegociate video output
  13. virtual int onPaint(HWND hwnd) { return 0; } //return 1 if override
  14. virtual void displayFrame(const char *buf, int size, int time);
  15. virtual void close(); // hides any output of the video
  16. virtual void timerCallback();
  17. virtual void drawSubtitle(SubsItem *item) { subs=item; }
  18. virtual void resetSubtitle() { subs=NULL; }
  19. virtual void setVFlip(int on) { flip=on; }
  20. virtual void Refresh();
  21. protected:
  22. bool FillFrame(Bitmap *frame, void *buf);
  23. unsigned int type, w, h, flip, winw, winh;
  24. Graphics * graphics; // on screen canvas
  25. Graphics * graphicsback; // off screen canvas
  26. Bitmap * frame;
  27. HWND parent;
  28. int needschange;
  29. VideoAspectAdjuster *adjuster;
  30. RECT lastrect;
  31. HDC backdc;
  32. void SetupGraphics();
  33. ULONG_PTR gdiplusToken;
  34. SubsItem *subs;
  35. };
  36. extern GDIPVideoOutput gdiplusVideo;
  37. #endif // _VID_GDIPLUS_H_