Merge pull request #26166 from ksooo/improve-plugin-ctx-menus
[xbmc.git] / xbmc / utils / UDMABufferObject.h
bloba8425600b66592ffee5e4a307b9e1cb1a87ea79f
1 /*
2 * Copyright (C) 2005-2020 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.
7 */
9 #pragma once
11 #include "utils/BufferObject.h"
13 #include <memory>
14 #include <stdint.h>
16 class CUDMABufferObject : public CBufferObject
18 public:
19 CUDMABufferObject() = default;
20 virtual ~CUDMABufferObject() override;
22 // Registration
23 static std::unique_ptr<CBufferObject> Create();
24 static void Register();
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"; }
34 private:
35 int m_memfd{-1};
36 int m_udmafd{-1};
37 uint64_t m_size{0};
38 uint8_t* m_map{nullptr};