Browse Source

Use new RPI rendering method

We're going to use the same for AML, so this is for testing how well it
works.

No idea if we really have to set Qt::FramelessWindowHint or what it does
in this specific case. Leaving it in.
Vincent Lang 8 years ago
parent
commit
bb530260d8
2 changed files with 4 additions and 18 deletions
  1. 4 17
      src/player/PlayerComponent.cpp
  2. 0 1
      src/player/PlayerComponent.h

+ 4 - 17
src/player/PlayerComponent.cpp

@@ -198,31 +198,20 @@ void PlayerComponent::setQtQuickWindow(QQuickWindow* window)
   video->initMpv(this);
   video->initMpv(this);
 }
 }
 
 
-///////////////////////////////////////////////////////////////////////////////////////////////////
-void PlayerComponent::setRpiWindow(QQuickWindow* window)
-{
-  window->setFlags(Qt::FramelessWindowHint);
-
-  mpv_set_option_string(m_mpv, "vo", "rpi");
-}
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void PlayerComponent::setWindow(QQuickWindow* window)
 void PlayerComponent::setWindow(QQuickWindow* window)
 {
 {
-  bool useRpi = false;
-#ifdef TARGET_RPI
-  useRpi = true;
-#endif
-
   m_window = window;
   m_window = window;
   if (!window)
   if (!window)
     return;
     return;
 
 
+#ifdef TARGET_RPI
+  window->setFlags(Qt::FramelessWindowHint);
+#endif
+
   QString forceVo = SettingsComponent::Get().value(SETTINGS_SECTION_VIDEO, "debug.force_vo").toString();
   QString forceVo = SettingsComponent::Get().value(SETTINGS_SECTION_VIDEO, "debug.force_vo").toString();
   if (forceVo.size())
   if (forceVo.size())
     mpv::qt::set_option_variant(m_mpv, "vo", forceVo);
     mpv::qt::set_option_variant(m_mpv, "vo", forceVo);
-  else if (useRpi)
-    setRpiWindow(window);
   else
   else
     setQtQuickWindow(window);
     setQtQuickWindow(window);
 }
 }
@@ -969,10 +958,8 @@ void PlayerComponent::updateVideoSettings()
   QVariant deinterlace = SettingsComponent::Get().value(SETTINGS_SECTION_VIDEO, "deinterlace");
   QVariant deinterlace = SettingsComponent::Get().value(SETTINGS_SECTION_VIDEO, "deinterlace");
   mpv::qt::set_option_variant(m_mpv, "deinterlace", deinterlace.toBool() ? "yes" : "no");
   mpv::qt::set_option_variant(m_mpv, "deinterlace", deinterlace.toBool() ? "yes" : "no");
 
 
-#ifndef TARGET_RPI
   double displayFps = DisplayComponent::Get().currentRefreshRate();
   double displayFps = DisplayComponent::Get().currentRefreshRate();
   mpv::qt::set_property_variant(m_mpv, "display-fps", displayFps);
   mpv::qt::set_property_variant(m_mpv, "display-fps", displayFps);
-#endif
 
 
   setAudioDelay(m_playbackAudioDelay);
   setAudioDelay(m_playbackAudioDelay);
 
 

+ 0 - 1
src/player/PlayerComponent.h

@@ -171,7 +171,6 @@ private:
   // * viewOffset
   // * viewOffset
   //
   //
   void loadWithOptions(const QVariantMap& options);
   void loadWithOptions(const QVariantMap& options);
-  void setRpiWindow(QQuickWindow* window);
   void setQtQuickWindow(QQuickWindow* window);
   void setQtQuickWindow(QQuickWindow* window);
   void updatePlaybackState();
   void updatePlaybackState();
   void handleMpvEvent(mpv_event *event);
   void handleMpvEvent(mpv_event *event);