Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Interface to describe CBufferObjects. More...
#include <IBufferObject.h>
Public Member Functions | |
virtual | ~IBufferObject ()=default |
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 bool | CreateBufferObject (uint64_t size)=0 |
Create a BufferObject based only on the size of the desired buffer. Not all CBufferObject implementations may support this. This method is required for use with the CAddonVideoCodec as it only knows the decoded buffer size. | |
virtual void | DestroyBufferObject ()=0 |
Destroy a BufferObject. | |
virtual uint8_t * | GetMemory ()=0 |
Get the Memory location of the BufferObject. This method needs to be called to be able to copy data into the BufferObject. | |
virtual void | ReleaseMemory ()=0 |
Release the mapped memory of the BufferObject. After calling this the memory location pointed to by GetMemory() will be invalid. | |
virtual int | GetFd ()=0 |
Get the File Descriptor of the BufferObject. The fd is guaranteed to be available after calling CreateBufferObject(). | |
virtual uint32_t | GetStride ()=0 |
Get the Stride of the BufferObject. The stride is guaranteed to be available after calling GetMemory(). | |
virtual uint64_t | GetModifier ()=0 |
Get the Modifier of the BufferObject. Format Modifiers further describe the buffer's format such as for tiling or compression. see https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h. | |
virtual void | SyncStart ()=0 |
Must be called before reading/writing data to the BufferObject. | |
virtual void | SyncEnd ()=0 |
Must be called after reading/writing data to the BufferObject. | |
virtual std::string | GetName () const =0 |
Get the Name of the BufferObject type in use. | |
Interface to describe CBufferObjects.
BufferObjects are used to abstract various memory types and present them with a generic interface. Typically on a posix system exists the concept of Direct Memory Access (DMA) which allows various systems to interact with a memory location directly without having to copy the data into userspace (ie. from kernel space). These DMA buffers are presented as file descriptors (fds) which can be passed around to gain access to the buffers memory location. In order to write to these buffer types typically the memory location has to be mapped into userspace via a call to mmap (or similar). This presents userspace with a memory location that can be initially written to (ie. by using memcpy or similar). Depending on the underlying implementation a stride might be specified if the memory type requires padding to a certain size (such as page size). The stride must be used when copying into the buffer. Some memory implementation may provide special memory layouts in which case modifiers are provided that describe tiling or compression. This should be transparent to the caller as the data copied into a BufferObject will likely be linear. The modifier will be needed when presenting the buffer via DRM or EGL even if it is linear.
|
virtualdefault |
|
pure virtual |
Create a BufferObject based on the format, width, and height of the desired buffer.
format | framebuffer pixel formats are described using the fourcc codes defined in https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h |
width | width of the requested buffer. |
height | height of the requested buffer. |
Implemented in CBufferObject, CDMAHeapBufferObject, CDumbBufferObject, CGBMBufferObject, and CUDMABufferObject.
|
pure virtual |
Create a BufferObject based only on the size of the desired buffer. Not all CBufferObject implementations may support this. This method is required for use with the CAddonVideoCodec as it only knows the decoded buffer size.
size | of the requested buffer. |
Implemented in CBufferObject, CDMAHeapBufferObject, and CUDMABufferObject.
|
pure virtual |
Destroy a BufferObject.
Implemented in CDMAHeapBufferObject, CDumbBufferObject, CGBMBufferObject, and CUDMABufferObject.
|
pure virtual |
Get the File Descriptor of the BufferObject. The fd is guaranteed to be available after calling CreateBufferObject().
Implemented in CBufferObject.
|
pure virtual |
Get the Memory location of the BufferObject. This method needs to be called to be able to copy data into the BufferObject.
Implemented in CDMAHeapBufferObject, CDumbBufferObject, CGBMBufferObject, and CUDMABufferObject.
|
pure virtual |
Get the Modifier of the BufferObject. Format Modifiers further describe the buffer's format such as for tiling or compression. see https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h.
Implemented in CBufferObject, and CGBMBufferObject.
|
pure virtual |
Get the Name of the BufferObject type in use.
Implemented in CDMAHeapBufferObject, CDumbBufferObject, CGBMBufferObject, and CUDMABufferObject.
|
pure virtual |
Get the Stride of the BufferObject. The stride is guaranteed to be available after calling GetMemory().
Implemented in CBufferObject.
|
pure virtual |
Release the mapped memory of the BufferObject. After calling this the memory location pointed to by GetMemory() will be invalid.
Implemented in CDMAHeapBufferObject, CDumbBufferObject, CGBMBufferObject, and CUDMABufferObject.
|
pure virtual |
Must be called after reading/writing data to the BufferObject.
Implemented in CBufferObject.
|
pure virtual |
Must be called before reading/writing data to the BufferObject.
Implemented in CBufferObject.