aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/vid_gdi+.h
blob: 449f87c3c92eb553fb34bc197a34b71b1516d3c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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_