]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoDynData.cpp
Sync PO files
[vlc] / modules / video_filter / atmo / AtmoDynData.cpp
1 /*
2  * AtmoDynData.cpp: class for holding all variable data - which may be
3  * passed between function calls, into threads instead of the use
4  * of global variables
5  *
6  * See the README.txt file for copyright information and how to reach the author(s).
7  *
8  * $Id$
9  */
10
11 #include "AtmoDynData.h"
12
13 #if defined(_ATMO_VLC_PLUGIN_)
14 CAtmoDynData::CAtmoDynData(vlc_object_t *p_atmo_filter, CAtmoConfig *pAtmoConfig) {
15     this->p_atmo_filter     = p_atmo_filter;
16     this->m_pAtmoConfig     = pAtmoConfig;
17     this->m_pAtmoConnection = NULL;
18     this->m_pCurrentEffectThread = NULL;
19
20     vlc_mutex_init( &m_lock );
21
22 }
23 #else
24 CAtmoDynData::CAtmoDynData(HINSTANCE hInst, CAtmoConfig *pAtmoConfig, CAtmoDisplays *pAtmoDisplays) {
25     this->m_pAtmoConfig     = pAtmoConfig;
26     this->m_pAtmoDisplays   = pAtmoDisplays;
27     this->m_pAtmoConnection = NULL;
28     this->m_pCurrentEffectThread = NULL;
29     this->m_hInst = hInst;
30     InitializeCriticalSection(&m_RemoteCallCriticalSection);
31 }
32 #endif
33
34 CAtmoDynData::~CAtmoDynData(void)
35 {
36 #if defined(_ATMO_VLC_PLUGIN_)
37     vlc_mutex_destroy( &m_lock );
38 #else
39     DeleteCriticalSection(&m_RemoteCallCriticalSection);
40 #endif
41 }
42
43 void CAtmoDynData::LockCriticalSection() {
44 #if defined(_ATMO_VLC_PLUGIN_)
45     vlc_mutex_lock( &m_lock );
46 #else
47     EnterCriticalSection(&m_RemoteCallCriticalSection);
48 #endif
49 }
50
51 void CAtmoDynData::UnLockCriticalSection() {
52 #if defined(_ATMO_VLC_PLUGIN_)
53     vlc_mutex_unlock( &m_lock );
54 #else
55     LeaveCriticalSection(&m_RemoteCallCriticalSection);
56 #endif
57 }