• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024, 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_ADM_TO_USER_METADATA_ADM_WAV_FILE_SPLICER_H_
14 #define CLI_ADM_TO_USER_METADATA_ADM_WAV_FILE_SPLICER_H_
15 
16 #include <filesystem>
17 #include <istream>
18 
19 #include "absl/status/status.h"
20 #include "absl/strings/string_view.h"
21 #include "iamf/cli/adm_to_user_metadata/adm/bw64_reader.h"
22 #include "iamf/obu/ia_sequence_header.h"
23 
24 namespace iamf_tools {
25 namespace adm_to_user_metadata {
26 
27 /*!\brief Splices a wav file based on the input ADM file type.
28  *
29  * \param output_file_path Path to output wav files to.
30  * \param file_prefix File prefix to use when naming output wav files.
31  * \param profile_version IAMF output spec version to use for panning the audio
32  *        objects.
33  * \param reader Bw64Reader associated with the input stream.
34  * \param input_stream Input stream to process.
35  * \param lfe_count Number of LFE channels, updated if the being converted from
36  *        an extended ADM file.
37  * \return `absl::OkStatus()` on success. A specific error code on failure.
38  */
39 absl::Status SpliceWavFilesFromAdm(
40     const std::filesystem::path& output_file_path,
41     absl::string_view file_prefix, ProfileVersion profile_version,
42     const Bw64Reader& reader, std::istream& input_stream, int& lfe_count);
43 
44 }  // namespace adm_to_user_metadata
45 }  // namespace iamf_tools
46 
47 #endif  // CLI_ADM_TO_USER_METADATA_ADM_WAV_FILE_SPLICER_H_
48