summaryrefslogtreecommitdiff
path: root/client/xvaccelrenderer.h
blob: 588516fd99f60d61e827fb018f07e4372f1ecd1d (plain)
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
45
46
47
48
49
50
51
/* -*- mode: c++ -*- */
#ifndef __XVACCELRENDERER_H__
#define  __XVACCELRENDERER_H__

#include <assert.h>

#include <QWidget>

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XShm.h>
#include <errno.h>

//typedef unsigned long int QWidget;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;

#define ADM_assert(x) assert(x)

class XvAccelRender
{
public:
	XvAccelRender();
	uint8_t init(QWidget *window, uint32_t w, uint32_t h);
	uint8_t end(void);				
	uint8_t display(uint8_t *ptr, uint32_t w, uint32_t h);

	unsigned int width, height;

private:
	unsigned int xv_port;
	uint32_t xv_format;
	Display *xv_display;
	XvImage *xvimage;
	GC xv_gc;
	XGCValues xv_xgc;
	Window xv_win;
	XShmSegmentInfo Shminfo;

	uint8_t GUI_XvList(Display *dis, uint32_t port, uint32_t * fmt);
	uint8_t GUI_XvInit(QWidget *window, uint32_t w, uint32_t h);
	void GUI_XvEnd();
	uint8_t GUI_XvDisplay(uint8_t * src, uint32_t w, uint32_t h);
};

#endif/*__XVACCELRENDERER_H__*/