1/* GStreamer
2 * Copyright (C) 2022 Intel Corporation
3 * Author: He Junyan <junyan.he@intel.com>
4 * Author: Liu Yinhang <yinhang.liu@intel.com>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22#pragma once
23
24#include <gst/video/video-info.h>
25
26G_BEGIN_DECLS
27
28/**
29 * GST_VIDEO_DMA_DRM_CAPS_MAKE:
30 *
31 * Generic caps string for video wit DMABuf(GST_CAPS_FEATURE_MEMORY_DMABUF)
32 * feature, for use in pad templates. As drm-format is supposed to be defined
33 * at run-time it's not predefined here.
34 *
35 * Since: 1.24
36 */
37#define GST_VIDEO_DMA_DRM_CAPS_MAKE \
38 "video/x-raw(memory:DMABuf), " \
39 "format = (string) DMA_DRM, " \
40 "width = " GST_VIDEO_SIZE_RANGE ", " \
41 "height = " GST_VIDEO_SIZE_RANGE ", " \
42 "framerate = " GST_VIDEO_FPS_RANGE
43
44typedef struct _GstVideoInfoDmaDrm GstVideoInfoDmaDrm;
45
46/**
47 * GstVideoInfoDmaDrm:
48 * @vinfo: the associated #GstVideoInfo
49 * @drm_fourcc: the fourcc defined by drm
50 * @drm_modifier: the drm modifier
51 *
52 * Information describing a DMABuf image properties. It wraps #GstVideoInfo and
53 * adds DRM information such as drm-fourcc and drm-modifier, required for
54 * negotiation and mapping.
55 *
56 * Since: 1.24
57 */
58struct _GstVideoInfoDmaDrm
59{
60 GstVideoInfo vinfo;
61 guint32 drm_fourcc;
62 guint64 drm_modifier;
63
64 /*< private >*/
65 guint32 _gst_reserved[GST_PADDING_LARGE];
66};
67
68#define GST_TYPE_VIDEO_INFO_DMA_DRM (gst_video_info_dma_drm_get_type ())
69
70GST_VIDEO_API
71GType gst_video_info_dma_drm_get_type (void);
72
73GST_VIDEO_API
74void gst_video_info_dma_drm_free (GstVideoInfoDmaDrm * drm_info);
75
76GST_VIDEO_API
77void gst_video_info_dma_drm_init (GstVideoInfoDmaDrm * drm_info);
78
79GST_VIDEO_API
80GstVideoInfoDmaDrm * gst_video_info_dma_drm_new (void);
81
82GST_VIDEO_API
83GstCaps * gst_video_info_dma_drm_to_caps (const GstVideoInfoDmaDrm * drm_info);
84
85GST_VIDEO_API
86gboolean gst_video_info_dma_drm_from_caps (GstVideoInfoDmaDrm * drm_info,
87 const GstCaps * caps);
88
89GST_VIDEO_API
90gboolean gst_video_info_dma_drm_from_video_info
91 (GstVideoInfoDmaDrm * drm_info,
92 const GstVideoInfo * info,
93 guint64 modifier);
94
95GST_VIDEO_API
96gboolean gst_video_info_dma_drm_to_video_info (const GstVideoInfoDmaDrm * drm_info,
97 GstVideoInfo * info);
98
99GST_VIDEO_API
100GstVideoInfoDmaDrm * gst_video_info_dma_drm_new_from_caps (const GstCaps * caps);
101
102GST_VIDEO_API
103gboolean gst_video_is_dma_drm_caps (const GstCaps * caps);
104
105GST_VIDEO_API
106guint32 gst_video_dma_drm_fourcc_from_string (const gchar * format_str,
107 guint64 * modifier);
108
109GST_VIDEO_API
110gchar * gst_video_dma_drm_fourcc_to_string (guint32 fourcc,
111 guint64 modifier);
112
113GST_VIDEO_API
114guint32 gst_video_dma_drm_fourcc_from_format (GstVideoFormat format);
115
116GST_VIDEO_API
117GstVideoFormat gst_video_dma_drm_fourcc_to_format (guint32 fourcc);
118
119G_END_DECLS
120

source code of include/gstreamer-1.0/gst/video/video-info-dma.h