1 #ifndef __BMDCAPTURE_H__
2 #define __BMDCAPTURE_H__
4 #include "include/DeckLinkAPI.h"
5 #include "../stopmotion/capturehandler.h"
10 #if defined(Q_WS_MAC) || defined(Q_OS_FREEBSD)
14 class CDeckLinkGLWidget;
15 class PlaybackDelegate;
17 class DeckLinkCaptureDelegate : public QObject, public IDeckLinkInputCallback
21 DeckLinkCaptureDelegate();
22 virtual ~DeckLinkCaptureDelegate();
23 void setAnalyse(bool isOn);
24 virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID /*iid*/, LPVOID */*ppv*/) {
27 virtual ULONG STDMETHODCALLTYPE AddRef(void);
28 virtual ULONG STDMETHODCALLTYPE Release(void);
29 virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags);
30 virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);
34 pthread_mutex_t m_mutex;
35 QList <IDeckLinkVideoInputFrame*> m_framesList;
36 QStringList m_framePath;
40 void slotProcessFrame();
43 void gotTimeCode(ulong);
44 void gotMessage(const QString &);
45 void frameSaved(const QString);
46 void gotFrame(QImage);
49 class BmdCaptureHandler : public CaptureHandler
53 BmdCaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
55 CDeckLinkGLWidget *previewView;
56 void startPreview(int deviceId, int captureMode, bool audio = true);
58 void startCapture(const QString &path);
60 void captureFrame(const QString &fname);
61 void showOverlay(QImage img, bool transparent = true);
63 void hidePreview(bool hide);
64 QStringList getDeviceName(QString);
65 void setDevice(const QString input, QString size = QString());
68 IDeckLinkIterator *deckLinkIterator;
69 DeckLinkCaptureDelegate *delegate;
70 IDeckLinkDisplayMode *displayMode;
72 IDeckLinkInput *deckLinkInput;
73 IDeckLinkDisplayModeIterator *displayModeIterator;