| 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 | |
| 26 | G_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 | |
| 44 | typedef 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 | */ |
| 58 | struct _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 | |
| 70 | GST_VIDEO_API |
| 71 | GType gst_video_info_dma_drm_get_type (void); |
| 72 | |
| 73 | GST_VIDEO_API |
| 74 | void gst_video_info_dma_drm_free (GstVideoInfoDmaDrm * drm_info); |
| 75 | |
| 76 | GST_VIDEO_API |
| 77 | void gst_video_info_dma_drm_init (GstVideoInfoDmaDrm * drm_info); |
| 78 | |
| 79 | GST_VIDEO_API |
| 80 | GstVideoInfoDmaDrm * gst_video_info_dma_drm_new (void); |
| 81 | |
| 82 | GST_VIDEO_API |
| 83 | GstCaps * gst_video_info_dma_drm_to_caps (const GstVideoInfoDmaDrm * drm_info); |
| 84 | |
| 85 | GST_VIDEO_API |
| 86 | gboolean gst_video_info_dma_drm_from_caps (GstVideoInfoDmaDrm * drm_info, |
| 87 | const GstCaps * caps); |
| 88 | |
| 89 | GST_VIDEO_API |
| 90 | gboolean gst_video_info_dma_drm_from_video_info |
| 91 | (GstVideoInfoDmaDrm * drm_info, |
| 92 | const GstVideoInfo * info, |
| 93 | guint64 modifier); |
| 94 | |
| 95 | GST_VIDEO_API |
| 96 | gboolean gst_video_info_dma_drm_to_video_info (const GstVideoInfoDmaDrm * drm_info, |
| 97 | GstVideoInfo * info); |
| 98 | |
| 99 | GST_VIDEO_API |
| 100 | GstVideoInfoDmaDrm * gst_video_info_dma_drm_new_from_caps (const GstCaps * caps); |
| 101 | |
| 102 | GST_VIDEO_API |
| 103 | gboolean gst_video_is_dma_drm_caps (const GstCaps * caps); |
| 104 | |
| 105 | GST_VIDEO_API |
| 106 | guint32 gst_video_dma_drm_fourcc_from_string (const gchar * format_str, |
| 107 | guint64 * modifier); |
| 108 | |
| 109 | GST_VIDEO_API |
| 110 | gchar * gst_video_dma_drm_fourcc_to_string (guint32 fourcc, |
| 111 | guint64 modifier); |
| 112 | |
| 113 | GST_VIDEO_API |
| 114 | guint32 gst_video_dma_drm_fourcc_from_format (GstVideoFormat format); |
| 115 | |
| 116 | GST_VIDEO_API |
| 117 | GstVideoFormat gst_video_dma_drm_fourcc_to_format (guint32 fourcc); |
| 118 | |
| 119 | G_END_DECLS |
| 120 | |