From 53cacd5eac5936f1abd3c88bdadbad358dc6f40a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 12 Nov 2020 17:40:06 +0100 Subject: [PATCH] Renamed VideoPlayerComponent to VideoOmxComponent. --- es-app/src/SystemScreensaver.cpp | 4 ++-- es-app/src/guis/GuiMenu.cpp | 4 ++-- .../src/views/gamelist/GridGameListView.cpp | 4 ++-- .../src/views/gamelist/VideoGameListView.cpp | 4 ++-- es-core/CMakeLists.txt | 4 ++-- es-core/src/Settings.cpp | 4 +--- ...yerComponent.cpp => VideoOmxComponent.cpp} | 20 +++++++++---------- ...oPlayerComponent.h => VideoOmxComponent.h} | 16 +++++++-------- 8 files changed, 29 insertions(+), 31 deletions(-) rename es-core/src/components/{VideoPlayerComponent.cpp => VideoOmxComponent.cpp} (93%) rename es-core/src/components/{VideoPlayerComponent.h => VideoOmxComponent.h} (75%) diff --git a/es-app/src/SystemScreensaver.cpp b/es-app/src/SystemScreensaver.cpp index a44581ba9..6489cf6c5 100644 --- a/es-app/src/SystemScreensaver.cpp +++ b/es-app/src/SystemScreensaver.cpp @@ -10,7 +10,7 @@ #include "SystemScreensaver.h" #if defined(_RPI_) -#include "components/VideoPlayerComponent.h" +#include "components/VideoOmxComponent.h" #endif #include "components/VideoVlcComponent.h" #include "resources/Font.h" @@ -173,7 +173,7 @@ void SystemScreensaver::startScreensaver(bool generateMediaList) #if defined(_RPI_) // Create the correct type of video component. if (Settings::getInstance()->getBool("ScreensaverOmxPlayer")) - mVideoScreensaver = new VideoPlayerComponent(mWindow); + mVideoScreensaver = new VideoOmxComponent(mWindow); else mVideoScreensaver = new VideoVlcComponent(mWindow); #else diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index eb4969215..8753291f9 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -503,7 +503,7 @@ void GuiMenu::openSoundSettings() #endif #if defined(_RPI_) - // OMX player Audio Device + // OMXPlayer audio device. auto omx_audio_dev = std::make_shared> (mWindow, getHelpStyle(), "OMX PLAYER AUDIO DEVICE", false); std::vector omx_cards; @@ -655,7 +655,7 @@ void GuiMenu::openOtherSettings() s->addRow(row); #if defined(_RPI_) - // Video Player - VideoOmxPlayer. + // Video playing using OMXPlayer. auto video_omx_player = std::make_shared(mWindow); video_omx_player->setState(Settings::getInstance()->getBool("VideoOmxPlayer")); s->addWithLabel("USE OMX PLAYER (HW ACCELERATED)", video_omx_player); diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index 623c73ad7..ab1515152 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -16,7 +16,7 @@ #include "Sound.h" #include "SystemData.h" #if defined(_RPI_) -#include "components/VideoPlayerComponent.h" +#include "components/VideoOmxComponent.h" #endif #include "components/VideoVlcComponent.h" @@ -59,7 +59,7 @@ GridGameListView::GridGameListView( // Create the correct type of video window. #if defined(_RPI_) if (Settings::getInstance()->getBool("VideoOmxPlayer")) - mVideo = new VideoPlayerComponent(window); + mVideo = new VideoOmxComponent(window); else mVideo = new VideoVlcComponent(window); #else diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 36d49f2bc..f95081999 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -10,7 +10,7 @@ #include "animations/LambdaAnimation.h" #if defined(_RPI_) -#include "components/VideoPlayerComponent.h" +#include "components/VideoOmxComponent.h" #endif #include "components/VideoVlcComponent.h" #include "utils/FileSystemUtil.h" @@ -63,7 +63,7 @@ VideoGameListView::VideoGameListView( // Create the correct type of video window. #if defined(_RPI_) if (Settings::getInstance()->getBool("VideoOmxPlayer")) - mVideo = new VideoPlayerComponent(window); + mVideo = new VideoOmxComponent(window); else mVideo = new VideoVlcComponent(window); #else diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index 831adf7ae..4eb65df12 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -48,7 +48,7 @@ set(CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoPlayerComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoOmxComponent.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.h # Guis @@ -125,7 +125,7 @@ set(CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoPlayerComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoOmxComponent.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.cpp # Guis diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index daaa90f5e..3522c8594 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -185,10 +185,8 @@ void Settings::setDefaults() mStringMap["FullscreenMode"] = "normal"; #endif mStringMap["PowerSaverMode"] = "disabled"; - // This setting only applies to Raspberry Pi but we set it for all platforms so - // we don't get a warning if we encounter it on a different platform. - mBoolMap["VideoOmxPlayer"] = false; #if defined(_RPI_) + mBoolMap["VideoOmxPlayer"] = false; // We're defaulting to OMX Player for full screen video on the Pi. mBoolMap["ScreensaverOmxPlayer"] = true; #endif diff --git a/es-core/src/components/VideoPlayerComponent.cpp b/es-core/src/components/VideoOmxComponent.cpp similarity index 93% rename from es-core/src/components/VideoPlayerComponent.cpp rename to es-core/src/components/VideoOmxComponent.cpp index 0e0f18eb7..7e74fcbe2 100644 --- a/es-core/src/components/VideoPlayerComponent.cpp +++ b/es-core/src/components/VideoOmxComponent.cpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// VideoPlayerComponent.cpp +// VideoOmxComponent.cpp // -// OMXPlayer video playing for Raspberry Pi. +// Video playing using OMXPlayer for Raspberry Pi. // #if defined(_RPI_) -#include "components/VideoPlayerComponent.h" +#include "components/VideoOmxComponent.h" #include "renderers/Renderer.h" #include "utils/StringUtil.h" @@ -25,18 +25,18 @@ public: int getVolume() const; }; -VideoPlayerComponent::VideoPlayerComponent(Window* window) : +VideoOmxComponent::VideoOmxComponent(Window* window) : VideoComponent(window), mPlayerPid(-1) { } -VideoPlayerComponent::~VideoPlayerComponent() +VideoOmxComponent::~VideoOmxComponent() { stopVideo(); } -void VideoPlayerComponent::render(const Transform4x4f& parentTrans) +void VideoOmxComponent::render(const Transform4x4f& parentTrans) { if (!isVisible()) return; @@ -47,7 +47,7 @@ void VideoPlayerComponent::render(const Transform4x4f& parentTrans) VideoComponent::renderSnapshot(parentTrans); } -void VideoPlayerComponent::setResize(float width, float height) +void VideoOmxComponent::setResize(float width, float height) { setSize(width, height); mTargetSize = Vector2f(width, height); @@ -56,7 +56,7 @@ void VideoPlayerComponent::setResize(float width, float height) onSizeChanged(); } -void VideoPlayerComponent::setMaxSize(float width, float height) +void VideoOmxComponent::setMaxSize(float width, float height) { setSize(width, height); mTargetSize = Vector2f(width, height); @@ -65,7 +65,7 @@ void VideoPlayerComponent::setMaxSize(float width, float height) onSizeChanged(); } -void VideoPlayerComponent::startVideo() +void VideoOmxComponent::startVideo() { if (!mIsPlaying) { mVideoWidth = 0; @@ -205,7 +205,7 @@ void catch_child(int sig_num) wait(&child_status); } -void VideoPlayerComponent::stopVideo() +void VideoOmxComponent::stopVideo() { mIsPlaying = false; mStartDelayed = false; diff --git a/es-core/src/components/VideoPlayerComponent.h b/es-core/src/components/VideoOmxComponent.h similarity index 75% rename from es-core/src/components/VideoPlayerComponent.h rename to es-core/src/components/VideoOmxComponent.h index 1243f5b98..7a5b883ce 100644 --- a/es-core/src/components/VideoPlayerComponent.h +++ b/es-core/src/components/VideoOmxComponent.h @@ -1,24 +1,24 @@ // SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition -// VideoPlayerComponent.h +// VideoOmxComponent.h // -// OMXPlayer video playing for Raspberry Pi. +// Video playing using OMXPlayer for Raspberry Pi. // #if defined(_RPI_) -#ifndef ES_CORE_COMPONENTS_VIDEO_PLAYER_COMPONENT_H -#define ES_CORE_COMPONENTS_VIDEO_PLAYER_COMPONENT_H +#ifndef ES_CORE_COMPONENTS_VIDEO_OMX_COMPONENT_H +#define ES_CORE_COMPONENTS_VIDEO_OMX_COMPONENT_H #include "components/VideoComponent.h" void catch_child(int sig_num); -class VideoPlayerComponent : public VideoComponent +class VideoOmxComponent : public VideoComponent { public: - VideoPlayerComponent(Window* window); - virtual ~VideoPlayerComponent(); + VideoOmxComponent(Window* window); + virtual ~VideoOmxComponent(); void render(const Transform4x4f& parentTrans) override; @@ -43,5 +43,5 @@ private: pid_t mPlayerPid; }; -#endif // ES_CORE_COMPONENTS_VIDEO_PLAYER_COMPONENT_H +#endif // ES_CORE_COMPONENTS_VIDEO_OMX_COMPONENT_H #endif // _RPI_