1/* GStreamer
2 * Copyright (C) <2021> Fluendo S.A. <contact@fluendo.com>
3 * Authors: Andoni Morales Alastruey <amorales@fluendo.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_SEI_USER_DATA_UNREGISTERED_H__
22#define __GST_VIDEO_SEI_USER_DATA_UNREGISTERED_H__
23
24#include <gst/gst.h>
25#include <gst/video/video.h>
26
27G_BEGIN_DECLS
28
29static const guint8 H264_MISP_MICROSECTIME[] = {
30 0x4D, 0x49, 0x53, 0x50, 0x6D, 0x69, 0x63, 0x72,
31 0x6F, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6D, 0x65
32};
33
34static const guint8 H265_MISP_MICROSECONDS[] = {
35 0xA8, 0x68, 0x7D, 0xD4, 0xD7, 0x59, 0x37, 0x58,
36 0xA5, 0xCE, 0xF0, 0x33, 0x8B, 0x65, 0x45, 0xF1
37};
38
39static const guint8 H265_MISP_NANOSECONDS[] = {
40 0xCF, 0x84, 0x82, 0x78, 0xEE, 0x23, 0x30, 0x6C,
41 0x92, 0x65, 0xE8, 0xFE, 0xF2, 0x2F, 0xB8, 0xB8
42};
43
44/**
45 * GstVideoSEIUserDataUnregisteredMeta:
46 * @meta: parent #GstMeta
47 * @uuid: User Data Unregistered UUID
48 * @data: Unparsed data buffer
49 * @size: Size of the data buffer
50 *
51 * H.264 H.265 metadata from SEI User Data Unregistered messages
52 *
53 * Since: 1.22
54 */
55typedef struct {
56 GstMeta meta;
57
58 guint8 uuid[16];
59 guint8 *data;
60 gsize size;
61} GstVideoSEIUserDataUnregisteredMeta;
62
63GST_VIDEO_API
64GType gst_video_sei_user_data_unregistered_meta_api_get_type (void);
65/**
66 * GST_VIDEO_SEI_USER_DATA_UNREGISTERED_META_API_TYPE:
67 *
68 * Since: 1.22
69 */
70#define GST_VIDEO_SEI_USER_DATA_UNREGISTERED_META_API_TYPE (\
71 gst_video_sei_user_data_unregistered_meta_api_get_type())
72
73GST_VIDEO_API
74const GstMetaInfo *gst_video_sei_user_data_unregistered_meta_get_info (void);
75/**
76 * GST_VIDEO_SEI_USER_DATA_UNREGISTERED_META_INFO:
77 *
78 * Since: 1.22
79 */
80#define GST_VIDEO_SEI_USER_DATA_UNREGISTERED_META_INFO (\
81 gst_video_sei_user_data_unregistered_meta_get_info())
82
83/**
84 * gst_buffer_get_video_sei_user_data_unregistered_meta:
85 * @b: A #GstBuffer
86 *
87 * Gets the GstVideoSEIUserDataUnregisteredMeta that might be present on @b.
88 *
89 * Returns: (nullable): The first #GstVideoSEIUserDataUnregisteredMeta present on @b, or %NULL if
90 * no #GstVideoSEIUserDataUnregisteredMeta are present
91 *
92 * Since: 1.22
93 */
94#define gst_buffer_get_video_sei_user_data_unregistered_meta(b) \
95 ((GstVideoSEIUserDataUnregisteredMeta*)gst_buffer_get_meta((b),GST_VIDEO_SEI_USER_DATA_UNREGISTERED_META_API_TYPE))
96
97GST_VIDEO_API
98GstVideoSEIUserDataUnregisteredMeta *gst_buffer_add_video_sei_user_data_unregistered_meta (GstBuffer * buffer,
99 guint8 uuid[16],
100 guint8 * data,
101 gsize size);
102
103GST_VIDEO_API
104gboolean gst_video_sei_user_data_unregistered_parse_precision_time_stamp (GstVideoSEIUserDataUnregisteredMeta * user_data,
105 guint8 * status,
106 guint64 * precision_time_stamp);
107
108G_END_DECLS
109
110#endif /* __GST_VIDEO_SEI_USER_DATA_UNREGISTERED_H__ */
111

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