void TorcPlayer::SetPropertyUnavailable(TorcPlayer::PlayerProperty Property) { if (m_supportedProperties.contains(Property)) { m_supportedProperties.remove(Property); emit PropertyUnavailable(Property); } }
VideoUIPlayer::VideoUIPlayer(QObject *Parent, int PlaybackFlags, int DecodeFlags) : VideoPlayer(Parent, PlaybackFlags, DecodeFlags), m_colourSpace(new VideoColourSpace(AVCOL_SPC_UNSPECIFIED)), m_currentFrame(NULL) { m_render = VideoRenderer::Create(m_colourSpace); m_buffers.SetDisplayFormat(m_render ? m_render->PreferredPixelFormat() : PIX_FMT_YUV420P); m_manualAVSyncAdjustment = gLocalContext->GetSetting(TORC_VIDEO + "AVSyncAdj", (int)0); // connect VideoColourSpace to the UI connect(m_colourSpace, SIGNAL(PropertyChanged(TorcPlayer::PlayerProperty,QVariant)), parent(), SLOT(PlayerPropertyChanged(TorcPlayer::PlayerProperty,QVariant))); // connect VideoColourSpace to the player connect(m_colourSpace, SIGNAL(PropertyAvailable(TorcPlayer::PlayerProperty)), this, SLOT(SetPropertyAvailable(TorcPlayer::PlayerProperty))); connect(m_colourSpace, SIGNAL(PropertyUnavailable(TorcPlayer::PlayerProperty)), this, SLOT(SetPropertyUnavailable(TorcPlayer::PlayerProperty))); if (m_render) { // connect VideoRender to VideoColourSpace to notify availability of colour controls connect(m_render, SIGNAL(ColourPropertyAvailable(TorcPlayer::PlayerProperty)), m_colourSpace, SLOT(SetPropertyAvailable(TorcPlayer::PlayerProperty))); connect(m_render, SIGNAL(ColourPropertyUnavailable(TorcPlayer::PlayerProperty)), m_colourSpace, SLOT(SetPropertyUnavailable(TorcPlayer::PlayerProperty))); // connect VideoRender to the player connect(m_render, SIGNAL(PropertyAvailable(TorcPlayer::PlayerProperty)), this, SLOT(SetPropertyAvailable(TorcPlayer::PlayerProperty))); connect(m_render, SIGNAL(PropertyUnavailable(TorcPlayer::PlayerProperty)), this, SLOT(SetPropertyUnavailable(TorcPlayer::PlayerProperty))); // initialise AFTER the signals and slots have been initialised m_render->Initialise(); } // allow gpu hardware acceleration such as VDPAU, DXVA2 and VAAPI if (VideoPlayer::gAllowGPUAcceleration) VideoPlayer::gAllowGPUAcceleration->SetActive(true); }