2 * Copyright (C) 2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "utils/Temperature.h"
16 /*! \brief Class to concentrate all methods related to GPU information
17 * \details This is used by the Info interface to obtain the current GPU temperature
23 virtual ~CGPUInfo() = default;
25 /*! \brief Getter from the specific platform GPUInfo
26 \return the platform specific implementation of GPUInfo
28 static std::unique_ptr
<CGPUInfo
> GetGPUInfo();
30 /*! \brief Get the temperature of the GPU
31 \param[in,out] temperature - the temperature to fill with the result
32 \return true if it was possible to obtain the GPU temperature, false otherwise
34 bool GetTemperature(CTemperature
& temperature
) const;
37 /*! \brief Checks if the specific platform implementation supports obtaining the GPU temperature
38 via the execution of a custom command line command
39 \note this is false on the base class but may be overridden by the specific platform implementation.
40 Custom GPU command is defined in advancedsettings.
41 \return true if the implementation supports obtaining the GPU temperature from a custom command, false otherwise
43 virtual bool SupportsCustomTemperatureCommand() const { return false; }
45 /*! \brief Checks if the specific platform implementation supports obtaining the GPU temperature
46 from the platform SDK itself
47 \note this is false on the base class but may be overridden by the specific platform implementation.
48 \return true if the implementation supports obtaining the GPU temperature from the platform SDK, false otherwise
50 virtual bool SupportsPlatformTemperature() const { return false; }
52 /*! \brief Get the GPU temperature from the platform SDK
53 \note platform implementations must override this. For this to take effect SupportsPlatformTemperature must be true.
54 \param[in,out] temperature - the temperature to fill with the result
55 \return true if obtaining the GPU temperature succeeded, false otherwise
57 virtual bool GetGPUPlatformTemperature(CTemperature
& temperature
) const = 0;
59 /*! \brief Get the GPU temperature from a user provided command (advanced settings)
60 \note platform implementations must override this. For this to take effect SupportsCustomTemperatureCommand must be true.
61 \param[in,out] temperature - the temperature to fill with the result
62 \return true if obtaining the GPU temperature succeeded, false otherwise
64 virtual bool GetGPUTemperatureFromCommand(CTemperature
& temperature
,
65 const std::string
& cmd
) const = 0;