diff options
Diffstat (limited to 'xbmc/utils/IScreenshotSurface.h')
-rw-r--r-- | xbmc/utils/IScreenshotSurface.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xbmc/utils/IScreenshotSurface.h b/xbmc/utils/IScreenshotSurface.h new file mode 100644 index 0000000..ba3fa6a --- /dev/null +++ b/xbmc/utils/IScreenshotSurface.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +class IScreenshotSurface +{ +public: + virtual ~IScreenshotSurface() = default; + virtual bool Capture() { return false; } + virtual void CaptureVideo(bool blendToBuffer) {} + + int GetWidth() const { return m_width; } + int GetHeight() const { return m_height; } + int GetStride() const { return m_stride; } + unsigned char* GetBuffer() const { return m_buffer; } + void ReleaseBuffer() + { + if (m_buffer) + { + delete m_buffer; + m_buffer = nullptr; + } + }; + +protected: + int m_width{0}; + int m_height{0}; + int m_stride{0}; + unsigned char* m_buffer{nullptr}; +}; |