| 1 |
/* |
| 2 |
* Copyright (C) 2011-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "settings/lib/ISettingCallback.h" |
| 12 |
#include "utils/HDRCapabilities.h" |
| 13 |
#include "windowing/Resolution.h" |
| 14 |
|
| 15 |
#include <string> |
| 16 |
#include <vector> |
| 17 |
|
| 18 |
#include <androidjni/Display.h> |
| 19 |
|
| 20 |
class CAndroidUtils : public ISettingCallback |
| 21 |
{ |
| 22 |
public: |
| 23 |
CAndroidUtils(); |
| 24 |
~CAndroidUtils() override = default; |
| 25 |
bool GetNativeResolution(RESOLUTION_INFO* res) const; |
| 26 |
bool SetNativeResolution(const RESOLUTION_INFO& res); |
| 27 |
bool ProbeResolutions(std::vector<RESOLUTION_INFO>& resolutions); |
| 28 |
bool UpdateDisplayModes(); |
| 29 |
bool IsHDRDisplay(); |
| 30 |
|
| 31 |
// Implementation of ISettingCallback |
| 32 |
static const std::string SETTING_LIMITGUI; |
| 33 |
void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override; |
| 34 |
|
| 35 |
static bool SupportsMediaCodecMimeType(const std::string& mimeType); |
| 36 |
|
| 37 |
static std::vector<int> GetDisplaySupportedHdrTypes(); |
| 38 |
static CHDRCapabilities GetDisplayHDRCapabilities(); |
| 39 |
static std::pair<bool, bool> GetDolbyVisionCapabilities(); |
| 40 |
|
| 41 |
protected: |
| 42 |
mutable int m_width; |
| 43 |
mutable int m_height; |
| 44 |
|
| 45 |
private: |
| 46 |
static void LogDisplaySupportedHdrTypes(); |
| 47 |
}; |