-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathavplayer.cpp
30 lines (21 loc) · 850 Bytes
/
avplayer.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
#include "avplayer.h"
#include <QDebug>
AVPlayer::AVPlayer(QWidget *parent) :
QWidget(parent)
{
resize(800, 600);
m_displyer = new ImageDispaly(this);
m_displyer->resize(800, 600);
m_displyer->show();
}
void AVPlayer::open(char *szFileName)
{
AVDemuxThread *workerThread = new AVDemuxThread(this);
AudioPlayThread *audioThread = new AudioPlayThread(this);
connect(workerThread, &AVDemuxThread::updateVideoPic, m_displyer, &ImageDispaly::slotGetOneFrame);
connect(workerThread, &AVDemuxThread::updateAudioData, audioThread, &AudioPlayThread::updateAudioData);
connect(workerThread, &AVDemuxThread::finished, workerThread, &QObject::deleteLater);
connect(audioThread, &AudioPlayThread::finished, audioThread, &QObject::deleteLater);
workerThread->openAV(szFileName);
audioThread->start();
}