• 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 #ifndef CLI_ADM_TO_USER_METADATA_APP_ADM_TO_USER_METADATA_MAIN_LIB_H_
13 #define CLI_ADM_TO_USER_METADATA_APP_ADM_TO_USER_METADATA_MAIN_LIB_H_
14 
15 #include <cstdint>
16 #include <filesystem>
17 #include <istream>
18 
19 #include "absl/status/statusor.h"
20 #include "absl/strings/string_view.h"
21 #include "iamf/cli/proto/user_metadata.pb.h"
22 #include "iamf/obu/ia_sequence_header.h"
23 
24 namespace iamf_tools {
25 namespace adm_to_user_metadata {
26 
27 /*!\brief Generates user metadata and splices wav files from an ADM stream.
28  *
29  * \param file_prefix File prefix to use when naming output wav files and in the
30  *        output textproto.
31  * \param max_frame_duration_ms Maximum frame duration in milliseconds. The
32  *        actual frame duration may be shorter due to rounding.
33  * \param importance_threshold Threshold for to determine which audio objects to
34  * \param output_path Directory to output wav files to.
35  * \param input_adm_stream Input stream to process.
36  * \param profile_version IAMF output specification version to use for
37           textproto generation.
38  * \return Proto based on the ADM file or a specific error code on failure.
39  */
40 absl::StatusOr<iamf_tools_cli_proto::UserMetadata>
41 GenerateUserMetadataAndSpliceWavFiles(absl::string_view file_prefix,
42                                       int32_t max_frame_duration_ms,
43                                       int32_t input_importance_threshold,
44                                       const std::filesystem::path& output_path,
45                                       std::istream& input_adm_stream,
46                                       ProfileVersion profile_version);
47 
48 }  // namespace adm_to_user_metadata
49 }  // namespace iamf_tools
50 
51 #endif  // CLI_ADM_TO_USER_METADATA_APP_ADM_TO_USER_METADATA_MAIN_LIB_H_
52