• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023, 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 CLI_AUDIO_FRAME_WITH_DATA_H_
14 #define CLI_AUDIO_FRAME_WITH_DATA_H_
15 
16 #include <cstdint>
17 #include <optional>
18 #include <vector>
19 
20 #include "iamf/cli/audio_element_with_data.h"
21 #include "iamf/obu/audio_frame.h"
22 #include "iamf/obu/demixing_info_parameter_data.h"
23 #include "iamf/obu/recon_gain_info_parameter_data.h"
24 #include "iamf/obu/types.h"
25 
26 namespace iamf_tools {
27 
28 struct AudioFrameWithData {
29   friend bool operator==(const AudioFrameWithData& lhs,
30                          const AudioFrameWithData& rhs) = default;
31   AudioFrameObu obu;
32   InternalTimestamp start_timestamp;  // Start time of this frame. Measured in
33                                       // ticks from the Global Timing Module.
34   InternalTimestamp end_timestamp;  // End time of this frame. Measured in ticks
35                                     // from the Global Timing Module.
36 
37   // The PCM samples to encode this audio frame, if known. This is useful to
38   // calculate recon gain.
39   std::optional<std::vector<std::vector<int32_t>>> pcm_samples;
40 
41   // Down-mixing parameters used to create this audio frame.
42   DownMixingParams down_mixing_params;
43 
44   // Recon gain info parameter data used to adjust the gain of this audio frame.
45   ReconGainInfoParameterData recon_gain_info_parameter_data;
46 
47   // The audio element with data associated with this frame.
48   const AudioElementWithData* audio_element_with_data;
49 };
50 
51 }  // namespace iamf_tools
52 
53 #endif  // CLI_AUDIO_FRAME_WITH_DATA_H_
54