FFmpeg 6.1.1
Loading...
Searching...
No Matches
hwcontext_rkmpp.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef AVUTIL_HWCONTEXT_RKMPP_H
20#define AVUTIL_HWCONTEXT_RKMPP_H
21
22#include <stddef.h>
23#include <stdint.h>
24#include <drm_fourcc.h>
25#include <rockchip/rk_mpi.h>
26
27#include "hwcontext_drm.h"
28
29#ifndef DRM_FORMAT_P010
30#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0')
31#endif
32#ifndef DRM_FORMAT_P210
33#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0')
34#endif
35#ifndef DRM_FORMAT_NV15
36#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5')
37#endif
38#ifndef DRM_FORMAT_NV20
39#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0')
40#endif
41#ifndef DRM_FORMAT_YUV420_8BIT
42#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8')
43#endif
44#ifndef DRM_FORMAT_YUV420_10BIT
45#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0')
46#endif
47#ifndef DRM_FORMAT_Y210
48#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0')
49#endif
50
51#ifndef DRM_FORMAT_MOD_VENDOR_ARM
52#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
53#endif
54#ifndef DRM_FORMAT_MOD_ARM_TYPE_AFBC
55#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00
56#endif
57
58#define drm_is_afbc(mod) \
59 ((mod >> 52) == (DRM_FORMAT_MOD_ARM_TYPE_AFBC | \
60 (DRM_FORMAT_MOD_VENDOR_ARM << 4)))
61
62/**
63 * DRM Prime Frame descriptor for RKMPP HWDevice.
64 */
66 /**
67 * Backwards compatibility with AVDRMFrameDescriptor.
68 */
70
71 /**
72 * References to MppBuffer instances which are used
73 * on each drm frame index.
74 */
77
78/**
79 * RKMPP-specific data associated with a frame pool.
80 *
81 * Allocated as AVHWFramesContext.hwctx.
82 */
83typedef struct AVRKMPPFramesContext {
84 /**
85 * MPP buffer group.
86 */
87 MppBufferGroup buf_group;
88
89 /**
90 * The descriptors of all frames in the pool after creation.
91 * Only valid if AVHWFramesContext.initial_pool_size was positive.
92 * These are intended to be used as the buffer of RKMPP decoder.
93 */
97
98/**
99 * RKMPP device details.
100 *
101 * Allocated as AVHWDeviceContext.hwctx
102 */
103typedef struct AVRKMPPDeviceContext {
104 /**
105 * MPP buffer allocation flags.
106 */
107 int flags;
109
110#endif /* AVUTIL_HWCONTEXT_RKMPP_H */
API-specific header for AV_HWDEVICE_TYPE_DRM.
@ AV_DRM_MAX_PLANES
The maximum number of layers/planes in a DRM frame.
DRM frame descriptor.
DRM Prime Frame descriptor for RKMPP HWDevice.
AVDRMFrameDescriptor drm_desc
Backwards compatibility with AVDRMFrameDescriptor.
MppBuffer buffers[AV_DRM_MAX_PLANES]
References to MppBuffer instances which are used on each drm frame index.
RKMPP device details.
int flags
MPP buffer allocation flags.
RKMPP-specific data associated with a frame pool.
AVRKMPPDRMFrameDescriptor * frames
The descriptors of all frames in the pool after creation.
MppBufferGroup buf_group
MPP buffer group.