Extrenal srt problem gst-1 solved.
[openblackhole/openblackhole-enigma2.git] / lib / gdi / accel.h
1 #ifndef __lib_gdi_accel_h
2 #define __lib_gdi_accel_h
3
4 #include <base/elock.h>
5 #include <list>
6
7 struct gUnmanagedSurface;
8 class eRect;
9 class ePoint;
10
11 class gAccel
12 {
13 public:
14         static gAccel* getInstance() { return instance; }
15         gAccel();
16         ~gAccel();
17
18         void releaseAccelMemorySpace();
19         void setAccelMemorySpace(void *addr, int phys_addr, int size);
20
21         bool hasAlphaBlendingSupport();
22         int blit(gUnmanagedSurface *dst, gUnmanagedSurface *src, const eRect &p, const eRect &area, int flags);
23         int fill(gUnmanagedSurface *dst, const eRect &area, unsigned long col);
24
25         int accelAlloc(gUnmanagedSurface* surface);
26         void accelFree(gUnmanagedSurface* surface);
27
28         void dumpDebug();
29 private:
30         struct MemoryBlock {
31                 gUnmanagedSurface *surface;
32                 int index;
33                 int size;
34
35                 MemoryBlock(gUnmanagedSurface *o, int i, int s):
36                         surface(o), index(i), size(s)
37                 {}
38                 MemoryBlock():
39                         surface(0), index(0), size(0)
40                 {}
41         };
42         typedef std::list<MemoryBlock> MemoryBlockList;
43
44         eSingleLock m_allocation_lock;
45         void *m_accel_addr;
46         int m_accel_phys_addr;
47         int m_accel_size; // in blocks
48         MemoryBlockList m_accel_allocation;
49         int m_bcm_accel_state;
50
51         static gAccel *instance;
52 };
53
54 #endif