vdr-plugin-softhddevice-drm-gles 1.4.0
Macros | Functions | Variables
drmbuffer.cpp File Reference

DRM buffer class. More...

#include <fcntl.h>
#include "drmdevice.h"
#include "logger.h"
#include "pool.h"
Include dependency graph for drmbuffer.cpp:

Go to the source code of this file.

Macros

#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 

Functions

const struct format_infoFindFormat (uint32_t format)
 Find infos for the given pixel format. More...
 

Variables

static const struct format_info format_info_array []
 Infos of a pixel format. More...
 

Detailed Description

DRM buffer class.

This files defines cDrmBuffer, which is a class used to describe a DRM buffer, keeping framebuffer and prime handles to be used by the kernel display interface.

License{AGPLv3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.}

Definition in file drmbuffer.cpp.

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   arr)    (sizeof(arr) / sizeof((arr)[0]))

Definition at line 243 of file drmbuffer.cpp.

Function Documentation

◆ FindFormat()

const struct format_info * FindFormat ( uint32_t  format)

Find infos for the given pixel format.

Parameters
formatpixel format
Returns
the infos of the format as a struct

Definition at line 252 of file drmbuffer.cpp.

References ARRAY_SIZE, format_info::format, and format_info_array.

Referenced by cDrmBuffer::Setup().

Variable Documentation

◆ format_info_array

const struct format_info format_info_array[]
static
Initial value:
= {
{ DRM_FORMAT_NV12, "NV12", 2, { { 8, 1, 1 }, { 16, 2, 2 } }, },
{ DRM_FORMAT_YUV420, "YU12", 3, { { 8, 1, 1 }, { 8, 2, 2 }, {8, 2, 2 } }, },
{ DRM_FORMAT_ARGB8888, "AR24", 1, { { 32, 1, 1 } }, },
}

Infos of a pixel format.

Each entry describes a format in the following matter: { uint32_t format, const char *fourcc, uint8_t num_planes, struct format_plane_info planes[4] }

The format_plane_info is: { uint8_t bitspp, uint8_t xsub, uint8_t ysub, }

Definition at line 237 of file drmbuffer.cpp.

Referenced by FindFormat().