diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/vid_gdi+.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Winamp/vid_gdi+.h')
-rw-r--r-- | Src/Winamp/vid_gdi+.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Src/Winamp/vid_gdi+.h b/Src/Winamp/vid_gdi+.h new file mode 100644 index 00000000..449f87c3 --- /dev/null +++ b/Src/Winamp/vid_gdi+.h @@ -0,0 +1,44 @@ +#ifndef _VID_GDIPLUS_H_ +#define _VID_GDIPLUS_H_ + +#include <windows.h> +#include <gdiplus.h> +#include "VideoOutputChild.h" + +using namespace Gdiplus; + +class GDIPVideoOutput : public VideoRenderer { +public: + GDIPVideoOutput(); + virtual ~GDIPVideoOutput(); + virtual int create(HWND parent, VideoAspectAdjuster *_adjuster, int w, int h, unsigned int type, int flipit, double aspectratio); //return 1 if ok + virtual int needChange(); //return 1 if need to renegociate video output + virtual int onPaint(HWND hwnd) { return 0; } //return 1 if override + virtual void displayFrame(const char *buf, int size, int time); + virtual void close(); // hides any output of the video + virtual void timerCallback(); + virtual void drawSubtitle(SubsItem *item) { subs=item; } + virtual void resetSubtitle() { subs=NULL; } + virtual void setVFlip(int on) { flip=on; } + virtual void Refresh(); + +protected: + bool FillFrame(Bitmap *frame, void *buf); + + unsigned int type, w, h, flip, winw, winh; + Graphics * graphics; // on screen canvas + Graphics * graphicsback; // off screen canvas + Bitmap * frame; + HWND parent; + int needschange; + VideoAspectAdjuster *adjuster; + RECT lastrect; + HDC backdc; + void SetupGraphics(); + ULONG_PTR gdiplusToken; + SubsItem *subs; +}; + +extern GDIPVideoOutput gdiplusVideo; + +#endif // _VID_GDIPLUS_H_ |