Skip to content

Commit

Permalink
Merge pull request wang-bin#1278 from ElderOrb/master
Browse files Browse the repository at this point in the history
expose stepFinished signal to AVPlayer
  • Loading branch information
wang-bin authored Mar 11, 2020
2 parents 0307c17 + 8f73631 commit acf9a30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/AVPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ AVPlayer::AVPlayer(QObject *parent) :
connect(d->read_thread, SIGNAL(mediaStatusChanged(QtAV::MediaStatus)), this, SLOT(updateMediaStatus(QtAV::MediaStatus)));
connect(d->read_thread, SIGNAL(bufferProgressChanged(qreal)), this, SIGNAL(bufferProgressChanged(qreal)));
connect(d->read_thread, SIGNAL(seekFinished(qint64)), this, SLOT(onSeekFinished(qint64)), Qt::DirectConnection);
connect(d->read_thread, SIGNAL(stepFinished()), this, SLOT(onStepFinished()), Qt::DirectConnection);
connect(d->read_thread, SIGNAL(internalSubtitlePacketRead(int, QtAV::Packet)), this, SIGNAL(internalSubtitlePacketRead(int, QtAV::Packet)), Qt::DirectConnection);
d->vcapture = new VideoCapture(this);
}
Expand Down Expand Up @@ -1414,6 +1415,11 @@ void AVPlayer::onSeekFinished(qint64 value)
Q_EMIT positionChanged(value);
}

void AVPlayer::onStepFinished()
{
Q_EMIT stepFinished();
}

void AVPlayer::tryClearVideoRenderers()
{
if (!d->vthread) {
Expand Down
2 changes: 2 additions & 0 deletions src/QtAV/AVPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ public Q_SLOTS:
* \param position The video or audio timestamp when seek is finished
*/
void seekFinished(qint64 position);
void stepFinished();
void positionChanged(qint64 position);
void interruptTimeoutChanged();
void interruptOnTimeoutChanged();
Expand Down Expand Up @@ -616,6 +617,7 @@ private Q_SLOTS:
void onStarted();
void updateMediaStatus(QtAV::MediaStatus status);
void onSeekFinished(qint64 value);
void onStepFinished();
void tryClearVideoRenderers();
void seekChapter(int incr);
protected:
Expand Down

0 comments on commit acf9a30

Please sign in to comment.