Commit 545959e4 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

GstreamerPlayerControl: use new style connect syntax


Change-Id: I2fc8d9c8b951092498f11a4a31c6c890df9d7495
Reviewed-by: default avatarVaL Doroshchuk <valentyn.doroshchuk@qt.io>
parent 4444e735
No related merge requests found
Showing with 18 additions and 30 deletions
...@@ -64,39 +64,27 @@ QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *sessio ...@@ -64,39 +64,27 @@ QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *sessio
m_resources = QMediaResourcePolicy::createResourceSet<QMediaPlayerResourceSetInterface>(); m_resources = QMediaResourcePolicy::createResourceSet<QMediaPlayerResourceSetInterface>();
Q_ASSERT(m_resources); Q_ASSERT(m_resources);
connect(m_session, SIGNAL(positionChanged(qint64)), connect(m_session, &QGstreamerPlayerSession::positionChanged, this, &QGstreamerPlayerControl::positionChanged);
this, SIGNAL(positionChanged(qint64))); connect(m_session, &QGstreamerPlayerSession::durationChanged, this, &QGstreamerPlayerControl::durationChanged);
connect(m_session, SIGNAL(durationChanged(qint64)), connect(m_session, &QGstreamerPlayerSession::mutedStateChanged, this, &QGstreamerPlayerControl::mutedChanged);
this, SIGNAL(durationChanged(qint64))); connect(m_session, &QGstreamerPlayerSession::volumeChanged, this, &QGstreamerPlayerControl::volumeChanged);
connect(m_session, SIGNAL(mutedStateChanged(bool)), connect(m_session, &QGstreamerPlayerSession::stateChanged, this, &QGstreamerPlayerControl::updateSessionState);
this, SIGNAL(mutedChanged(bool))); connect(m_session, &QGstreamerPlayerSession::bufferingProgressChanged, this, &QGstreamerPlayerControl::setBufferProgress);
connect(m_session, SIGNAL(volumeChanged(int)), connect(m_session, &QGstreamerPlayerSession::playbackFinished, this, &QGstreamerPlayerControl::processEOS);
this, SIGNAL(volumeChanged(int))); connect(m_session, &QGstreamerPlayerSession::audioAvailableChanged, this, &QGstreamerPlayerControl::audioAvailableChanged);
connect(m_session, SIGNAL(stateChanged(QMediaPlayer::State)), connect(m_session, &QGstreamerPlayerSession::videoAvailableChanged, this, &QGstreamerPlayerControl::videoAvailableChanged);
this, SLOT(updateSessionState(QMediaPlayer::State))); connect(m_session, &QGstreamerPlayerSession::seekableChanged, this, &QGstreamerPlayerControl::seekableChanged);
connect(m_session,SIGNAL(bufferingProgressChanged(int)), connect(m_session, &QGstreamerPlayerSession::error, this, &QGstreamerPlayerControl::error);
this, SLOT(setBufferProgress(int))); connect(m_session, &QGstreamerPlayerSession::invalidMedia, this, &QGstreamerPlayerControl::handleInvalidMedia);
connect(m_session, SIGNAL(playbackFinished()), connect(m_session, &QGstreamerPlayerSession::playbackRateChanged, this, &QGstreamerPlayerControl::playbackRateChanged);
this, SLOT(processEOS()));
connect(m_session, SIGNAL(audioAvailableChanged(bool)), connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesGranted, this, &QGstreamerPlayerControl::handleResourcesGranted);
this, SIGNAL(audioAvailableChanged(bool)));
connect(m_session, SIGNAL(videoAvailableChanged(bool)),
this, SIGNAL(videoAvailableChanged(bool)));
connect(m_session, SIGNAL(seekableChanged(bool)),
this, SIGNAL(seekableChanged(bool)));
connect(m_session, SIGNAL(error(int,QString)),
this, SIGNAL(error(int,QString)));
connect(m_session, SIGNAL(invalidMedia()),
this, SLOT(handleInvalidMedia()));
connect(m_session, SIGNAL(playbackRateChanged(qreal)),
this, SIGNAL(playbackRateChanged(qreal)));
connect(m_resources, SIGNAL(resourcesGranted()), SLOT(handleResourcesGranted()));
//denied signal should be queued to have correct state update process, //denied signal should be queued to have correct state update process,
//since in playOrPause, when acquire is call on resource set, it may trigger a resourcesDenied signal immediately, //since in playOrPause, when acquire is call on resource set, it may trigger a resourcesDenied signal immediately,
//so handleResourcesDenied should be processed later, otherwise it will be overwritten by state update later in playOrPause. //so handleResourcesDenied should be processed later, otherwise it will be overwritten by state update later in playOrPause.
connect(m_resources, SIGNAL(resourcesDenied()), this, SLOT(handleResourcesDenied()), Qt::QueuedConnection); connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesDenied,
connect(m_resources, SIGNAL(resourcesLost()), SLOT(handleResourcesLost())); this, &QGstreamerPlayerControl::handleResourcesDenied, Qt::QueuedConnection);
connect(m_resources, &QMediaPlayerResourceSetInterface::resourcesLost, this, &QGstreamerPlayerControl::handleResourcesLost);
} }
QGstreamerPlayerControl::~QGstreamerPlayerControl() QGstreamerPlayerControl::~QGstreamerPlayerControl()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment