Debian Codegraph @

lib/video/rendlock.h

raw
1 #ifndef RENDLOCK_H
2 #define RENDLOCK_H
3
4 #include "avm_locker.h"
5 #include "avm_cpuinfo.h"
6 #include "renderer.h"
7 #include "playerwidget.h"
8 #include "utils.h"
9
10 AVM_BEGIN_NAMESPACE;
11
12 // use our internal class for our renderers;
13 class VideoRendererWithLock : public IVideoRenderer
14 {
15 public:
16 VideoRendererWithLock(int width, int height, bool _subtitles = false)
17 :m_w(width), m_h(height), pic_w(width), pic_h(height),
18 m_sub(0), m_iFontHeight(0), m_lLastDrawStamp(0), m_pPw(0),
19 m_iAuto(1), m_bQuit(false), m_bSubtitles(_subtitles)
20 {}
21 virtual ~VideoRendererWithLock();
22 virtual int Lock() const { return m_Mutex.Lock(); }
23 virtual int TryLock() const { return m_Mutex.TryLock(); }
24 virtual int Unlock() const { return m_Mutex.Unlock(); }
25 virtual const avm::vector<VideoMode>& GetVideoModes() const { return modes; }
26 virtual int GetSize(int& width, int& height) const
27 {
28 width = pic_w;
29 height = pic_h;
30 return 0;
31 }
32 virtual int processEvent() = 0;
33 protected:
34 virtual int init() { return 0; }
35 static void* eventThread(void *arg);
36 mutable PthreadMutex m_Mutex;
37 int m_w, m_h;
38 int pic_w, pic_h;
39 unsigned int m_sub;
40 int m_iFontHeight;
41 PthreadMutex emutex;
42 PthreadCond econd;
43 int64_t m_lLastDrawStamp;
44 avm::vector<VideoMode> modes;
45 PlayerWidget* m_pPw;
46 int m_iAuto; // keyboard autorepeat
47 bool m_bQuit;
48 bool m_bSubtitles;
49 };
50
51 AVM_END_NAMESPACE;
52
53 #endif