-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecklinkcapturedelegate.h
More file actions
50 lines (38 loc) · 1.56 KB
/
decklinkcapturedelegate.h
File metadata and controls
50 lines (38 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __CAPTURE_H__
#define __CAPTURE_H__
#include "DeckLinkAPI.h"
#include <QObject>
#include <pthread.h>
#include "glwidget.h"
class DeckLinkCaptureDelegate : public QObject, public IDeckLinkInputCallback
{
Q_OBJECT
public:
DeckLinkCaptureDelegate(GLWidget* _glWidget);
~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*);
void setWidth(int w) { width = w; }
void setHeight(int h) { height = h; }
void setFPS(double _fps) { fps = _fps; }
void setFrameRateDuration(BMDTimeValue _frameRateDuration) {frameRateDuration = _frameRateDuration;}
void setFrameRateScale(BMDTimeValue _frameRateScale) {frameRateScale = _frameRateScale;}
long getFrameCount() {return frameCount; }
static double sageTime(); //replace sage::getTime
signals:
void updateGLSignal();
private:
ULONG m_refCount;
pthread_mutex_t m_mutex;
//variables from main
int width, height; //from sageW, sageH
double fps; // from sageFPS
BMDTimeValue frameRateDuration, frameRateScale;
unsigned long frameCount;
//for drawing the video frame
GLWidget* glWidget;
};
#endif