• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 3-Clause Clear License
5  * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
6  * License was not distributed with this source code in the LICENSE file, you
7  * can obtain it at www.aomedia.org/license/software-license/bsd-3-c-c. If the
8  * Alliance for Open Media Patent License 1.0 was not distributed with this
9  * source code in the PATENTS file, you can obtain it at
10  * www.aomedia.org/license/patent.
11  */
12 
13 #ifndef API_DECODER_TYPES_H_
14 #define API_DECODER_TYPES_H_
15 
16 #include <cstdint>
17 #include <string>
18 #include <vector>
19 
20 namespace iamf_tools {
21 namespace api {
22 
23 // TODO(b/339500539): Add support for other IAMF supported layouts
24 /*!\brief Determines the layout of the output file.
25  *
26  * Typically these correspond with `sound_system`s in the IAMF spec
27  * (https://aomediacodec.github.io/iamf/#syntax-layout).
28  */
29 enum class OutputLayout {
30   // ITU-R B.S. 2051-3 sound system A (0+2+0), commonly known as Stereo.
31   kItu2051_SoundSystemA_0_2_0 = 0,
32   // ITU-R B.S. 2051-3 sound system B (0+5+0), commonly known as 5.1.
33   kItu2051_SoundSystemB_0_5_0 = 1,
34   // ITU-R B.S. 2051-3 sound system C (2+5+0), commonly known as 5.1.2.
35   kItu2051_SoundSystemC_2_5_0 = 2,
36   // ITU-R B.S. 2051-3 sound system D (4+5+0), commonly known as 5.1.4.
37   kItu2051_SoundSystemD_4_5_0 = 3,
38   // ITU-R B.S. 2051-3 sound system E (4+5+1).
39   kItu2051_SoundSystemE_4_5_1 = 4,
40   // ITU-R B.S. 2051-3 sound system F (3+7+0).
41   kItu2051_SoundSystemF_3_7_0 = 5,
42   // ITU-R B.S. 2051-3 sound system G (4+9+0).
43   kItu2051_SoundSystemG_4_9_0 = 6,
44   // ITU-R B.S. 2051-3 sound system H (9+10+3).
45   kItu2051_SoundSystemH_9_10_3 = 7,
46   // ITU-R B.S. 2051-3 sound system I (0+7+0), commonly known as 7.1.
47   kItu2051_SoundSystemI_0_7_0 = 8,
48   // ITU-R B.S. 2051-3 sound system J (4+7+0), commonly known as 7.1.4.
49   kItu2051_SoundSystemJ_4_7_0 = 9,
50   // IAMF extension 7.1.2.
51   kIAMF_SoundSystemExtension_2_7_0 = 10,
52   // IAMF extension 3.1.2.
53   kIAMF_SoundSystemExtension_2_3_0 = 11,
54   // Mono.
55   kIAMF_SoundSystemExtension_0_1_0 = 12,
56   // IAMF Extension 9.1.6.
57   kIAMF_SoundSystemExtension_6_9_0 = 13,
58 };
59 
60 /*!\brief The requested format of the output samples. */
61 enum class OutputSampleType {
62   kInt16LittleEndian = 1,
63   kInt32LittleEndian = 2,
64 };
65 
66 /*!\brief A unique identifier for a `MixPresentation` in the IAMF stream. */
67 using MixPresentationId = uint32_t;
68 
69 /*!\brief A name:value tag describing a `MixPresentation` in the IAMF stream. */
70 struct MixPresentationTag {
71   std::string tag_name;
72   std::string tag_value;
73 };
74 
75 /*!\brief Metadata that describes a mix presentation.
76  *
77  * Used by a user to determine which mix presentation they would like to
78  * configure the decoder with.
79  */
80 struct MixPresentationMetadata {
81   MixPresentationId id;
82   std::vector<MixPresentationTag> tags;
83 };
84 
85 }  // namespace api
86 }  // namespace iamf_tools
87 
88 #endif  // API_DECODER_TYPES_H_
89