]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoThread.h
vdpau: eliminate dead code
[vlc] / modules / video_filter / atmo / AtmoThread.h
1 /*
2  * AtmoThread.h: Base thread class for all threads inside AtmoWin
3  *
4  *
5  * See the README.txt file for copyright information and how to reach the author(s).
6  *
7  * $Id$
8  */
9 #ifndef _AtmoThread_h_
10 #define _AtmoThread_h_
11
12 #include "AtmoDefs.h"
13
14 #if defined(_ATMO_VLC_PLUGIN_)
15 // use threading stuff from videolan!
16 #   include <vlc_common.h>
17 #   include <vlc_threads.h>
18 #else
19 #   include <windows.h>
20 #endif
21
22 class CThread
23 {
24 protected:
25
26 #if defined(_ATMO_VLC_PLUGIN_)
27
28     vlc_mutex_t  m_TerminateLock;
29     vlc_cond_t   m_TerminateCond;
30     vlc_object_t *m_pOwner;
31     ATMO_BOOL    m_HasThread;
32     vlc_thread_t m_Thread;
33
34 #else
35
36     HANDLE m_hThread;
37         DWORD m_dwThreadID;
38         HANDLE m_hTerminateEvent;
39
40 #endif
41
42     volatile ATMO_BOOL m_bTerminated;
43
44 private:
45
46 #if defined(_ATMO_VLC_PLUGIN_)
47     static void *ThreadProc(void *);
48 #else
49         static DWORD WINAPI ThreadProc(LPVOID lpParameter);
50 #endif
51
52 protected:
53         virtual DWORD Execute(void);
54         ATMO_BOOL ThreadSleep(DWORD millisekunden);
55
56 public:
57 #if defined(_ATMO_VLC_PLUGIN_)
58         CThread(vlc_object_t *pOwner);
59 #else
60         CThread(void);
61 #endif
62
63     virtual ~CThread(void);
64
65     void Terminate(void);
66     void Run();
67
68 };
69
70 #endif
71