summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/GBMBufferObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/GBMBufferObject.h')
-rw-r--r--xbmc/utils/GBMBufferObject.h48
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
16struct gbm_bo;
17struct gbm_device;
18
19class CGBMBufferObject : public CBufferObject
20{
21public:
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
39private:
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};