]> git.sesse.net Git - vlc/blob - modules/video_filter/atmo/AtmoExternalCaptureInput.h
Merge branch 'master' of git://git.videolan.org/vlc
[vlc] / modules / video_filter / atmo / AtmoExternalCaptureInput.h
1 #ifndef _AtmoExternalCaptureInput_h_
2 #define _AtmoExternalCaptureInput_h_
3
4 #include "AtmoDefs.h"
5
6 #if defined(WIN32)
7 #   include <windows.h>
8 # else
9 #   if defined(_ATMO_VLC_PLUGIN_)
10        // need bitmap info header
11 #      include <vlc_codecs.h>
12 #   endif
13 #endif
14
15 #if defined(_ATMO_VLC_PLUGIN_)
16 #  include <vlc_common.h>
17 #  include <vlc_threads.h>
18 #endif
19
20 #include "AtmoInput.h"
21 #include "AtmoThread.h"
22 #include "AtmoConfig.h"
23 #include "AtmoDynData.h"
24 #include "AtmoCalculations.h"
25
26
27 class CAtmoExternalCaptureInput :  public CAtmoInput
28 {
29 protected:
30 #if defined(_ATMO_VLC_PLUGIN_)
31     vlc_cond_t   m_WakeupCond;
32     vlc_mutex_t  m_WakeupLock;
33 #else
34     HANDLE m_hWakeupEvent;
35     CRITICAL_SECTION m_BufferLock;
36 #endif
37
38     BITMAPINFOHEADER m_CurrentFrameHeader;
39     void *m_pCurrentFramePixels;
40
41     virtual DWORD Execute(void);
42     void CalcColors();
43
44 public:
45     /*
46        this method is called from the com server AtmoLiveViewControlImpl!
47        or inside videolan from the filter method to start a new processing
48     */
49     void DeliverNewSourceDataPaket(BITMAPINFOHEADER *bmpInfoHeader,void *pixelData);
50
51 public:
52     CAtmoExternalCaptureInput(CAtmoDynData *pAtmoDynData);
53     virtual ~CAtmoExternalCaptureInput(void);
54
55     /*
56        Opens the input-device. Parameters (e.g. the device-name)
57        Returns true if the input-device was opened successfully.
58        input-device can be the GDI surface of screen (windows only)
59        or the videolan filter
60     */
61     virtual ATMO_BOOL Open(void);
62
63     /*
64      Closes the input-device.
65      Returns true if the input-device was closed successfully.
66     */
67     virtual ATMO_BOOL Close(void);
68
69 };
70
71 #endif