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();
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;
39 void slotProcessFrame();
42 void gotTimeCode(ulong);
43 void gotMessage(const QString &);
44 void frameSaved(const QString);
47 class BmdCaptureHandler : public CaptureHandler
51 BmdCaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
53 CDeckLinkGLWidget *previewView;
54 void startPreview(int deviceId, int captureMode, bool audio = true);
56 void startCapture(const QString &path);
58 void captureFrame(const QString &fname);
59 void showOverlay(QImage img, bool transparent = true);
61 void hidePreview(bool hide);
62 QStringList getDeviceName(QString);
63 void setDevice(const QString input, QString size = QString());
66 IDeckLinkIterator *deckLinkIterator;
67 DeckLinkCaptureDelegate *delegate;
68 IDeckLinkDisplayMode *displayMode;
70 IDeckLinkInput *deckLinkInput;
71 IDeckLinkDisplayModeIterator *displayModeIterator;