forked from leixiaohua1020/VideoEye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dataoutput.cpp
239 lines (203 loc) · 7.23 KB
/
Dataoutput.cpp
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/*
*
*
* VideoEye
*
* 雷霄骅 Lei Xiaohua
* leixiaohua1020@126.com
* 中国传媒大学/数字电视技术
* Communication University of China / Digital TV Technology
* http://blog.csdn.net/leixiaohua1020
*
*/
#include "stdafx.h"
#include "Dataoutput.h"
#include "afxdialogex.h"
// Dataoutput 对话框
IMPLEMENT_DYNAMIC(Dataoutput, CDialogEx)
Dataoutput::Dataoutput(CWnd* pParent /*=NULL*/)
: CDialogEx(Dataoutput::IDD, pParent)
{
}
Dataoutput::~Dataoutput()
{
}
void Dataoutput::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_OUT_DIR_M_A, m_outdirma);
DDX_Control(pDX, IDC_OUT_DIR_M_O, m_outdirmo);
DDX_Control(pDX, IDC_OUT_DIR_M_V, m_outdirmv);
DDX_Control(pDX, IDC_OUT_DIR_R_U, m_outdirru);
DDX_Control(pDX, IDC_OUT_DIR_R_V, m_outdirrv);
DDX_Control(pDX, IDC_OUT_DIR_R_Y, m_outdirry);
DDX_Control(pDX, IDC_OUT_DIR_R_YUV, m_outdirryuv);
DDX_Control(pDX, IDC_OUT_CHECK_M_A, m_outcheckma);
DDX_Control(pDX, IDC_OUT_CHECK_M_O, m_outcheckmo);
DDX_Control(pDX, IDC_OUT_CHECK_M_V, m_outcheckmv);
DDX_Control(pDX, IDC_OUT_CHECK_R_U, m_outcheckru);
DDX_Control(pDX, IDC_OUT_CHECK_R_V, m_outcheckrv);
DDX_Control(pDX, IDC_OUT_CHECK_R_Y, m_outcheckry);
DDX_Control(pDX, IDC_OUT_CHECK_R_YUV, m_outcheckryuv);
DDX_Control(pDX, IDC_OUT_CHECK_R_PCM, m_outcheckrpcm);
DDX_Control(pDX, IDC_OUT_DIR_R_PCM, m_outdirrpcm);
DDX_Control(pDX, IDC_OUT_CHECK_M_A_AAC, m_outcheckmaaac);
DDX_Control(pDX, IDC_OUT_CHECK_M_V_H264, m_outcheckmvh264);
DDX_Control(pDX, IDC_OUT_DIR_M_A_AAC, m_outdirmaaac);
DDX_Control(pDX, IDC_OUT_DIR_M_V_H264, m_outdirmvh264);
}
BEGIN_MESSAGE_MAP(Dataoutput, CDialogEx)
ON_BN_CLICKED(IDC_OUT_DIR_M_V_D, &Dataoutput::OnBnClickedOutDirMVD)
ON_BN_CLICKED(IDC_OUT_DIR_M_A_D, &Dataoutput::OnBnClickedOutDirMAD)
ON_BN_CLICKED(IDC_OUT_DIR_M_O_D, &Dataoutput::OnBnClickedOutDirMOD)
ON_BN_CLICKED(IDC_OUT_DIR_R_YUV_D, &Dataoutput::OnBnClickedOutDirRYuvD)
ON_BN_CLICKED(IDC_OUT_DIR_R_Y_D, &Dataoutput::OnBnClickedOutDirRYD)
ON_BN_CLICKED(IDC_OUT_DIR_R_U_D, &Dataoutput::OnBnClickedOutDirRUD)
ON_BN_CLICKED(IDC_OUT_DIR_R_V_D, &Dataoutput::OnBnClickedOutDirRVD)
ON_BN_CLICKED(IDC_OUT_CHECK_M_V, &Dataoutput::OnBnClickedOutCheckMV)
ON_BN_CLICKED(IDC_OUT_DIR_R_PCM_D, &Dataoutput::OnBnClickedOutDirRPcmD)
ON_BN_CLICKED(IDC_OUT_DIR_M_V_H264_D, &Dataoutput::OnBnClickedOutDirMVH264D)
ON_BN_CLICKED(IDC_OUT_DIR_M_A_AAC_D, &Dataoutput::OnBnClickedOutDirMAAacD)
END_MESSAGE_MAP()
// Dataoutput 消息处理程序
BOOL Dataoutput::OnInitDialog(){
CDialogEx::OnInitDialog();
m_outcheckma.SetCheck(0);
m_outcheckmv.SetCheck(0);
m_outcheckmo.SetCheck(0);
m_outcheckryuv.SetCheck(0);
m_outcheckry.SetCheck(0);
m_outcheckru.SetCheck(0);
m_outcheckrv.SetCheck(0);
m_outcheckmvh264.SetCheck(0);
m_outcheckmaaac.SetCheck(0);
//-------------
TCHAR realpath[MAX_URL_LENGTH]={0};
//生成文件路径
GetCurrentDirectory(MAX_URL_LENGTH,realpath);
CString outdirma,outdirmv,outdirmo,outdirryuv,outdirry,outdirru,outdirrv,outdirrpcm,outdirmvh264,outdirmaaac;
//-----------------
outdirma.Format(_T("%s\\output"),realpath);
outdirmv.Format(_T("%s\\output"),realpath);
outdirmo.Format(_T("%s\\output"),realpath);
outdirryuv.Format(_T("%s\\output.yuv"),realpath);
outdirry.Format(_T("%s\\output.y"),realpath);
outdirru.Format(_T("%s\\output.u"),realpath);
outdirrv.Format(_T("%s\\output.v"),realpath);
outdirrpcm.Format(_T("%s\\output.pcm"),realpath);
outdirmvh264.Format(_T("%s\\output.264"),realpath);
outdirmaaac.Format(_T("%s\\output.aac"),realpath);
m_outdirma.SetWindowText(outdirma);
m_outdirmv.SetWindowText(outdirmv);
m_outdirmo.SetWindowText(outdirmo);
m_outdirryuv.SetWindowText(outdirryuv);
m_outdirry.SetWindowText(outdirry);
m_outdirru.SetWindowText(outdirru);
m_outdirrv.SetWindowText(outdirrv);
m_outdirrpcm.SetWindowText(outdirrpcm);
m_outdirmvh264.SetWindowText(outdirmvh264);
m_outdirmaaac.SetWindowText(outdirmaaac);
return TRUE;
}
void Dataoutput::OnBnClickedOutDirMVD()
{
CString FilePathName;
CFileDialog dlg(FALSE);///TRUE为OPEN对话框,FALSE为SAVE AS对话框
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirmv.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirMAD()
{
CString FilePathName;
CFileDialog dlg(FALSE);///TRUE为OPEN对话框,FALSE为SAVE AS对话框
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirma.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirMOD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("YUV (*.yuv;*.y;*.u;*.v)|*.yuv;*.y;*.u;*.v|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("yuv"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirmo.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirRYuvD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("YUV (*.yuv;*.y;*.u;*.v)|*.yuv;*.y;*.u;*.v|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("yuv"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirryuv.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirRYD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("YUV (*.yuv;*.y;*.u;*.v)|*.yuv;*.y;*.u;*.v|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("y"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirry.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirRUD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("YUV (*.yuv;*.y;*.u;*.v)|*.yuv;*.y;*.u;*.v|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("u"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirru.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirRVD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("YUV (*.yuv;*.y;*.u;*.v)|*.yuv;*.y;*.u;*.v|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("v"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirrv.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutCheckMV()
{
// TODO: 在此添加控件通知处理程序代码
}
void Dataoutput::OnBnClickedOutDirRPcmD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("PCM (*.pcm)|*.pcm|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("pcm"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirrpcm.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirMVH264D()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("H.264 (*.264)|*.264|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("264"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirmvh264.SetWindowText(FilePathName);
}
void Dataoutput::OnBnClickedOutDirMAAacD()
{
CString FilePathName;
LPCTSTR lpszfilter=_T("AAC (*.aac)|*.aac|All Files (*.*)|*.*||");
CFileDialog dlg(FALSE,_T("aac"),_T("output"),NULL,lpszfilter);
if(dlg.DoModal()==IDOK)
FilePathName=dlg.GetPathName();
if(FilePathName.IsEmpty()==FALSE)
m_outdirmaaac.SetWindowText(FilePathName);
}