]> git.sesse.net Git - kdenlive/blob - src/blackmagic/capture.h
Fix some compilation warnings
[kdenlive] / src / blackmagic / capture.h
1 #ifndef __CAPTURE_H__
2 #define __CAPTURE_H__
3
4 #include "include/DeckLinkAPI.h"
5
6 #include <QWidget>
7 #include <QObject>
8 #include <QLayout>
9
10 class CDeckLinkGLWidget;
11 class PlaybackDelegate;
12
13 class DeckLinkCaptureDelegate : public IDeckLinkInputCallback
14 {
15 public:
16         DeckLinkCaptureDelegate();
17         virtual ~DeckLinkCaptureDelegate();
18
19         virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID /*iid*/, LPVOID */*ppv*/) { return E_NOINTERFACE; }
20         virtual ULONG STDMETHODCALLTYPE AddRef(void);
21         virtual ULONG STDMETHODCALLTYPE  Release(void);
22         virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags);
23         virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);
24
25 private:
26         ULONG                           m_refCount;
27         pthread_mutex_t         m_mutex;
28 };
29
30 class CaptureHandler
31 {
32 public:
33         CaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
34         ~CaptureHandler();
35         CDeckLinkGLWidget *previewView;
36         void startPreview(int deviceId, int captureMode);
37         void stopPreview();
38         void startCapture();
39         void stopCapture();
40         void captureFrame(const QString &fname);
41         void showOverlay(QImage img, bool transparent = true);
42         void hideOverlay();
43         void hidePreview(bool hide);
44         
45 private:
46         IDeckLinkIterator               *deckLinkIterator;
47         DeckLinkCaptureDelegate         *delegate;
48         IDeckLinkDisplayMode            *displayMode;
49         IDeckLink                       *deckLink;
50         IDeckLinkInput                  *deckLinkInput;
51         IDeckLinkDisplayModeIterator    *displayModeIterator;
52         QVBoxLayout *m_layout;
53         QWidget *m_parent;
54 };
55
56
57 #endif