Merge pull request #26148 from ksooo/fix-secondstotimestring-warning
[xbmc.git] / xbmc / utils / DMAHeapBufferObject.h
blobeb7a6fee6defdd2509ab90fb488f1de2aa163cee
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 CDMAHeapBufferObject : public CBufferObject
18 public:
19 CDMAHeapBufferObject() = default;
20 virtual ~CDMAHeapBufferObject() 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 "CDMAHeapBufferObject"; }
34 private:
35 int m_dmaheapfd{-1};
36 uint64_t m_size{0};
37 uint8_t* m_map{nullptr};