1/* GStreamer
2 * Copyright (C) <2018-2019> Seungha Yang <seungha.yang@navercorp.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library 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 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __GST_VIDEO_HDR_H__
21#define __GST_VIDEO_HDR_H__
22
23#include <gst/gst.h>
24#include <gst/video/video-prelude.h>
25
26G_BEGIN_DECLS
27
28typedef struct _GstVideoMasteringDisplayInfoCoordinates GstVideoMasteringDisplayInfoCoordinates;
29typedef struct _GstVideoMasteringDisplayInfo GstVideoMasteringDisplayInfo;
30typedef struct _GstVideoContentLightLevel GstVideoContentLightLevel;
31
32/**
33 * GstVideoMasteringDisplayInfoCoordinates:
34 * @x: the x coordinate of CIE 1931 color space in unit of 0.00002.
35 * @y: the y coordinate of CIE 1931 color space in unit of 0.00002.
36 *
37 * Used to represent display_primaries and white_point of
38 * #GstVideoMasteringDisplayInfo struct. See #GstVideoMasteringDisplayInfo
39 *
40 * Since: 1.18
41 */
42struct _GstVideoMasteringDisplayInfoCoordinates
43{
44 guint16 x;
45 guint16 y;
46};
47
48/**
49 * GstVideoMasteringDisplayInfo:
50 * @display_primaries: the xy coordinates of primaries in the CIE 1931 color space.
51 * the index 0 contains red, 1 is for green and 2 is for blue.
52 * each value is normalized to 50000 (meaning that in unit of 0.00002)
53 * @white_point: the xy coordinates of white point in the CIE 1931 color space.
54 * each value is normalized to 50000 (meaning that in unit of 0.00002)
55 * @max_display_mastering_luminance: the maximum value of display luminance
56 * in unit of 0.0001 candelas per square metre (cd/m^2 and nit)
57 * @min_display_mastering_luminance: the minimum value of display luminance
58 * in unit of 0.0001 candelas per square metre (cd/m^2 and nit)
59 *
60 * Mastering display color volume information defined by SMPTE ST 2086
61 * (a.k.a static HDR metadata).
62 *
63 * Since: 1.18
64 */
65struct _GstVideoMasteringDisplayInfo
66{
67 GstVideoMasteringDisplayInfoCoordinates display_primaries[3];
68 GstVideoMasteringDisplayInfoCoordinates white_point;
69 guint32 max_display_mastering_luminance;
70 guint32 min_display_mastering_luminance;
71
72 /*< private >*/
73 gpointer _gst_reserved[GST_PADDING];
74};
75
76GST_VIDEO_API
77void gst_video_mastering_display_info_init (GstVideoMasteringDisplayInfo * minfo);
78
79GST_VIDEO_API
80gboolean gst_video_mastering_display_info_from_string (GstVideoMasteringDisplayInfo * minfo,
81 const gchar * mastering);
82
83GST_VIDEO_API
84gchar * gst_video_mastering_display_info_to_string (const GstVideoMasteringDisplayInfo * minfo);
85
86GST_VIDEO_API
87gboolean gst_video_mastering_display_info_is_equal (const GstVideoMasteringDisplayInfo * minfo,
88 const GstVideoMasteringDisplayInfo * other);
89
90GST_VIDEO_API
91gboolean gst_video_mastering_display_info_from_caps (GstVideoMasteringDisplayInfo * minfo,
92 const GstCaps * caps);
93
94GST_VIDEO_API
95gboolean gst_video_mastering_display_info_add_to_caps (const GstVideoMasteringDisplayInfo * minfo,
96 GstCaps * caps);
97
98/**
99 * GstVideoContentLightLevel:
100 * @max_content_light_level: the maximum content light level
101 * (abbreviated to MaxCLL) in candelas per square meter (cd/m^2 and nit)
102 * @max_frame_average_light_level: the maximum frame average light level
103 * (abbreviated to MaxFLL) in candelas per square meter (cd/m^2 and nit)
104 *
105 * Content light level information specified in CEA-861.3, Appendix A.
106 *
107 * Since: 1.18
108 */
109struct _GstVideoContentLightLevel
110{
111 guint16 max_content_light_level;
112 guint16 max_frame_average_light_level;
113
114 /*< private >*/
115 gpointer _gst_reserved[GST_PADDING];
116};
117
118GST_VIDEO_API
119void gst_video_content_light_level_init (GstVideoContentLightLevel * linfo);
120
121GST_VIDEO_API
122gboolean gst_video_content_light_level_from_string (GstVideoContentLightLevel * linfo,
123 const gchar * level);
124
125GST_VIDEO_API
126gchar * gst_video_content_light_level_to_string (const GstVideoContentLightLevel * linfo);
127
128GST_VIDEO_API
129gboolean gst_video_content_light_level_is_equal (const GstVideoContentLightLevel * linfo,
130 const GstVideoContentLightLevel * other);
131
132GST_VIDEO_API
133gboolean gst_video_content_light_level_from_caps (GstVideoContentLightLevel * linfo,
134 const GstCaps * caps);
135
136GST_VIDEO_API
137gboolean gst_video_content_light_level_add_to_caps (const GstVideoContentLightLevel * linfo,
138 GstCaps * caps);
139
140
141G_END_DECLS
142
143#endif /* __GST_VIDEO_HDR_H__ */
144

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