summaryrefslogtreecommitdiff
path: root/include/gst/video/video-hdr.h
blob: b6ce360233aa89b41b0af555ccc7f6a3e9ae4509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* GStreamer
 * Copyright (C) <2018-2019> Seungha Yang <seungha.yang@navercorp.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef __GST_VIDEO_HDR_H__
#define __GST_VIDEO_HDR_H__

#include <gst/gst.h>
#include <gst/video/video-prelude.h>

G_BEGIN_DECLS

typedef struct _GstVideoMasteringDisplayInfoCoordinates GstVideoMasteringDisplayInfoCoordinates;
typedef struct _GstVideoMasteringDisplayInfo GstVideoMasteringDisplayInfo;
typedef struct _GstVideoContentLightLevel GstVideoContentLightLevel;

/**
 * GstVideoMasteringDisplayInfoCoordinates:
 * @x: the x coordinate of CIE 1931 color space in unit of 0.00002.
 * @y: the y coordinate of CIE 1931 color space in unit of 0.00002.
 *
 * Used to represent display_primaries and white_point of
 * #GstVideoMasteringDisplayInfo struct. See #GstVideoMasteringDisplayInfo
 *
 * Since: 1.18
 */
struct _GstVideoMasteringDisplayInfoCoordinates
{
  guint16 x;
  guint16 y;
};

/**
 * GstVideoMasteringDisplayInfo:
 * @display_primaries: the xy coordinates of primaries in the CIE 1931 color space.
 *   the index 0 contains red, 1 is for green and 2 is for blue.
 *   each value is normalized to 50000 (meaning that in unit of 0.00002)
 * @white_point: the xy coordinates of white point in the CIE 1931 color space.
 *   each value is normalized to 50000 (meaning that in unit of 0.00002)
 * @max_display_mastering_luminance: the maximum value of display luminance
 *   in unit of 0.0001 candelas per square metre (cd/m^2 and nit)
 * @min_display_mastering_luminance: the minimum value of display luminance
 *   in unit of 0.0001 candelas per square metre (cd/m^2 and nit)
 *
 * Mastering display color volume information defined by SMPTE ST 2086
 * (a.k.a static HDR metadata).
 *
 * Since: 1.18
 */
struct _GstVideoMasteringDisplayInfo
{
  GstVideoMasteringDisplayInfoCoordinates display_primaries[3];
  GstVideoMasteringDisplayInfoCoordinates white_point;
  guint32 max_display_mastering_luminance;
  guint32 min_display_mastering_luminance;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

GST_VIDEO_API
void      gst_video_mastering_display_info_init         (GstVideoMasteringDisplayInfo * minfo);

GST_VIDEO_API
gboolean  gst_video_mastering_display_info_from_string  (GstVideoMasteringDisplayInfo * minfo,
                                                         const gchar * mastering);

GST_VIDEO_API
gchar *   gst_video_mastering_display_info_to_string    (const GstVideoMasteringDisplayInfo * minfo);

GST_VIDEO_API
gboolean  gst_video_mastering_display_info_is_equal     (const GstVideoMasteringDisplayInfo * minfo,
                                                         const GstVideoMasteringDisplayInfo * other);

GST_VIDEO_API
gboolean  gst_video_mastering_display_info_from_caps    (GstVideoMasteringDisplayInfo * minfo,
                                                         const GstCaps * caps);

GST_VIDEO_API
gboolean  gst_video_mastering_display_info_add_to_caps  (const GstVideoMasteringDisplayInfo * minfo,
                                                         GstCaps * caps);

/**
 * GstVideoContentLightLevel:
 * @max_content_light_level: the maximum content light level
 *   (abbreviated to MaxCLL) in candelas per square meter (cd/m^2 and nit)
 * @max_frame_average_light_level: the maximum frame average light level
 *   (abbreviated to MaxFLL) in candelas per square meter (cd/m^2 and nit)
 *
 * Content light level information specified in CEA-861.3, Appendix A.
 *
 * Since: 1.18
 */
struct _GstVideoContentLightLevel
{
  guint16 max_content_light_level;
  guint16 max_frame_average_light_level;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

GST_VIDEO_API
void      gst_video_content_light_level_init         (GstVideoContentLightLevel * linfo);

GST_VIDEO_API
gboolean  gst_video_content_light_level_from_string  (GstVideoContentLightLevel * linfo,
                                                      const gchar * level);

GST_VIDEO_API
gchar *   gst_video_content_light_level_to_string    (const GstVideoContentLightLevel * linfo);

GST_VIDEO_API
gboolean  gst_video_content_light_level_is_equal     (const GstVideoContentLightLevel * linfo,
                                                      const GstVideoContentLightLevel * other);

GST_VIDEO_API
gboolean  gst_video_content_light_level_from_caps    (GstVideoContentLightLevel * linfo,
                                                      const GstCaps * caps);

GST_VIDEO_API
gboolean  gst_video_content_light_level_add_to_caps  (const GstVideoContentLightLevel * linfo,
                                                      GstCaps * caps);


G_END_DECLS

#endif /* __GST_VIDEO_HDR_H__ */