forked from baycom/MXPTiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MXPTinyDlg.h
executable file
·139 lines (122 loc) · 4.54 KB
/
MXPTinyDlg.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// This file is part of MXPTiny by BayCom GmbH.
//
// MXPTiny is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MXPTiny is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MXPTiny. If not, see <http://www.gnu.org/licenses/>.
//
// The developer can be reached at [email protected]
#pragma once
#include "DeckLinkAPI_h.h"
#include "afxwin.h"
#include "afxcmn.h"
// CMXPTinyDlg dialog
class CMXPTinyDlg : public CDialog,
public IBMDStreamingDeviceNotificationCallback,
public IBMDStreamingH264InputCallback
{
// Construction
public:
CMXPTinyDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_MXPTINY_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
HICON m_hIcon;
//
CButton m_startButton;
CStatic m_configBoxStatic;
CComboBox m_videoEncodingCombo;
CComboBox m_videoInputDeviceCombo;
BOOL m_autorec;
CSliderCtrl m_bitrate_slider;
CStatic m_bitrate_static;
CString m_default_exe;
class dev {
public:
IDeckLink *device;
CString name;
IBMDStreamingDeviceInput *input;
BMDStreamingDeviceMode mode;
};
std::vector <dev> m_devs;
HANDLE m_fh;
HANDLE m_pipe;
CString m_filename;
CString m_vlcexe;
LARGE_INTEGER m_tscount;
LARGE_INTEGER m_last_tscount;
DWORD m_bitrate;
// Streaming API:
IBMDStreamingDiscovery* m_streamingDiscovery;
IDeckLink* m_streamingDevice;
IBMDStreamingDeviceInput* m_streamingDeviceInput;
bool m_playing;
bool m_recording;
BMDStreamingDeviceMode m_deviceMode;
BMDVideoConnection m_inputConnector;
BMDDisplayMode m_inputMode;
CString m_deviceName;
// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedButtonRecord();
afx_msg void OnCbnSelchangeComboInputDevice();
afx_msg void OnBnClickedButtonFolder();
private:
void StartPreview();
void StopPreview();
void UpdateUIForNewDevice();
void UpdateUIForNoDevice();
void UpdateUIForModeChanges();
void UpdateEncodingPresetsUIForInputMode();
void EncodingPresetsRemoveItems();
void updBitrate();
void activate_device(int i);
int browseFolder(char *pszBuffer);
public:
// IUknown
// We need to correctly implement QueryInterface, but not the AddRef/Release
virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID iid, LPVOID* ppv);
virtual ULONG STDMETHODCALLTYPE AddRef () {return 1;}
virtual ULONG STDMETHODCALLTYPE Release () {return 1;}
public:
// IBMDStreamingDeviceNotificationCallback
virtual HRESULT STDMETHODCALLTYPE StreamingDeviceArrived(IDeckLink* device);
virtual HRESULT STDMETHODCALLTYPE StreamingDeviceRemoved(IDeckLink* device);
virtual HRESULT STDMETHODCALLTYPE StreamingDeviceModeChanged(IDeckLink* device, BMDStreamingDeviceMode mode);
virtual HRESULT STDMETHODCALLTYPE StreamingDeviceFirmwareUpdateProgress(IDeckLink* device, unsigned char percent);
public:
virtual HRESULT STDMETHODCALLTYPE H264NALPacketArrived(IBMDStreamingH264NALPacket* nalPacket);
virtual HRESULT STDMETHODCALLTYPE H264AudioPacketArrived(IBMDStreamingAudioPacket* audioPacket);
virtual HRESULT STDMETHODCALLTYPE MPEG2TSPacketArrived(IBMDStreamingMPEG2TSPacket* mpeg2TSPacket);
virtual HRESULT STDMETHODCALLTYPE H264VideoInputConnectorScanningChanged(void);
virtual HRESULT STDMETHODCALLTYPE H264VideoInputConnectorChanged(void);
virtual HRESULT STDMETHODCALLTYPE H264VideoInputModeChanged(void);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
CButton m_record_button;
CStatic m_encoding_static;
CButton m_folder_button;
afx_msg void OnClose();
afx_msg void OnCbnSelchangeComboEncodingPreset();
afx_msg void OnBnClickedButtonPrevcfg();
CButton m_prevcfg_button;
afx_msg void OnBnClickedButtonCustomize();
CButton m_button_customize;
CButton m_button_autorec;
afx_msg void OnBnClickedAutorec();
};