2022-08-26 15:44:59 +00:00
|
|
|
// Copyright 2014 Google LLC. All rights reserved.
|
2014-05-14 23:19:35 +00:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
//
|
|
|
|
// Muxer utility functions.
|
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#ifndef PACKAGER_MEDIA_BASE_MUXER_UTIL_H_
|
|
|
|
#define PACKAGER_MEDIA_BASE_MUXER_UTIL_H_
|
2014-05-14 23:19:35 +00:00
|
|
|
|
2023-10-11 08:49:50 +00:00
|
|
|
#include <cstdint>
|
2014-05-14 23:19:35 +00:00
|
|
|
|
2023-10-10 23:51:11 +00:00
|
|
|
#include <packager/status/status.h>
|
2016-04-27 22:04:50 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2014-05-14 23:19:35 +00:00
|
|
|
namespace media {
|
|
|
|
|
2016-04-27 22:04:50 +00:00
|
|
|
class StreamInfo;
|
|
|
|
|
2014-05-14 23:19:35 +00:00
|
|
|
/// Validates the segment template against segment URL construction rule
|
|
|
|
/// specified in ISO/IEC 23009-1:2012 5.3.9.4.4.
|
|
|
|
/// @param segment_template is the template to be validated.
|
2017-08-29 17:54:29 +00:00
|
|
|
/// @return OK if the segment template complies with
|
|
|
|
// ISO/IEC 23009-1:2012 5.3.9.4.4.
|
|
|
|
Status ValidateSegmentTemplate(const std::string& segment_template);
|
2014-05-14 23:19:35 +00:00
|
|
|
|
|
|
|
/// Build the segment name from provided input.
|
|
|
|
/// @param segment_template is the segment template pattern, which should
|
|
|
|
/// comply with ISO/IEC 23009-1:2012 5.3.9.4.4.
|
|
|
|
/// @param segment_start_time specifies the segment start time.
|
|
|
|
/// @param segment_index specifies the segment index.
|
2014-06-27 23:07:36 +00:00
|
|
|
/// @param bandwidth represents the bit rate, in bits/sec, of the stream.
|
2014-05-14 23:19:35 +00:00
|
|
|
/// @return The segment name with identifier substituted.
|
|
|
|
std::string GetSegmentName(const std::string& segment_template,
|
2021-08-04 18:56:44 +00:00
|
|
|
int64_t segment_start_time,
|
2014-09-30 21:52:21 +00:00
|
|
|
uint32_t segment_index,
|
|
|
|
uint32_t bandwidth);
|
2014-05-14 23:19:35 +00:00
|
|
|
|
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2014-05-14 23:19:35 +00:00
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#endif // PACKAGER_MEDIA_BASE_MUXER_UTIL_H_
|