diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/GBMBufferObject.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/utils/GBMBufferObject.h')
| -rw-r--r-- | xbmc/utils/GBMBufferObject.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/xbmc/utils/GBMBufferObject.h b/xbmc/utils/GBMBufferObject.h new file mode 100644 index 0000000..ae8de58 --- /dev/null +++ b/xbmc/utils/GBMBufferObject.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-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 "utils/BufferObject.h" | ||
| 12 | |||
| 13 | #include <memory> | ||
| 14 | #include <stdint.h> | ||
| 15 | |||
| 16 | struct gbm_bo; | ||
| 17 | struct gbm_device; | ||
| 18 | |||
| 19 | class CGBMBufferObject : public CBufferObject | ||
| 20 | { | ||
| 21 | public: | ||
| 22 | CGBMBufferObject(); | ||
| 23 | ~CGBMBufferObject() override; | ||
| 24 | |||
| 25 | // Registration | ||
| 26 | static std::unique_ptr<CBufferObject> Create(); | ||
| 27 | static void Register(); | ||
| 28 | |||
| 29 | // IBufferObject overrides via CBufferObject | ||
| 30 | bool CreateBufferObject(uint32_t format, uint32_t width, uint32_t height) override; | ||
| 31 | void DestroyBufferObject() override; | ||
| 32 | uint8_t* GetMemory() override; | ||
| 33 | void ReleaseMemory() override; | ||
| 34 | std::string GetName() const override { return "CGBMBufferObject"; } | ||
| 35 | |||
| 36 | // CBufferObject overrides | ||
| 37 | uint64_t GetModifier() override; | ||
| 38 | |||
| 39 | private: | ||
| 40 | gbm_device* m_device{nullptr}; | ||
| 41 | gbm_bo* m_bo{nullptr}; | ||
| 42 | |||
| 43 | uint32_t m_width{0}; | ||
| 44 | uint32_t m_height{0}; | ||
| 45 | |||
| 46 | uint8_t* m_map{nullptr}; | ||
| 47 | void* m_map_data{nullptr}; | ||
| 48 | }; | ||
