kodi
IBufferObject.h
1 /*
2  * Copyright (C) 2017-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 <stdint.h>
12 #include <string>
13 
40 {
41 public:
42  virtual ~IBufferObject() = default;
43 
54  virtual bool CreateBufferObject(uint32_t format, uint32_t width, uint32_t height) = 0;
55 
65  virtual bool CreateBufferObject(uint64_t size) = 0;
66 
71  virtual void DestroyBufferObject() = 0;
72 
79  virtual uint8_t *GetMemory() = 0;
80 
86  virtual void ReleaseMemory() = 0;
87 
94  virtual int GetFd() = 0;
95 
102  virtual uint32_t GetStride() = 0;
103 
111  virtual uint64_t GetModifier() = 0;
112 
117  virtual void SyncStart() = 0;
118 
123  virtual void SyncEnd() = 0;
124 
130  virtual std::string GetName() const = 0;
131 };
virtual std::string GetName() const =0
Get the Name of the BufferObject type in use.
virtual void SyncStart()=0
Must be called before reading/writing data to the BufferObject.
Interface to describe CBufferObjects.
Definition: IBufferObject.h:39
virtual void SyncEnd()=0
Must be called after reading/writing data to the BufferObject.
virtual void DestroyBufferObject()=0
Destroy a BufferObject.
virtual int GetFd()=0
Get the File Descriptor of the BufferObject.
virtual uint8_t * GetMemory()=0
Get the Memory location of the BufferObject.
virtual void ReleaseMemory()=0
Release the mapped memory of the BufferObject.
virtual uint64_t GetModifier()=0
Get the Modifier of the BufferObject.
virtual bool CreateBufferObject(uint32_t format, uint32_t width, uint32_t height)=0
Create a BufferObject based on the format, width, and height of the desired buffer.
virtual uint32_t GetStride()=0
Get the Stride of the BufferObject.