-#ifndef __CAPTURE_H__
-#define __CAPTURE_H__
+#ifndef __BMDCAPTURE_H__
+#define __BMDCAPTURE_H__
#include "include/DeckLinkAPI.h"
+#include "../stopmotion/capturehandler.h"
#include <QWidget>
#include <QObject>
class DeckLinkCaptureDelegate : public QObject, public IDeckLinkInputCallback
{
-Q_OBJECT
+ Q_OBJECT
public:
- DeckLinkCaptureDelegate();
- virtual ~DeckLinkCaptureDelegate();
+ DeckLinkCaptureDelegate();
+ virtual ~DeckLinkCaptureDelegate();
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID /*iid*/, LPVOID */*ppv*/) { return E_NOINTERFACE; }
- virtual ULONG STDMETHODCALLTYPE AddRef(void);
- virtual ULONG STDMETHODCALLTYPE Release(void);
- virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags);
- virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID /*iid*/, LPVOID */*ppv*/) {
+ return E_NOINTERFACE;
+ }
+ virtual ULONG STDMETHODCALLTYPE AddRef(void);
+ virtual ULONG STDMETHODCALLTYPE Release(void);
+ virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags);
+ virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);
private:
- ULONG m_refCount;
- pthread_mutex_t m_mutex;
+ ULONG m_refCount;
+ pthread_mutex_t m_mutex;
+ QList <IDeckLinkVideoInputFrame*> m_framesList;
+ QStringList m_framePath;
+
+private slots:
+ void slotProcessFrame();
+
signals:
- void gotTimeCode(ulong);
- void gotMessage(const QString &);
+ void gotTimeCode(ulong);
+ void gotMessage(const QString &);
+ void frameSaved(const QString);
};
-class CaptureHandler : public QObject
+class BmdCaptureHandler : public CaptureHandler
{
- Q_OBJECT
+ Q_OBJECT
public:
- CaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
- ~CaptureHandler();
- CDeckLinkGLWidget *previewView;
- void startPreview(int deviceId, int captureMode);
- void stopPreview();
- void startCapture(const QString &path);
- void stopCapture();
- void captureFrame(const QString &fname);
- void showOverlay(QImage img, bool transparent = true);
- void hideOverlay();
- void hidePreview(bool hide);
-
-private:
- IDeckLinkIterator *deckLinkIterator;
- DeckLinkCaptureDelegate *delegate;
- IDeckLinkDisplayMode *displayMode;
- IDeckLink *deckLink;
- IDeckLinkInput *deckLinkInput;
- IDeckLinkDisplayModeIterator *displayModeIterator;
- QVBoxLayout *m_layout;
- QWidget *m_parent;
+ BmdCaptureHandler(QVBoxLayout *lay, QWidget *parent = 0);
+ ~BmdCaptureHandler();
+ CDeckLinkGLWidget *previewView;
+ void startPreview(int deviceId, int captureMode, bool audio = true);
+ void stopPreview();
+ void startCapture(const QString &path);
+ void stopCapture();
+ void captureFrame(const QString &fname);
+ void showOverlay(QImage img, bool transparent = true);
+ void hideOverlay();
+ void hidePreview(bool hide);
+ QStringList getDeviceName(QString);
-signals:
- void gotTimeCode(ulong);
- void gotMessage(const QString &);
+private:
+ IDeckLinkIterator *deckLinkIterator;
+ DeckLinkCaptureDelegate *delegate;
+ IDeckLinkDisplayMode *displayMode;
+ IDeckLink *deckLink;
+ IDeckLinkInput *deckLinkInput;
+ IDeckLinkDisplayModeIterator *displayModeIterator;
};