-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
82 lines (55 loc) · 1.66 KB
/
main.cpp
File metadata and controls
82 lines (55 loc) · 1.66 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
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
#include "mainwindow.h"
#include <QtWidgets/QApplication>
#include "gl_widget.h"
#include "src/VideoPlayer.h"
#define NEW
#ifdef OLD
int main(int argc, char *argv[]) {
Q_INIT_RESOURCE(application);
printf("start main\n");
auto capturer = new FFmpegCapturer("C:\\Users\\58boy\\Desktop\\daoxiang.mp4");
QApplication a(argc, argv);
GLWidget w;
w.show();
w.setCoverPath(":\\res\\image\\iron_man.jpg");
AVFrame *video_frame;
int frame_index = 0;
do {
video_frame = capturer->captureFrame();
if (video_frame != NULL) {
printf("capture frame: %d\n", frame_index);
frame_index++;
}
if (frame_index > 100) {
break;
}
} while (1);
printf("video frame width : %d\n", video_frame->width);
printf("video frame height : %d\n", video_frame->height);
w.onRender(video_frame->data[0], video_frame->width, video_frame->height);
return a.exec();
}
#endif
#ifdef NEW
int main(int argc, char *argv[]) {
Q_INIT_RESOURCE(application);
QApplication a(argc, argv);
auto player = new VideoPlayer("C:\\Users\\58boy\\Desktop\\Billie Jean.mp4");
player->setGeometry(100, 100, 450, 350);
player->show();
player->play();
return a.exec();
}
#endif
#ifdef TEST
#include "streamer/video_streamer.h"
int main(int argc, char *argv[]) {
using namespace Streamer;
State *start_state = new IdleState;
auto streamer = new VideoStreamer();
Context *ctx = new Context(start_state, streamer);
auto stateMachine = new StateMachine;
stateMachine->transition(ctx);
// stateMachine->transition(ctx, streamer->start());
}
#endif