1 | /* GStreamer |
2 | * Copyright (C) 2021 Collabora Ltd. |
3 | * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Library General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Library General Public |
16 | * License along with this library; if not, write to the |
17 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
18 | * Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef __GST_VIDEO_CODEC_ALPHA_META_H__ |
22 | #define __GST_VIDEO_CODEC_ALPHA_META_H__ |
23 | |
24 | #include <gst/gst.h> |
25 | #include <gst/video/video.h> |
26 | |
27 | G_BEGIN_DECLS |
28 | |
29 | /** |
30 | * GST_VIDEO_CODEC_ALPHA_META_API_TYPE: |
31 | * |
32 | * Since: 1.20 |
33 | */ |
34 | #define GST_VIDEO_CODEC_ALPHA_META_API_TYPE (gst_video_codec_alpha_meta_api_get_type()) |
35 | |
36 | /** |
37 | * GST_VIDEO_CODEC_ALPHA_META_INFO: |
38 | * |
39 | * Since: 1.20 |
40 | */ |
41 | #define GST_VIDEO_CODEC_ALPHA_META_INFO (gst_video_codec_alpha_meta_get_info()) |
42 | |
43 | typedef struct _GstVideoCodecAlphaMeta GstVideoCodecAlphaMeta; |
44 | |
45 | /** |
46 | * GstVideoCodecAlphaMeta: |
47 | * @meta: parent #GstMeta |
48 | * @buffer: the encoded alpha frame |
49 | * |
50 | * Encapsulate an extra frame containing the encoded alpha channel for the |
51 | * currently negotiated CODEC. The streams must be of the same dimention as |
52 | * the original one. |
53 | * |
54 | * Since: 1.20 |
55 | */ |
56 | struct _GstVideoCodecAlphaMeta |
57 | { |
58 | GstMeta meta; |
59 | |
60 | GstBuffer *buffer; |
61 | }; |
62 | |
63 | GST_VIDEO_API |
64 | GType gst_video_codec_alpha_meta_api_get_type (void); |
65 | |
66 | GST_VIDEO_API |
67 | const GstMetaInfo *gst_video_codec_alpha_meta_get_info (void); |
68 | |
69 | /** |
70 | * gst_buffer_get_video_codec_alpha_meta: |
71 | * @b: A #GstBuffer pointer, must be writable. |
72 | * |
73 | * Helper macro to get #GstVideoCodecAlphaMeta from an existing #GstBuffer. |
74 | * |
75 | * Returns: (nullable): the #GstVideoCodecAlphaMeta pointer, or %NULL if none. |
76 | * |
77 | * Since: 1.20 |
78 | */ |
79 | #define gst_buffer_get_video_codec_alpha_meta(b) \ |
80 | ((GstVideoCodecAlphaMeta *)gst_buffer_get_meta((b),GST_VIDEO_CODEC_ALPHA_META_API_TYPE)) |
81 | |
82 | GST_VIDEO_API |
83 | GstVideoCodecAlphaMeta *gst_buffer_add_video_codec_alpha_meta (GstBuffer * buffer, |
84 | GstBuffer * alpha_buffer); |
85 | |
86 | G_END_DECLS |
87 | |
88 | #endif /* __GST_VIDEO_CODEC_ALPHA_META_H__ */ |
89 | |