StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
dovi.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Multimedia.
5 *
6 * StormByte-Multimedia original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte-Multimedia source in this
20 * file. Third-party components — including FFmpeg and embedded trained data —
21 * remain under their own licenses and are not covered by the commercial grant.
22 *
23 * A written StormByte commercial agreement may license this original source
24 * on terms other than the LGPL, including specific use, distribution or
25 * linking arrangements such as static linking, as stated in that agreement.
26 * It does not grant rights to dependencies or waive their license conditions.
27 * Enabling WITH_GPL or WITH_NONFREE may include components with separate
28 * obligations for modification, linking (static or dynamic), redistribution
29 * or works that incorporate them. The person modifying, linking, packaging or
30 * distributing the resulting work is responsible for determining and meeting
31 * all applicable requirements, including any needed patent permissions.
32 * A StormByte commercial agreement does not provide those rights for GPL or
33 * nonfree components.
34 *
35 * Neither license grants any patent rights. Any patent licenses required
36 * to use this software or third-party components must be obtained separately
37 * from the patent holders.
38 *
39 * StormByte-Multimedia is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU Lesser General Public License for more details.
43 *
44 * You should have received a copy of the GNU Lesser General Public License
45 * version 3 along with StormByte-Multimedia. If not, see
46 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
47 *
48 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
49 */
50
51#pragma once
52
54#include <StormByte/safe/binary.hxx>
55
56#include <cstdint>
57#include <span>
58
63namespace StormByte {
68 namespace Multimedia {
73 namespace Property {
81 public:
85 DOVI() noexcept;
86
92 DOVI(const DOVI& other);
93
98 DOVI(DOVI&& other) noexcept;
99
103 ~DOVI() noexcept;
104
111 DOVI& operator=(const DOVI& other);
112
118 DOVI& operator=(DOVI&& other) noexcept;
119
125 bool LoadConfiguration(std::span<const std::byte> bytes) noexcept;
126
133 bool LoadMetadata(std::span<const std::byte> bytes) noexcept;
134
141 bool LoadRpu(std::span<const std::byte> bytes);
142
147 bool Present() const noexcept;
148
153 bool ConfigurationPresent() const noexcept;
154
159 bool MetadataPresent() const noexcept;
160
165 std::uint8_t Profile() const noexcept;
166
171 std::uint8_t Level() const noexcept;
172
177 std::uint8_t VersionMajor() const noexcept;
178
183 std::uint8_t VersionMinor() const noexcept;
184
189 std::uint8_t CompatibilityId() const noexcept;
190
195 bool RpuPresent() const noexcept;
196
201 bool ElPresent() const noexcept;
202
207 bool BlPresent() const noexcept;
208
213 std::uint8_t Compression() const noexcept;
214
219 const StormByte::Safe::Binary& Rpu() const noexcept;
220
225 std::uint8_t BlBitDepth() const noexcept;
226
231 std::uint8_t ElBitDepth() const noexcept;
232
237 std::uint8_t VdrBitDepth() const noexcept;
238
243 std::uint8_t MappingColorSpace() const noexcept;
244
249 std::uint8_t MappingChromaFormat() const noexcept;
250
255 std::uint8_t SignalBitDepth() const noexcept;
256
261 std::uint8_t SignalColorSpace() const noexcept;
262
267 std::uint8_t SignalChromaFormat() const noexcept;
268
273 std::uint8_t SignalFullRange() const noexcept;
274
279 std::uint16_t SignalEotf() const noexcept;
280
285 std::uint16_t SourceMinPq() const noexcept;
286
291 std::uint16_t SourceMaxPq() const noexcept;
292
293 private:
294 bool m_configuration = false;
295 bool m_metadata = false;
296 std::uint8_t m_version_major = 0;
297 std::uint8_t m_version_minor = 0;
298 std::uint8_t m_profile = 0;
299 std::uint8_t m_level = 0;
300 std::uint8_t m_compatibility = 0;
301 bool m_rpu_present = false;
302 bool m_el_present = false;
303 bool m_bl_present = false;
304 std::uint8_t m_compression = 0;
305 StormByte::Safe::Binary m_rpu;
306 std::uint8_t m_bl_bit_depth = 0;
307 std::uint8_t m_el_bit_depth = 0;
308 std::uint8_t m_vdr_bit_depth = 0;
309 std::uint8_t m_mapping_color_space = 0;
310 std::uint8_t m_mapping_chroma_format = 0;
311 std::uint8_t m_signal_bit_depth = 0;
312 std::uint8_t m_signal_color_space = 0;
313 std::uint8_t m_signal_chroma_format = 0;
314 std::uint8_t m_signal_full_range = 0;
315 std::uint16_t m_signal_eotf = 0;
316 std::uint16_t m_source_min_pq = 0;
317 std::uint16_t m_source_max_pq = 0;
318 };
319 }
320 }
321}
322
STORMBYTE_DECLARE_MAYBE_SAFE(StormByte::Buffer::Bridge)
DOVI() noexcept
Constructs absent Dolby Vision properties.
std::uint8_t SignalBitDepth() const noexcept
Returns decoded signal bit depth.
std::uint16_t SourceMaxPq() const noexcept
Returns decoded source maximum PQ code value.
bool MetadataPresent() const noexcept
Reports decoded metadata availability.
std::uint8_t MappingColorSpace() const noexcept
Returns decoded mapping color space.
std::uint8_t SignalFullRange() const noexcept
Returns decoded signal range flags.
std::uint8_t BlBitDepth() const noexcept
Returns decoded base-layer bit depth.
std::uint8_t VersionMajor() const noexcept
Returns the configuration major version.
bool LoadMetadata(std::span< const std::byte > bytes) noexcept
Loads native AVDOVIMetadata after checking its dynamic offsets.
const StormByte::Safe::Binary & Rpu() const noexcept
Returns owned raw RPU bytes.
std::uint16_t SourceMinPq() const noexcept
Returns decoded source minimum PQ code value.
bool LoadRpu(std::span< const std::byte > bytes)
Copies raw RPU side data into owned Safe binary storage.
bool LoadConfiguration(std::span< const std::byte > bytes) noexcept
Loads native AVDOVIDecoderConfigurationRecord side data.
bool RpuPresent() const noexcept
Reports signaled or decoded RPU presence.
std::uint8_t VdrBitDepth() const noexcept
Returns decoded VDR bit depth.
std::uint8_t CompatibilityId() const noexcept
Returns base-layer signal compatibility.
std::uint16_t SignalEotf() const noexcept
Returns decoded signal EOTF.
std::uint8_t VersionMinor() const noexcept
Returns the configuration minor version.
bool Present() const noexcept
Reports Dolby Vision detected by any loader.
std::uint8_t Compression() const noexcept
Returns the metadata compression method.
bool ConfigurationPresent() const noexcept
Reports native stream configuration availability.
std::uint8_t MappingChromaFormat() const noexcept
Returns decoded mapping chroma format.
std::uint8_t Profile() const noexcept
Returns the stream configuration profile.
bool ElPresent() const noexcept
Reports configuration enhancement-layer presence.
std::uint8_t Level() const noexcept
Returns the stream configuration level.
std::uint8_t SignalColorSpace() const noexcept
Returns decoded signal color space.
bool BlPresent() const noexcept
Reports configuration base-layer presence.
std::uint8_t SignalChromaFormat() const noexcept
Returns decoded signal chroma format.
std::uint8_t ElBitDepth() const noexcept
Returns decoded enhancement-layer bit depth.
Multimedia module of the StormByte suite.
Media property value types.
Media property value types.
Multimedia module of the StormByte suite.
Root namespace of the StormByte C++ suite.
STL namespace.
#define STORMBYTE_MULTIMEDIA_PUBLIC
Definition visibility.h:61