bool GstVideoPlayerBackend::setSpeed(double speed) { if (!m_pipeline) return false; if (speed == m_playbackSpeed) return true; if (speed == 0) return false; gboolean re = gst_element_seek(m_pipeline, speed, GST_FORMAT_TIME, GstSeekFlags(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP), GST_SEEK_TYPE_SET, position(), GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); if (!re) { qDebug() << "gstreamer: Setting playback speed failed"; emit nonFatalError(tr("Playback speed failed")); } else { m_playbackSpeed = speed; m_lastspeed = speed; qDebug() << "gstreamer: set playback speed to" << m_playbackSpeed; emit playbackSpeedChanged(m_playbackSpeed); } return re ? true : false; }
void GstVideoPlayerBackend::play() { if (!m_pipeline) return; gst_element_set_state(m_pipeline, GST_STATE_PLAYING); emit playbackSpeedChanged(m_playbackSpeed); }
/////////////////////////////////////////// // Set the packet playback speed void EQPacket::setPlayback(int speed) { if (m_vPacket) { m_vPacket->setPlaybackSpeed(speed); } else { m_packetCapture->setPlaybackSpeed(speed); } QString string(""); if (speed == 0) string.sprintf("Playback speed set Fast as possible"); else if (speed < 0) string.sprintf("Playback paused (']' to resume)"); else string.sprintf("Playback speed set to %d", speed); emit stsMessage(string, 5000); emit resetPacket(m_client2WorldStream->packetCount(), client2world); emit resetPacket(m_world2ClientStream->packetCount(), world2client); emit resetPacket(m_client2ZoneStream->packetCount(), client2zone); emit resetPacket(m_zone2ClientStream->packetCount(), zone2client); emit playbackSpeedChanged(speed); }
void GameConsole::setPlaybackSpeed( qreal playbackSpeed ) { if( !dynamicPipelineReady() ) { qCDebug( phxControl ) << Q_FUNC_INFO << ": Dynamic pipeline not yet fully hooked up, caching change for later..."; pendingPropertyChanges[ "playbackSpeed" ] = playbackSpeed; return; } this->playbackSpeed = playbackSpeed; emit commandOut( Command::SetPlaybackSpeed, playbackSpeed, nodeCurrentTime() ); emit playbackSpeedChanged(); }
void MplVideoPlayerBackend::play() { if (!m_mplayer || !m_mplayer->isRunning() || !m_mplayer->isReadyToPlay()) return; m_mplayer->play(); emit playbackSpeedChanged(m_playbackSpeed); VideoState old = m_state; m_state = Playing; emit stateChanged(m_state, old); }
bool MplVideoPlayerBackend::setSpeed(double speed) { if (!m_mplayer || !m_mplayer->isRunning()) return false; if (speed == m_playbackSpeed) return true; if (speed == 0) return false; m_mplayer->setSpeed(speed); m_playbackSpeed = speed; m_lastspeed = speed; emit playbackSpeedChanged(m_playbackSpeed); return speed; }