Skip to content

Commit

Permalink
Remove direct connection from example
Browse files Browse the repository at this point in the history
  • Loading branch information
valbok committed May 6, 2023
1 parent f54eabe commit fe169e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions examples/qml_video/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ int main(int argc, char *argv[])

QElapsedTimer frameElapsed;
frameElapsed.start();
int fpsFrames = 0;
int receivedFrames = 0;

QObject::connect(&p, &QAVPlayer::videoFrame, &p, [&](const QAVVideoFrame &) { ++receivedFrames; }, Qt::DirectConnection);
QObject::connect(&p, &QAVPlayer::videoFrame, &p, [&](const QAVVideoFrame &frame) {
const int fps = fpsFrames++ * 1000 / frameElapsed.elapsed();
const int fps = receivedFrames++ * 1000 / frameElapsed.elapsed();
rootObject->setProperty("frame_fps", fps);

QVideoFrame videoFrame = frame;
Expand Down
2 changes: 1 addition & 1 deletion examples/qml_video/qml_video.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ANDROID_EXTRA_LIBS += /opt/mobile-ffmpeg/prebuilt/android-arm/ffmpeg/lib/libavde
/opt/mobile-ffmpeg/prebuilt/android-arm/ffmpeg/lib/libavfilter.so \
/opt/mobile-ffmpeg/prebuilt/android-arm/ffmpeg/lib/libswscale.so \
/opt/mobile-ffmpeg/prebuilt/android-arm/ffmpeg/lib/libswresample.so

CONFIG += c++1z
QT += gui multimedia QtAVPlayer
lessThan(QT_MAJOR_VERSION, 6): QT += qtmultimediaquicktools-private
equals(QT_MAJOR_VERSION, 6): QT += multimediaquick-private
Expand Down

0 comments on commit fe169e7

Please sign in to comment.