From ad87a5389e46f11d5d7c8f9dc52149c554cfe7a8 Mon Sep 17 00:00:00 2001 From: "michal.szwaj" Date: Tue, 13 Feb 2018 17:54:09 +0100 Subject: [PATCH] Ignore aspect ratio of for higher video resolutions --- .../autoapp/Projection/OMXVideoOutput.hpp | 1 + src/autoapp/Projection/OMXVideoOutput.cpp | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp b/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp index bb4406f..ca01373 100644 --- a/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp +++ b/include/f1x/openauto/autoapp/Projection/OMXVideoOutput.hpp @@ -55,6 +55,7 @@ private: bool initClock(); bool setupTunnels(); bool enablePortBuffers(); + bool setFullscreen(); mutable std::mutex mutex_; bool isActive_; diff --git a/src/autoapp/Projection/OMXVideoOutput.cpp b/src/autoapp/Projection/OMXVideoOutput.cpp index 259b0c0..57d4965 100644 --- a/src/autoapp/Projection/OMXVideoOutput.cpp +++ b/src/autoapp/Projection/OMXVideoOutput.cpp @@ -104,7 +104,22 @@ bool OMXVideoOutput::init() OPENAUTO_LOG(info) << "[OMXVideoOutput] init, state: " << isActive_; ilclient_change_component_state(components_[VideoComponent::DECODER], OMX_StateExecuting); - return true; + + return this->setFullscreen(); +} + +bool OMXVideoOutput::setFullscreen() +{ + OMX_CONFIG_DISPLAYREGIONTYPE displayRegion; + displayRegion.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE); + displayRegion.nVersion.nVersion = OMX_VERSION; + displayRegion.nPortIndex = 90; + + displayRegion.set = static_cast(OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT); + displayRegion.fullscreen = OMX_TRUE; + displayRegion.noaspect = OMX_TRUE; + + return OMX_SetConfig(ilclient_get_handle(components_[VideoComponent::RENDERER]), OMX_IndexConfigDisplayRegion, &displayRegion) == OMX_ErrorNone; } void OMXVideoOutput::write(uint64_t timestamp, const aasdk::common::DataConstBuffer& buffer)