-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (52 loc) · 1.57 KB
/
main.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
#include "main_window.h"
#include <QApplication>
#include <qsystemdetection.h>
#if defined(Q_OS_WIN)
#include <vld.h>
#endif
#ifdef __cplusplus
extern "C" {
#include <libavdevice/avdevice.h>
#include <libavformat/avformat.h>
#endif
#if __cplusplus
}
#endif
// avcl: A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
static void av_log_callback(void* avcl, int level, const char* fmt, va_list vl)
{
(void) avcl;
(void) level;
(void) fmt;
(void) vl;
// TODO
}
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
av_log_set_level(AV_LOG_WARNING);
// av_log_set_callback(av_log_callback);
avdevice_register_all();
{
// 遍历支持的封装格式
AVInputFormat* input_format = av_iformat_next(nullptr);
puts("-------------------------------Input--------------------------------");
while (input_format != nullptr)
{
printf("%s ", input_format->name);
input_format = input_format->next;
}
puts("\n--------------------------------------------------------------------");
AVOutputFormat* output_format = av_oformat_next(nullptr);
puts("-------------------------------Output-------------------------------");
while (output_format != nullptr)
{
printf("%s ", output_format->name);
output_format = output_format->next;
}
puts("\n--------------------------------------------------------------------");
}
MainWindow w;
w.show();
return a.exec();
}