Projects
home:sagiben
kodi-next
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 57
View file
_service:download_files:master.tar.gz/.gitignore
Changed
@@ -277,7 +277,6 @@ /tools/depends/**/config.log /tools/depends/**/config.status /tools/depends/native/*/*native/ -/tools/depends/target/*/aarch64-linux-gnu/ /tools/depends/native/JsonSchemaBuilder/bin/ /tools/depends/native/TexturePacker/bin/ /tools/depends/target/ffmpeg/.ffmpeg-installed
View file
_service:download_files:master.tar.gz/addons/skin.estuary/xml/Includes_PVR.xml
Changed
@@ -267,8 +267,8 @@ <rulerunit>6</rulerunit> <onleft>9000</onleft> <onright>60</onright> - <onup>$PARAM[control_onup_id]</onup> - <ondown>$PARAM[control_id]</ondown> + <onup>$PARAM[control_onupdown_id]</onup> + <ondown>$PARAM[control_onupdown_id]</ondown> <viewtype label="$PARAM[viewtype_label]">list</viewtype> <progresstexture border="$PARAM[progress_texture_border]" colordiffuse="button_focus">$PARAM[progress_texture]</progresstexture> <rulerdatelayout width="1700" height="45" condition="$PARAM[has_rulerdate_layout]">
View file
_service:download_files:master.tar.gz/addons/skin.estuary/xml/MyPVRGuide.xml
Changed
@@ -114,7 +114,7 @@ <param name="control_id" value="50"/> <param name="control_orientation" value="vertical"/> <param name="control_top" value="55"/> - <param name="control_onup_id" value="11"/> + <param name="control_onupdown_id" value="11"/> <param name="viewtype_label" value="19298"/> <param name="progress_texture_border" value="0,60,18,14"/> <param name="progress_texture" value="windows/pvr/epg_progress_vertical.png"/> @@ -128,7 +128,7 @@ <param name="control_id" value="51"/> <param name="control_orientation" value="horizontal"/> <param name="control_top" value="55"/> - <param name="control_onup_id" value="11"/> + <param name="control_onupdown_id" value="11"/> <param name="viewtype_label" value="19297"/> <param name="progress_texture_border" value="5,10,5,10"/> <param name="progress_texture" value="windows/pvr/epg_progress_horizontal.png"/> @@ -142,7 +142,7 @@ <param name="control_id" value="52"/> <param name="control_orientation" value="vertical"/> <param name="control_top" value="0"/> - <param name="control_onup_id" value="52"/> + <param name="control_onupdown_id" value="52"/> <param name="viewtype_label" value="19301"/> <param name="progress_texture_border" value="0,60,18,14"/> <param name="progress_texture" value="windows/pvr/epg_progress_vertical.png"/> @@ -156,7 +156,7 @@ <param name="control_id" value="53"/> <param name="control_orientation" value="horizontal"/> <param name="control_top" value="0"/> - <param name="control_onup_id" value="53"/> + <param name="control_onupdown_id" value="53"/> <param name="viewtype_label" value="19300"/> <param name="progress_texture_border" value="5,10,5,10"/> <param name="progress_texture" value="windows/pvr/epg_progress_horizontal.png"/>
View file
_service:download_files:master.tar.gz/cmake/scripts/common/Macros.cmake
Changed
@@ -634,6 +634,7 @@ else() find_package(Git) if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) + # get tree status i.e. clean working tree vs dirty (uncommited or unstashed changes, etc.) execute_process(COMMAND ${GIT_EXECUTABLE} update-index --ignore-submodules -q --refresh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- @@ -644,21 +645,21 @@ RESULT_VARIABLE status_code WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) endif() + # get HEAD commit SHA-1 + execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD + OUTPUT_VARIABLE HASH + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + string(REPLACE "\"" "" HASH ${HASH}) + if(status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD - OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - string(SUBSTRING ${HASH} 1 13 HASH) - else() - execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD - OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - string(SUBSTRING ${HASH} 1 7 HASH) + string(CONCAT HASH ${HASH} "-dirty") endif() + + # get HEAD commit date execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD OUTPUT_VARIABLE DATE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - string(SUBSTRING ${DATE} 1 10 DATE) + string(REPLACE "\"" "" DATE ${DATE}) string(REPLACE "-" "" DATE ${DATE}) else() string(TIMESTAMP DATE "%Y%m%d" UTC)
View file
_service:download_files:master.tar.gz/cmake/scripts/windows/ArchSetup.cmake
Changed
@@ -1,3 +1,12 @@ +# Minimum SDK version we support +set(VS_MINIMUM_SDK_VERSION 10.0.14393.0) + +if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION) + message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n" + "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n" + "INFO: Windows SDKs can be installed from the Visual Studio installer.") +endif() + # -------- Architecture settings --------- if(CMAKE_SIZEOF_VOID_P EQUAL 4)
View file
_service:download_files:master.tar.gz/cmake/scripts/windowsstore/ArchSetup.cmake
Changed
@@ -1,3 +1,12 @@ +# Minimum SDK version we support +set(VS_MINIMUM_SDK_VERSION 10.0.14393.0) + +if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION) + message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n" + "Windows SDK ${VS_MINIMUM_SDK_VERSION} or higher is required.\n" + "INFO: Windows SDKs can be installed from the Visual Studio installer.") +endif() + # -------- Architecture settings --------- check_symbol_exists(_X86_ "Windows.h" _X86_) @@ -103,9 +112,6 @@ # remove warning set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4264") -# Minimum SDK version we support -set(VS_MINIMUM_SDK_VERSION 10.0.14393.0) - # -------- Visual Studio options ---------
View file
_service:download_files:master.tar.gz/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl
Changed
@@ -122,7 +122,7 @@ #endif #if defined(XBMC_COL_CONVERSION) - rgb.rgb = pow(rgb.rgb, vec3(m_gammaSrc)); + rgb.rgb = pow(max(vec3(0), rgb.rgb), vec3(m_gammaSrc)); rgb.rgb = max(vec3(0), m_primMat * rgb.rgb); rgb.rgb = pow(rgb.rgb, vec3(m_gammaDstInv)); #endif
View file
_service:download_files:master.tar.gz/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl
Changed
@@ -93,7 +93,7 @@ rgb.a = m_alpha; #if defined(XBMC_COL_CONVERSION) - rgb.rgb = pow(rgb.rgb, vec3(m_gammaSrc)); + rgb.rgb = pow(max(vec3(0), rgb.rgb), vec3(m_gammaSrc)); rgb.rgb = max(vec3(0), m_primMat * rgb.rgb); rgb.rgb = pow(rgb.rgb, vec3(m_gammaDstInv));
View file
_service:download_files:master.tar.gz/system/shaders/yuv2rgb_d3d.fx
Changed
@@ -129,7 +129,9 @@ float4 rgb = mul(YUV, g_ColorMatrix); #if defined(XBMC_COL_CONVERSION) - rgb.rgb = pow(max(0.0, mul(pow(rgb, g_gammaSrc), g_primMat)), g_gammaDstInv).rgb; + rgb.rgb = pow(max(0.0, rgb.rgb), g_gammaSrc); + rgb.rgb = max(0.0, mul(rgb, g_primMat).rgb); + rgb.rgb = pow(rgb.rgb, g_gammaDstInv); #endif return output4(rgb, In.TextureY); }
View file
_service:download_files:master.tar.gz/tools/buildsteps/windows/vswhere.bat
Changed
@@ -24,7 +24,7 @@ ) IF "%vcstore%"=="store" ( - SET sdkver=10.0.14393.0 + SET sdkver=10.0.16299.0 SET toolsdir="win10-%toolsdir%" )
View file
_service:download_files:master.tar.gz/tools/depends/.gitignore
Changed
@@ -15,9 +15,10 @@ /target/*/x86/* /target/*/x86_64-linux-gnu-*/* /target/*/armeabi-v7a-*/* -/target/*/arm-linux-gnueabihf-*/* -/target/*/arm-linux-androideabi-*/* -/target/*/arm-linux-gnueabi-*/* +/target/*/arm*-linux-gnueabihf-*/* +/target/*/arm*-linux-androideabi-*/* +/target/*/arm*-linux-gnueabi-*/* +/target/*/aarch64-linux-gnu-*/* /target/*/macosx*.*_x86_64-target-*/ /target/*/macosx*.*_x86_64-target-*/* /target/*/macosx*.*_i386-target-*/
View file
_service:download_files:master.tar.gz/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
Changed
@@ -54,8 +54,7 @@ // amcodec include extern "C" { -#include <codec.h> -#include <amports/amstream.h> +#include <amcodec/codec.h> } // extern "C" CEvent g_aml_sync_event; @@ -345,44 +344,6 @@ int buf_avail_num; } vframe_states_t; -static int aml_ioctl_get(CODEC_HANDLE h, int subcmd, unsigned long paramter) -{ - struct am_ioctl_parm parm; - memset(&parm, 0, sizeof(parm)); - parm.cmd = subcmd; - parm.data_32 = *(unsigned int *)paramter; - if (ioctl(h, AMSTREAM_IOC_GET, (unsigned long)&parm) < 0) - { - CLog::Log(LOGERROR, "aml_ioctl_get failed: subcmd=%x, errno=%d", subcmd, errno); - return -1; - } - *(unsigned int *)paramter = parm.data_32; - return 0; -} - - -#ifndef AMSTREAM_IOC_MAGIC -#define AMSTREAM_IOC_MAGIC 'S' -#endif - -#ifndef AMSTREAM_IOC_VF_STATUS -#define AMSTREAM_IOC_VF_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x60, unsigned long) -#endif - -#ifndef AMSTREAM_IOC_GET_3D_TYPE -#define AMSTREAM_IOC_GET_3D_TYPE _IOW((AMSTREAM_IOC_MAGIC), 0x3d, unsigned int) -#endif - - -enum -{ - VPP_3D_MODE_NULL = 0, - VPP_3D_MODE_LR, - VPP_3D_MODE_TB, - VPP_3D_MODE_LA, - VPP_3D_MODE_FA -}; - /*************************************************************************/ /*************************************************************************/ void dumpfile_open(am_private_t *para) @@ -2267,65 +2228,6 @@ SysfsUtils::SetInt("/sys/class/video/saturation", saturation); } -bool CAMLCodec::SetVideo3dMode(const int mode3d) -{ - bool result = true; - if (SysfsUtils::Has("/sys/class/ppmgr/ppmgr_3d_mode")) - { - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideo3dMode:mode3d(0x%x)", mode3d); - SysfsUtils::SetInt("/sys/class/ppmgr/ppmgr_3d_mode", mode3d); - } - else - { - CLog::Log(LOGINFO, "CAMLCodec::SetVideo3dMode: ppmgr_3d support not found in kernel."); - result = false; - } - return result; -} - -std::string CAMLCodec::GetStereoMode() -{ - std::string stereoMode; - - //Get Decoder Stereo mode - int decoder_sm(VPP_3D_MODE_NULL); - aml_ioctl_get(am_private->vcodec.handle, AMSTREAM_IOC_GET_3D_TYPE, (unsigned long)&decoder_sm); - - switch (decoder_sm) - { - case VPP_3D_MODE_LR: - stereoMode = "left_right"; - break; - case VPP_3D_MODE_TB: - stereoMode = "top_bottom"; - break; - case VPP_3D_MODE_LA: - case VPP_3D_MODE_FA: - default: - switch(m_processInfo.GetVideoSettings().m_StereoMode) - { - case RENDER_STEREO_MODE_SPLIT_VERTICAL: - stereoMode = "left_right"; - break; - case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: - stereoMode = "top_bottom"; - break; - default: - stereoMode = m_hints.stereo_mode; - break; - } - } - - if (m_processInfo.GetVideoSettings().m_StereoInvert) - { - if (stereoMode == "top_bottom") - stereoMode = "bottom_top"; - else if (stereoMode == "left_right") - stereoMode = "right_left"; - } - return stereoMode; -} - void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) { // this routine gets called every video frame @@ -2362,20 +2264,20 @@ update = true; } - // video stereo mode/view. - RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); - if (m_stereo_mode != stereo_mode) + // GUI stereo mode/view. + RENDER_STEREO_MODE guiStereoMode = g_graphicsContext.GetStereoMode(); + if (m_guiStereoMode != guiStereoMode) { - m_stereo_mode = stereo_mode; + m_guiStereoMode = guiStereoMode; update = true; } - RENDER_STEREO_VIEW stereo_view = g_graphicsContext.GetStereoView(); - if (m_stereo_view != stereo_view) + RENDER_STEREO_VIEW guiStereoView = g_graphicsContext.GetStereoView(); + if (m_guiStereoView != guiStereoView) { // left/right/top/bottom eye, // this might change every other frame. // we do not care but just track it. - m_stereo_view = stereo_view; + m_guiStereoView = guiStereoView; } // dest_rect @@ -2427,9 +2329,9 @@ { float xscale = display.Width() / gui.Width(); float yscale = display.Height() / gui.Height(); - if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) xscale /= 2.0; - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) yscale /= 2.0; dst_rect.x1 *= xscale; dst_rect.x2 *= xscale; @@ -2437,75 +2339,21 @@ dst_rect.y2 *= yscale; } - if (m_stereo_mode == RENDER_STEREO_MODE_MONO) + if (m_guiStereoMode == RENDER_STEREO_MODE_MONO) { - std::string mode = GetStereoMode(); - if (mode == "left_right") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_L)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.x2 *= 2.0; - } - } - else if (mode == "right_left") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_R)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.x2 *= 2.0; - } - } - else if (mode == "top_bottom") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_T)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.y2 *= 2.0; - } - } - else if (mode == "bottom_top") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_B)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.y2 *= 2.0; - } - } - else - SetVideo3dMode(MODE_3D_DISABLE); + std::string videoStereoMode = m_processInfo.GetVideoStereoMode(); + if (videoStereoMode == "left_right" || videoStereoMode == "righ_left") + dst_rect.x2 *= 2.0; + else if (videoStereoMode == "top_bottom" || videoStereoMode == "bottom_top") + dst_rect.y2 *= 2.0; } - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) { dst_rect.x2 *= 2.0; - SetVideo3dMode(MODE_3D_DISABLE); } - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) { dst_rect.y2 *= 2.0; - SetVideo3dMode(MODE_3D_DISABLE); - } - else if (m_stereo_mode == RENDER_STEREO_MODE_INTERLACED) - { - std::string mode = GetStereoMode(); - if (mode == "left_right") - SetVideo3dMode(MODE_3D_LR); - else if (mode == "right_left") - SetVideo3dMode(MODE_3D_LR_SWITCH); - else if (mode == "row_interleaved_lr") - SetVideo3dMode(MODE_3D_LR); - else if (mode == "row_interleaved_rl") - SetVideo3dMode(MODE_3D_LR_SWITCH); - else - SetVideo3dMode(MODE_3D_DISABLE); - } - else - { - SetVideo3dMode(MODE_3D_DISABLE); } #if 1 @@ -2525,8 +2373,8 @@ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:gui(%s)", s_gui.c_str()); CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_dst_rect(%s)", s_m_dst_rect.c_str()); CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:dst_rect(%s)", s_dst_rect.c_str()); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_stereo_mode(%d)", m_stereo_mode); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_stereo_view(%d)", m_stereo_view); + CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_guiStereoMode(%d)", m_guiStereoMode); + CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_guiStereoView(%d)", m_guiStereoView); #endif // goofy 0/1 based difference in aml axis coordinates.
View file
_service:download_files:master.tar.gz/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h
Changed
@@ -71,8 +71,6 @@ void SetVideoContrast(const int contrast); void SetVideoBrightness(const int brightness); void SetVideoSaturation(const int saturation); - bool SetVideo3dMode(const int mode3d); - std::string GetStereoMode(); bool OpenAmlVideo(const CDVDStreamInfo &hints); void CloseAmlVideo(); std::string GetVfmMap(const std::string &name); @@ -96,8 +94,8 @@ CRect m_display_rect; int m_view_mode = -1; - RENDER_STEREO_MODE m_stereo_mode = RENDER_STEREO_MODE_OFF; - RENDER_STEREO_VIEW m_stereo_view = RENDER_STEREO_VIEW_OFF; + RENDER_STEREO_MODE m_guiStereoMode = RENDER_STEREO_MODE_OFF; + RENDER_STEREO_VIEW m_guiStereoView = RENDER_STEREO_VIEW_OFF; float m_zoom = -1.0f; int m_contrast = -1; int m_brightness = -1;
View file
_service:download_files:master.tar.gz/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererMediaCodecSurface.cpp
Changed
@@ -119,37 +119,39 @@ void CRendererMediaCodecSurface::RenderUpdate(int index, int index2, bool clear, unsigned int flags, unsigned int alpha) { CXBMCApp::get()->WaitVSync(100); - ManageRenderArea(); m_bConfigured = true; -} - -void CRendererMediaCodecSurface::ReorderDrawPoints() -{ - CBaseRenderer::ReorderDrawPoints(); // this hack is needed to get the 2D mode of a 3D movie going RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); if (stereo_mode) g_graphicsContext.SetStereoView(RENDER_STEREO_VIEW_LEFT); + ManageRenderArea(); + if (stereo_mode) g_graphicsContext.SetStereoView(RENDER_STEREO_VIEW_OFF); m_surfDestRect = m_destRect; - CRect srcRect(m_sourceRect); switch (stereo_mode) { case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: m_surfDestRect.y2 *= 2.0; - srcRect.y2 *= 2.0; break; case RENDER_STEREO_MODE_SPLIT_VERTICAL: m_surfDestRect.x2 *= 2.0; - srcRect.x2 *= 2.0; + break; + case RENDER_STEREO_MODE_MONO: + m_surfDestRect.y2 = m_surfDestRect.y2 * (m_surfDestRect.y2 / m_sourceRect.y2); + m_surfDestRect.x2 = m_surfDestRect.x2 * (m_surfDestRect.x2 / m_sourceRect.x2); break; default: break; } +} + +void CRendererMediaCodecSurface::ReorderDrawPoints() +{ + CBaseRenderer::ReorderDrawPoints(); // Handle orientation switch (m_renderOrientation)
View file
_service:download_files:master.tar.gz/xbmc/platform/win10/Win10App.cpp
Changed
@@ -28,6 +28,7 @@ #include "settings/AdvancedSettings.h" #include "platform/Environment.h" #include "utils/log.h" +#include "utils/SystemInfo.h" #include "windowing/win10/WinEventsWin10.h" #include "Win10App.h" @@ -83,7 +84,6 @@ // Called when the CoreWindow object is created (or re-created). void App::SetWindow(CoreWindow^ window) { - DX::CoreWindowHolder::Get()->SetWindow(window); } // Initializes scene resources, or loads a previously saved app state. @@ -105,6 +105,10 @@ CAppParamParser appParamParser; appParamParser.Parse(m_argv.data(), m_argv.size()); + + if (CSysInfo::GetWindowsDeviceFamily() == CSysInfo::Xbox) + g_application.SetStandAlone(true); + // Create and run the app XBMC_Run(true, appParamParser); } @@ -136,8 +140,18 @@ m_argv.clear(); push_back(m_argv, std::string("dummy")); + if (args->Kind == ActivationKind::Launch) + { + auto launchArgs = static_cast<LaunchActivatedEventArgs^>(args); + if (launchArgs->PrelaunchActivated) + { + // opt-out of Prelaunch + CoreApplication::Exit(); + return; + } + } // Check for protocol activation - if (args->Kind == ActivationKind::Protocol) + else if (args->Kind == ActivationKind::Protocol) { auto protocolArgs = static_cast< ProtocolActivatedEventArgs^>(args); Platform::String^ argval = protocolArgs->Uri->ToString();
View file
_service:download_files:master.tar.gz/xbmc/pvr/windows/GUIEPGGridContainer.cpp
Changed
@@ -1674,6 +1674,62 @@ SetBlock(offset); } +void CGUIEPGGridContainer::GoToTop() +{ + if (m_orientation == VERTICAL) + { + if (m_gridModel->HasChannelItems()) + GoToChannel(0); + } + else + { + if (m_gridModel->HasProgrammeItems()) + GoToBlock(0); + } +} + +void CGUIEPGGridContainer::GoToBottom() +{ + if (m_orientation == VERTICAL) + { + if (m_gridModel->HasChannelItems()) + GoToChannel(m_gridModel->ChannelItemsSize() - 1); + } + else + { + if (m_gridModel->HasProgrammeItems()) + GoToBlock(m_gridModel->ProgrammeItemsSize() - 1); + } +} + +void CGUIEPGGridContainer::GoToMostLeft() +{ + if (m_orientation == VERTICAL) + { + if (m_gridModel->HasProgrammeItems()) + GoToBlock(m_gridModel->ProgrammeItemsSize() - 1); + } + else + { + if (m_gridModel->HasChannelItems()) + GoToChannel(m_gridModel->ChannelItemsSize() - 1); + } +} + +void CGUIEPGGridContainer::GoToMostRight() +{ + if (m_orientation == VERTICAL) + { + if (m_gridModel->HasProgrammeItems()) + GoToBlock(0); + } + else + { + if (m_gridModel->HasChannelItems()) + GoToChannel(0); + } +} + void CGUIEPGGridContainer::SetTimelineItems(const std::unique_ptr<CFileItemList> &items, const CDateTime &gridStart, const CDateTime &gridEnd) { int iRulerUnit;
View file
_service:download_files:master.tar.gz/xbmc/pvr/windows/GUIEPGGridContainer.h
Changed
@@ -87,6 +87,10 @@ void GoToEnd(); void GoToNow(); void GoToDate(const CDateTime &date); + void GoToTop(); + void GoToBottom(); + void GoToMostLeft(); + void GoToMostRight(); void SetTimelineItems(const std::unique_ptr<CFileItemList> &items, const CDateTime &gridStart, const CDateTime &gridEnd); /*!
View file
_service:download_files:master.tar.gz/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
Changed
@@ -236,10 +236,69 @@ return true; } +bool CGUIWindowPVRGuideBase::ShouldNavigateToGridContainer(int iAction) +{ + CGUIEPGGridContainer *epgGridContainer = GetGridControl(); + CGUIControl* control = GetControl(CONTROL_LSTCHANNELGROUPS); + if (epgGridContainer && control && + GetFocusedControlID() == control->GetID()) + { + int iNavigationId = control->GetAction(iAction).GetNavigation(); + if (iNavigationId > 0) + { + control = epgGridContainer; + while (control != this) // navigation target could be the grid control or one of its parent controls. + { + if (iNavigationId == control->GetID()) + { + // channel group selector control's target for the action is the grid control + return true; + } + control = control->GetParentControl(); + } + } + } + return false; +} + bool CGUIWindowPVRGuideBase::OnAction(const CAction &action) { switch (action.GetID()) { + case ACTION_MOVE_UP: + case ACTION_MOVE_DOWN: + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + { + // Check whether grid container is configured as channel group selector's navigation target for the given action. + if (ShouldNavigateToGridContainer(action.GetID())) + { + CGUIEPGGridContainer *epgGridContainer = GetGridControl(); + if (epgGridContainer) + { + CGUIWindowPVRBase::OnAction(action); + + switch (action.GetID()) + { + case ACTION_MOVE_UP: + epgGridContainer->GoToBottom(); + return true; + case ACTION_MOVE_DOWN: + epgGridContainer->GoToTop(); + return true; + case ACTION_MOVE_LEFT: + epgGridContainer->GoToMostRight(); + return true; + case ACTION_MOVE_RIGHT: + epgGridContainer->GoToMostLeft(); + return true; + default: + break; + } + } + } + break; + } case REMOTE_0: if (GetCurrentDigitCount() == 0) {
View file
_service:download_files:master.tar.gz/xbmc/pvr/windows/GUIWindowPVRGuide.h
Changed
@@ -71,6 +71,8 @@ bool OnContextButtonNow(); bool OnContextButtonDate(); + bool ShouldNavigateToGridContainer(int iAction); + void StartRefreshTimelineItemsThread(); void StopRefreshTimelineItemsThread();
View file
_service:download_files:master.tar.gz/xbmc/rendering/dx/DeviceResources.h
Changed
@@ -46,7 +46,7 @@ // games attempt to render at 60 frames per second at full fidelity. // The decision to render at full fidelity across all platforms and form factors // should be deliberate. - static const bool SupportHighResolutions = false; + static const bool SupportHighResolutions = true; // The default thresholds that define a "high resolution" display. If the thresholds // are exceeded and SupportHighResolutions is false, the dimensions will be scaled
View file
_service:download_files:master.tar.gz/xbmc/rendering/dx/RenderContext.h
Changed
@@ -39,30 +39,5 @@ { return dynamic_cast<CWinSystemWin10DX&>(CServiceBroker::GetRenderSystem()); } - - class CoreWindowHolder - { - public: - static std::shared_ptr<CoreWindowHolder> Get() - { - static std::shared_ptr<CoreWindowHolder> instance(new CoreWindowHolder()); - return instance; - } - - ~CoreWindowHolder() { m_coreWindow.Release(); } - - void SetWindow(Windows::UI::Core::CoreWindow^ window) - { - m_coreWindow = window; - } - - Windows::UI::Core::CoreWindow^ GetWindow() - { - return m_coreWindow.Get(); - } - - private: - Platform::Agile<Windows::UI::Core::CoreWindow^> m_coreWindow; - }; #endif }
View file
_service:download_files:master.tar.gz/xbmc/rendering/gles/RenderSystemGLES.cpp
Changed
@@ -667,15 +667,7 @@ bool CRenderSystemGLES::SupportsStereo(RENDER_STEREO_MODE mode) const { - switch(mode) - { - case RENDER_STEREO_MODE_INTERLACED: - if (g_sysinfo.HasHW3DInterlaced()) - return true; - - default: - return CRenderSystemBase::SupportsStereo(mode); - } + return CRenderSystemBase::SupportsStereo(mode); } GLint CRenderSystemGLES::GUIShaderGetModel()
View file
_service:download_files:master.tar.gz/xbmc/utils/AMLUtils.cpp
Changed
@@ -54,22 +54,6 @@ return has_aml == 1; } -bool aml_hw3d_present() -{ - static int has_hw3d = -1; - if (has_hw3d == -1) - { - if (SysfsUtils::Has("/sys/class/ppmgr/ppmgr_3d_mode") || - SysfsUtils::Has("/sys/class/amhdmitx/amhdmitx0/config")) - has_hw3d = 1; - else - has_hw3d = 0; - if (has_hw3d) - CLog::Log(LOGNOTICE, "AML 3D support detected"); - } - return has_hw3d == 1; -} - bool aml_wired_present() { static int has_wired = -1; @@ -138,10 +122,6 @@ { CLog::Log(LOGERROR, "AML: no rw on /sys/class/audiodsp/digital_raw"); } - if (!SysfsUtils::HasRW("/sys/class/ppmgr/ppmgr_3d_mode")) - { - CLog::Log(LOGERROR, "AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode"); - } if (!SysfsUtils::HasRW("/sys/class/amhdmitx/amhdmitx0/config")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/amhdmitx/amhdmitx0/config");
View file
_service:download_files:master.tar.gz/xbmc/utils/AMLUtils.h
Changed
@@ -54,7 +54,6 @@ bool aml_present(); bool aml_permissions(); -bool aml_hw3d_present(); bool aml_wired_present(); bool aml_support_hevc(); bool aml_support_hevc_4k2k();
View file
_service:download_files:master.tar.gz/xbmc/utils/CPUInfo.cpp
Changed
@@ -157,7 +157,11 @@ m_cores[core.m_id] = core; } #elif defined(TARGET_WINDOWS_STORE) - CLog::Log(LOGDEBUG, "%s is not implemented", __FUNCTION__); + SYSTEM_INFO siSysInfo; + GetNativeSystemInfo(&siSysInfo); + m_cpuCount = siSysInfo.dwNumberOfProcessors; + m_cpuModel = "Unknown"; + #elif defined(TARGET_WINDOWS_DESKTOP) using KODI::PLATFORM::WINDOWS::FromW; @@ -688,18 +692,10 @@ bool CCPUInfo::readProcStat(unsigned long long& user, unsigned long long& nice, unsigned long long& system, unsigned long long& idle, unsigned long long& io) { -#if defined(TARGET_WINDOWS_STORE) - // introduced in 10.0.15063.0 - // auto diagnostic = Windows::System::Diagnostics::SystemDiagnosticInfo::GetForCurrentSystem(); - // auto usage = diagnostic->CpuUsage; - - // user = report->UserTime.Duration; - // system = report->KernelTime.Duration; - // idle = report->IdleTime.Duration; +#if defined(TARGET_WINDOWS) nice = 0; io = 0; - return false; -#elif defined (TARGET_WINDOWS_DESKTOP) +#if defined (TARGET_WINDOWS_DESKTOP) FILETIME idleTime; FILETIME kernelTime; FILETIME userTime; @@ -710,8 +706,6 @@ // returned "kernelTime" includes "idleTime" system = (uint64_t(kernelTime.dwHighDateTime) << 32) + uint64_t(kernelTime.dwLowDateTime) - idle; user = (uint64_t(userTime.dwHighDateTime) << 32) + uint64_t(userTime.dwLowDateTime); - nice = 0; - io = 0; if (m_cpuFreqCounter && PdhCollectQueryData(m_cpuQueryLoad) == ERROR_SUCCESS) { @@ -744,6 +738,31 @@ else for (std::map<int, CoreInfo>::iterator it = m_cores.begin(); it != m_cores.end(); ++it) it->second.m_fPct = double(m_lastUsedPercentage); // use CPU average as fallback +#endif // TARGET_WINDOWS_DESKTOP +#if defined(TARGET_WINDOWS_STORE) && defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) + // introduced in 10.0.15063.0 + if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.System.Diagnostics.SystemDiagnosticInfo")) + { + try + { + auto diagnostic = Windows::System::Diagnostics::SystemDiagnosticInfo::GetForCurrentSystem(); + auto usage = diagnostic->CpuUsage; + auto report = usage->GetReport(); + + user = report->UserTime.Duration; + idle = report->IdleTime.Duration; + system = report->KernelTime.Duration - idle; + return true; + } + catch (...) + { + // requires Win10 CU (10.0.15063) or later + return false; + } + } + else +#endif // TARGET_WINDOWS_STORE + return false; #elif defined(TARGET_FREEBSD) long *cptimes; size_t len; @@ -864,16 +883,22 @@ std::string CCPUInfo::GetCoresUsageString() const { std::string strCores; - for (std::map<int, CoreInfo>::const_iterator it = m_cores.begin(); it != m_cores.end(); ++it) + if (!m_cores.empty()) { - if (!strCores.empty()) - strCores += ' '; - if (it->second.m_fPct < 10.0) - strCores += StringUtils::Format("CPU%d: %1.1f%%", it->first, it->second.m_fPct); - else - strCores += StringUtils::Format("CPU%d: %3.0f%%", it->first, it->second.m_fPct); + for (std::map<int, CoreInfo>::const_iterator it = m_cores.begin(); it != m_cores.end(); ++it) + { + if (!strCores.empty()) + strCores += ' '; + if (it->second.m_fPct < 10.0) + strCores += StringUtils::Format("CPU%d: %1.1f%%", it->first, it->second.m_fPct); + else + strCores += StringUtils::Format("CPU%d: %3.0f%%", it->first, it->second.m_fPct); + } + } + else + { + strCores += StringUtils::Format("%3.0f%%", double(m_lastUsedPercentage)); } - return strCores; }
View file
_service:download_files:master.tar.gz/xbmc/utils/SystemInfo.cpp
Changed
@@ -828,17 +828,6 @@ return false; } -bool CSysInfo::HasHW3DInterlaced() -{ -#if defined(TARGET_ANDROID) -#if defined(HAS_LIBAMCODEC) - if (aml_hw3d_present()) - return true; -#endif -#endif - return false; -} - CSysInfo::WindowsVersion CSysInfo::m_WinVer = WindowsVersionUnknown; bool CSysInfo::IsWindowsVersion(WindowsVersion ver)
View file
_service:download_files:master.tar.gz/xbmc/utils/SystemInfo.h
Changed
@@ -126,7 +126,6 @@ bool HasInternet(); bool HasVideoToolBoxDecoder(); bool IsAeroDisabled(); - bool HasHW3DInterlaced(); static bool IsWindowsVersion(WindowsVersion ver); static bool IsWindowsVersionAtLeast(WindowsVersion ver); static WindowsVersion GetWindowsVersion();
View file
_service:download_files:master.tar.gz/xbmc/windowing/win10/WinEventsWin10.cpp
Changed
@@ -29,6 +29,7 @@ #include "messaging/ApplicationMessenger.h" #include "platform/win10/input/RemoteControlXbox.h" #include "rendering/dx/DeviceResources.h" +#include "platform/win10/AsyncHelpers.h" #include "rendering/dx/RenderContext.h" #include "utils/log.h" #include "utils/SystemInfo.h" @@ -108,6 +109,21 @@ window->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>([&](CoreWindow^ wnd, WindowSizeChangedEventArgs^ args) { OnWindowSizeChanged(wnd, args); }); +#if defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) + try + { + window->ResizeStarted += ref new TypedEventHandler<CoreWindow^, Platform::Object^>([&](CoreWindow^ wnd, Platform::Object^ args) { + OnWindowResizeStarted(wnd, args); + }); + window->ResizeCompleted += ref new TypedEventHandler<CoreWindow^, Platform::Object^>([&](CoreWindow^ wnd, Platform::Object^ args) { + OnWindowResizeCompleted(wnd, args); + }); + } + catch (Platform::Exception^ ex) + { + // Win10 Creators Update is required + } +#endif window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>([&](CoreWindow^ wnd, CoreWindowEventArgs^ args) { OnWindowClosed(wnd, args); }); @@ -191,8 +207,51 @@ // Window event handlers. void CWinEventsWin10::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) { - DX::Windowing().OnResize(args->Size.Width, args->Size.Height); - UpdateWindowSize(); + CLog::Log(LOGDEBUG, __FUNCTION__": window size changed."); + m_logicalWidth = args->Size.Width; + m_logicalHeight = args->Size.Height; + m_bResized = true; + + if (m_sizeChanging) + return; + + HandleWindowSizeChanged(); +} + +void CWinEventsWin10::OnWindowResizeStarted(Windows::UI::Core::CoreWindow^ sender, Platform::Object ^ args) +{ + CLog::Log(LOGDEBUG, __FUNCTION__": window resize started."); + m_logicalPosX = sender->Bounds.X; + m_logicalPosY = sender->Bounds.Y; + m_sizeChanging = true; +} + +void CWinEventsWin10::OnWindowResizeCompleted(Windows::UI::Core::CoreWindow^ sender, Platform::Object ^ args) +{ + CLog::Log(LOGDEBUG, __FUNCTION__": window resize completed."); + m_sizeChanging = false; + + if (m_logicalPosX != sender->Bounds.X || m_logicalPosY != sender->Bounds.Y) + m_bMoved = true; + + HandleWindowSizeChanged(); +} + +void CWinEventsWin10::HandleWindowSizeChanged() +{ + CLog::Log(LOGDEBUG, __FUNCTION__": window size/move handled."); + if (m_bMoved) + { + // it will get position from CoreWindow + DX::Windowing().OnMove(0, 0); + } + if (m_bResized) + { + DX::Windowing().OnResize(m_logicalWidth, m_logicalHeight); + UpdateWindowSize(); + } + m_bResized = false; + m_bMoved = false; } void CWinEventsWin10::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) @@ -487,7 +546,7 @@ void CWinEventsWin10::OnDisplayContentsInvalidated(DisplayInformation^ sender, Platform::Object^ args) { - //critical_section::scoped_lock lock(m_deviceResources->GetCriticalSection()); + CLog::Log(LOGDEBUG, __FUNCTION__": onevent."); DX::DeviceResources::Get()->ValidateDevice(); }
View file
_service:download_files:master.tar.gz/xbmc/windowing/win10/WinEventsWin10.h
Changed
@@ -26,6 +26,7 @@ #include "interfaces/IAnnouncer.h" #include "windowing/WinEvents.h" #include <concurrent_queue.h> +#include <cmath> class CWinEventsWin10 : public IWinEvents , public ANNOUNCEMENT::IAnnouncer @@ -41,6 +42,8 @@ // Window event handlers. void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); + void OnWindowResizeStarted(Windows::UI::Core::CoreWindow^ sender, Platform::Object^ args); + void OnWindowResizeCompleted(Windows::UI::Core::CoreWindow^ sender, Platform::Object^ args); void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); static void OnWindowActivationChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowActivatedEventArgs^ args); static void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); @@ -65,10 +68,21 @@ void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) override; private: + friend class CWinSystemWin10; + void UpdateWindowSize(); void Kodi_KeyEvent(unsigned int vkey, unsigned scancode, unsigned keycode, bool isDown); + void HandleWindowSizeChanged(); + Concurrency::concurrent_queue<XBMC_Event> m_events; Windows::Media::SystemMediaTransportControls^ m_smtc{ nullptr }; + bool m_bResized{ false }; + bool m_bMoved{ false }; + bool m_sizeChanging{ false }; + float m_logicalWidth{ 0 }; + float m_logicalHeight{ 0 }; + float m_logicalPosX{ 0 }; + float m_logicalPosY{ 0 }; }; #endif // WINDOW_EVENTS_WIN10_H
View file
_service:download_files:master.tar.gz/xbmc/windowing/win10/WinSystemWin10.cpp
Changed
@@ -25,17 +25,18 @@ #include "guilib/gui3d.h" #include "guilib/GraphicContext.h" #include "messaging/ApplicationMessenger.h" +#include "platform/win10/AsyncHelpers.h" #include "platform/win10/input/RemoteControlXbox.h" #include "platform/win32/CharsetConverter.h" #include "powermanagement/win10/Win10PowerSyscall.h" #include "rendering/dx/DirectXHelper.h" +#include "rendering/dx/RenderContext.h" #include "ServiceBroker.h" #include "settings/AdvancedSettings.h" #include "settings/DisplaySettings.h" #include "settings/Settings.h" #include "threads/SingleLock.h" #include "utils/log.h" -#include "utils/CharsetConverter.h" #include "utils/SystemInfo.h" #include "windowing/windows/VideoSyncD3D.h" #include "WinEventsWin10.h" @@ -43,9 +44,16 @@ #pragma pack(push,8) +#include <collection.h> #include <tpcshrd.h> #include <ppltasks.h> +using namespace Windows::Graphics::Display; +#if defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) +using namespace Windows::Graphics::Display::Core; +#endif +using namespace Windows::UI::ViewManagement; + CWinSystemWin10::CWinSystemWin10() : CWinSystemBase() , m_nPrimary(0) @@ -96,6 +104,7 @@ bool CWinSystemWin10::DestroyWindowSystem() { + m_bWindowCreated = false; RestoreDesktopResolution(m_nScreen); return true; } @@ -174,9 +183,12 @@ m_nWidth = newWidth; m_nHeight = newHeight; - auto appView = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView(); - appView->PreferredLaunchViewSize = Windows::Foundation::Size(m_nWidth, m_nHeight); - appView->PreferredLaunchWindowingMode = Windows::UI::ViewManagement::ApplicationViewWindowingMode::PreferredLaunchViewSize; + float dpi = DX::DeviceResources::Get()->GetDpi(); + int dipsWidth = round(DX::ConvertPixelsToDips(m_nWidth, dpi)); + int dipsHeight = round(DX::ConvertPixelsToDips(m_nHeight, dpi)); + + ApplicationView::PreferredLaunchViewSize = Windows::Foundation::Size(dipsWidth, dipsHeight); + ApplicationView::PreferredLaunchWindowingMode = ApplicationViewWindowingMode::PreferredLaunchViewSize; } void CWinSystemWin10::AdjustWindow(bool forceResize) @@ -191,7 +203,7 @@ if (!isInFullscreen) { if (appView->TryEnterFullScreenMode()) - appView->PreferredLaunchWindowingMode = Windows::UI::ViewManagement::ApplicationViewWindowingMode::FullScreen; + ApplicationView::PreferredLaunchWindowingMode = ApplicationViewWindowingMode::FullScreen; } } else // m_state == WINDOW_STATE_WINDOWED @@ -203,16 +215,21 @@ int viewWidth = appView->VisibleBounds.Width; int viewHeight = appView->VisibleBounds.Height; - if (viewHeight != m_nHeight || viewWidth != m_nWidth) + + float dpi = DX::DeviceResources::Get()->GetDpi(); + int dipsWidth = round(DX::ConvertPixelsToDips(m_nWidth, dpi)); + int dipsHeight = round(DX::ConvertPixelsToDips(m_nHeight, dpi)); + + if (viewHeight != dipsHeight || viewWidth != dipsWidth) { - if (!appView->TryResizeView(Windows::Foundation::Size(m_nWidth, m_nHeight))) + if (!appView->TryResizeView(Windows::Foundation::Size(dipsWidth, dipsHeight))) { CLog::LogF(LOGDEBUG, __FUNCTION__, "resizing ApplicationView failed."); } } - appView->PreferredLaunchViewSize = Windows::Foundation::Size(m_nWidth, m_nHeight); - appView->PreferredLaunchWindowingMode = Windows::UI::ViewManagement::ApplicationViewWindowingMode::PreferredLaunchViewSize; + ApplicationView::PreferredLaunchViewSize = Windows::Foundation::Size(dipsWidth, dipsHeight); + ApplicationView::PreferredLaunchWindowingMode = ApplicationViewWindowingMode::PreferredLaunchViewSize; } } @@ -265,7 +282,7 @@ } m_IsAlteringWindow = true; - //ReleaseBackBuffer(); + ReleaseBackBuffer(); if (changeScreen) { @@ -322,7 +339,7 @@ if (changeScreen) CenterCursor(); - //CreateBackBuffer(); + CreateBackBuffer(); m_IsAlteringWindow = false; return true; } @@ -395,9 +412,61 @@ if (!details) return false; - CLog::Log(LOGDEBUG, "%s is not implemented", __FUNCTION__); +#if defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) + if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Graphics.Display.Core.HdmiDisplayInformation")) + { + bool changed = false; + auto hdmiInfo = HdmiDisplayInformation::GetForCurrentView(); + if (hdmiInfo != nullptr) + { + // default mode not in list of supported display modes + if (res.iScreenWidth == details->ScreenWidth && res.iScreenHeight == details->ScreenHeight + && fabs(res.fRefreshRate - details->RefreshRate) <= 0.00001) + { + Wait(hdmiInfo->SetDefaultDisplayModeAsync()); + changed = true; + } + else + { + bool needStereo = g_graphicsContext.GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED; + auto hdmiModes = hdmiInfo->GetSupportedDisplayModes(); + + HdmiDisplayMode^ selected = nullptr; + for (auto mode : Windows::Foundation::Collections::to_vector(hdmiModes)) + { + if (res.iScreenWidth == mode->ResolutionWidthInRawPixels && res.iScreenHeight == mode->ResolutionHeightInRawPixels + && fabs(res.fRefreshRate - mode->RefreshRate) <= 0.00001) + { + selected = mode; + if (needStereo == mode->StereoEnabled) + break; + } + } + + if (selected != nullptr) + { + changed = Wait(hdmiInfo->RequestSetCurrentDisplayModeAsync(selected)); + } + } + } - return true; + // changing display mode doesn't cause OnResize event + // for CoreWindow, so we "emulate" it manually + if (changed && m_bWindowCreated) + { + float dpi = DisplayInformation::GetForCurrentView()->LogicalDpi; + float dipsW = DX::ConvertPixelsToDips(m_nWidth, dpi); + float dipsH = DX::ConvertPixelsToDips(m_nHeight, dpi); + + DX::Windowing().OnResize(dipsW, dipsH); + dynamic_cast<CWinEventsWin10*>(m_winEvents.get())->UpdateWindowSize(); + } + return changed; + } +#endif + + CLog::LogFunction(LOGDEBUG, __FUNCTION__, "Not supported."); + return false; } void CWinSystemWin10::UpdateResolutions() @@ -428,6 +497,24 @@ UpdateDesktopResolution(CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP), 0, w, h, refreshRate, dwFlags); CLog::Log(LOGNOTICE, "Primary mode: %s", CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP).strMode.c_str()); +#if defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) + if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Graphics.Display.Core.HdmiDisplayInformation")) + { + auto hdmiInfo = HdmiDisplayInformation::GetForCurrentView(); + if (hdmiInfo != nullptr) + { + auto hdmiModes = hdmiInfo->GetSupportedDisplayModes(); + for (auto mode : Windows::Foundation::Collections::to_vector(hdmiModes)) + { + RESOLUTION_INFO res; + UpdateDesktopResolution(res, 0, mode->ResolutionWidthInRawPixels, mode->ResolutionHeightInRawPixels, mode->RefreshRate, 0); + AddResolution(res); + CLog::Log(LOGNOTICE, "Additional mode: %s %s", res.strMode.c_str(), mode->Is2086MetadataSupported ? "(HDR)" : ""); + } + } + } +#endif + // Desktop resolution of the other screens if (m_MonitorsInfo.size() >= 2) { @@ -481,24 +568,24 @@ { MONITOR_DETAILS md = {}; - auto displayInfo = Windows::Graphics::Display::DisplayInformation::GetForCurrentView(); + auto displayInfo = DisplayInformation::GetForCurrentView(); bool flipResolution = false; switch (displayInfo->NativeOrientation) { - case Windows::Graphics::Display::DisplayOrientations::Landscape: + case DisplayOrientations::Landscape: switch (displayInfo->CurrentOrientation) { - case Windows::Graphics::Display::DisplayOrientations::Portrait: - case Windows::Graphics::Display::DisplayOrientations::PortraitFlipped: + case DisplayOrientations::Portrait: + case DisplayOrientations::PortraitFlipped: flipResolution = true; break; } break; - case Windows::Graphics::Display::DisplayOrientations::Portrait: + case DisplayOrientations::Portrait: switch (displayInfo->CurrentOrientation) { - case Windows::Graphics::Display::DisplayOrientations::Landscape: - case Windows::Graphics::Display::DisplayOrientations::LandscapeFlipped: + case DisplayOrientations::Landscape: + case DisplayOrientations::LandscapeFlipped: flipResolution = true; break; } @@ -507,8 +594,29 @@ md.ScreenWidth = flipResolution ? displayInfo->ScreenHeightInRawPixels : displayInfo->ScreenWidthInRawPixels; md.ScreenHeight = flipResolution ? displayInfo->ScreenWidthInRawPixels : displayInfo->ScreenHeightInRawPixels; - // note that refresh rate information is not available on Win10 UWP - md.RefreshRate = 60; + if (Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Graphics.Display.Core.HdmiDisplayInformation")) + { +#if defined(NTDDI_WIN10_RS2) && (NTDDI_VERSION >= NTDDI_WIN10_RS2) + auto hdmiInfo = HdmiDisplayInformation::GetForCurrentView(); + if (hdmiInfo != nullptr) + { + auto currentMode = hdmiInfo->GetCurrentDisplayMode(); + md.RefreshRate = currentMode->RefreshRate; + md.Bpp = currentMode->BitsPerPixel; + } + else +#endif + { + md.RefreshRate = 60.0; + md.Bpp = 24; + } + } + else + { + // note that refresh rate information is not available on Win10 UWP + md.RefreshRate = 60.0; + md.Bpp = 24; + } md.Interlaced = false; m_MonitorsInfo.push_back(md); @@ -517,7 +625,7 @@ if (dispatcher->HasThreadAccess) handler->Invoke(); else - Concurrency::create_task(dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, handler)).wait(); + Wait(dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::High, handler)); return true; } @@ -632,14 +740,11 @@ auto contentView = Windows::ApplicationModel::DataTransfer::Clipboard::GetContent(); if (contentView->Contains(Windows::ApplicationModel::DataTransfer::StandardDataFormats::Text)) { - Concurrency::create_task(contentView->GetTextAsync()).then([&unicode_text](Platform::String^ str) - { - unicode_text.append(str->Data()); - }).wait(); + auto text = Wait(contentView->GetTextAsync()); + unicode_text.append(text->Data()); } - g_charsetConverter.wToUTF8(unicode_text, utf8_text); - return utf8_text; + return KODI::PLATFORM::WINDOWS::FromW(unicode_text); } void CWinSystemWin10::NotifyAppFocusChange(bool bGaining) @@ -649,10 +754,6 @@ void CWinSystemWin10::UpdateStates(bool fullScreen) { - //m_fullscreenState = CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOSCREEN_FAKEFULLSCREEN) - // ? WINDOW_FULLSCREEN_STATE_FULLSCREEN_WINDOW - // : WINDOW_FULLSCREEN_STATE_FULLSCREEN; - m_fullscreenState = WINDOW_FULLSCREEN_STATE_FULLSCREEN_WINDOW; // currently only this allowed m_windowState = WINDOW_WINDOW_STATE_WINDOWED; // currently only this allowed }
View file
_service:download_files:master.tar.gz/xbmc/windowing/win10/WinSystemWin10.h
Changed
@@ -72,7 +72,7 @@ // Windows desktop info int ScreenWidth; int ScreenHeight; - int RefreshRate; + float RefreshRate; int Bpp; bool Interlaced;
View file
_service:download_files:master.tar.gz/xbmc/windowing/win10/WinSystemWin10DX.cpp
Changed
@@ -74,6 +74,7 @@ { CGenericTouchInputHandler::GetInstance().RegisterHandler(&CGenericTouchActionHandler::GetInstance()); CGenericTouchInputHandler::GetInstance().SetScreenDPI(DX::DisplayMetrics::Dpi100); + ChangeResolution(res, true); } return created; } @@ -122,6 +123,7 @@ void CWinSystemWin10DX::OnMove(int x, int y) { + m_deviceResources->SetWindowPos(m_coreWindow->Bounds); } bool CWinSystemWin10DX::DPIChanged(WORD dpi, RECT windowRect) const @@ -155,6 +157,9 @@ void CWinSystemWin10DX::OnResize(int width, int height) { + if (!m_deviceResources) + return; + if (!m_IsAlteringWindow) ReleaseBackBuffer();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.