-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoProbe.cpp
More file actions
27 lines (23 loc) · 872 Bytes
/
VideoProbe.cpp
File metadata and controls
27 lines (23 loc) · 872 Bytes
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
#include "VideoProbe.h"
#include <QMediaPlayer>
VideoProbe::VideoProbe(QObject *parent)
: QVideoProbe(parent), m_source(nullptr)
{
connect(this,&QVideoProbe::videoFrameProbed, this, &VideoProbe::emitVideoFrameProbed);
}
bool VideoProbe::setSource(QObject* sourceObj)
{
m_source = sourceObj;
QMediaPlayer *player = qvariant_cast<QMediaPlayer*>(sourceObj->property("mediaObject"));
//qDebug() << "VideoProbe::setSource() player"<< player;
return QVideoProbe::setSource(static_cast<QMediaObject*>(player));
}
void VideoProbe::emitVideoFrameProbed(const QVideoFrame &frame)
{
if(frame.isValid()) {
emit videoFrameTime(frame.startTime() / 1000, frame.endTime() / 1000);
//emit videoFrameMetadata(frame.availableMetaData());
}
// m_frameWrapper = frame;
// emit videoFrame(&m_frameWrapper);
}