kodi
GpuInfo.h
1 /*
2  * Copyright (C) 2023 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 "utils/Temperature.h"
12 
13 #include <memory>
14 #include <string>
15 
19 class CGPUInfo
20 {
21 public:
22  CGPUInfo() = default;
23  virtual ~CGPUInfo() = default;
24 
28  static std::unique_ptr<CGPUInfo> GetGPUInfo();
29 
34  bool GetTemperature(CTemperature& temperature) const;
35 
36 protected:
43  virtual bool SupportsCustomTemperatureCommand() const { return false; }
44 
50  virtual bool SupportsPlatformTemperature() const { return false; }
51 
57  virtual bool GetGPUPlatformTemperature(CTemperature& temperature) const = 0;
58 
64  virtual bool GetGPUTemperatureFromCommand(CTemperature& temperature,
65  const std::string& cmd) const = 0;
66 };
static std::unique_ptr< CGPUInfo > GetGPUInfo()
Getter from the specific platform GPUInfo.
Definition: GPUInfoAndroid.cpp:11
Class to concentrate all methods related to GPU information.
Definition: GpuInfo.h:19
virtual bool SupportsCustomTemperatureCommand() const
Checks if the specific platform implementation supports obtaining the GPU temperature via the executi...
Definition: GpuInfo.h:43
Definition: Temperature.h:15
bool GetTemperature(CTemperature &temperature) const
Get the temperature of the GPU.
Definition: GpuInfo.cpp:15
virtual bool SupportsPlatformTemperature() const
Checks if the specific platform implementation supports obtaining the GPU temperature from the platfo...
Definition: GpuInfo.h:50
virtual bool GetGPUTemperatureFromCommand(CTemperature &temperature, const std::string &cmd) const =0
Get the GPU temperature from a user provided command (advanced settings)
virtual bool GetGPUPlatformTemperature(CTemperature &temperature) const =0
Get the GPU temperature from the platform SDK.