summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/UDMABufferObject.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/UDMABufferObject.h
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/utils/UDMABufferObject.h')
-rw-r--r--xbmc/utils/UDMABufferObject.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/xbmc/utils/UDMABufferObject.h b/xbmc/utils/UDMABufferObject.h
new file mode 100644
index 0000000..a842560
--- /dev/null
+++ b/xbmc/utils/UDMABufferObject.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2005-2020 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
16class CUDMABufferObject : public CBufferObject
17{
18public:
19 CUDMABufferObject() = default;
20 virtual ~CUDMABufferObject() override;
21
22 // Registration
23 static std::unique_ptr<CBufferObject> Create();
24 static void Register();
25
26 // IBufferObject overrides via CBufferObject
27 bool CreateBufferObject(uint32_t format, uint32_t width, uint32_t height) override;
28 bool CreateBufferObject(uint64_t size) override;
29 void DestroyBufferObject() override;
30 uint8_t* GetMemory() override;
31 void ReleaseMemory() override;
32 std::string GetName() const override { return "CUDMABufferObject"; }
33
34private:
35 int m_memfd{-1};
36 int m_udmafd{-1};
37 uint64_t m_size{0};
38 uint8_t* m_map{nullptr};
39};