2023-12-01 17:32:19 +00:00
|
|
|
// Copyright 2015 Google LLC. All rights reserved.
|
2015-07-22 06:57:21 +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
|
|
|
|
|
|
|
|
/// This file contains helper functions and enums for MpdNotifier
|
|
|
|
/// implementations.
|
|
|
|
|
|
|
|
#ifndef MPD_BASE_MPD_NOTIFIER_UTIL_H_
|
|
|
|
#define MPD_BASE_MPD_NOTIFIER_UTIL_H_
|
|
|
|
|
|
|
|
#include <string>
|
2015-08-26 20:25:29 +00:00
|
|
|
#include <vector>
|
2015-07-22 06:57:21 +00:00
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
#include <absl/strings/escaping.h>
|
|
|
|
|
|
|
|
#include <packager/mpd/base/media_info.pb.h>
|
|
|
|
#include <packager/mpd/base/mpd_builder.h>
|
2015-07-22 06:57:21 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka{
|
2015-07-22 06:57:21 +00:00
|
|
|
|
|
|
|
enum ContentType {
|
|
|
|
kContentTypeUnknown,
|
|
|
|
kContentTypeVideo,
|
|
|
|
kContentTypeAudio,
|
|
|
|
kContentTypeText
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Outputs MPD to @a output_path.
|
|
|
|
/// @param output_path is the path to the MPD output location.
|
|
|
|
/// @param mpd_builder is the MPD builder instance.
|
|
|
|
bool WriteMpdToFile(const std::string& output_path, MpdBuilder* mpd_builder);
|
|
|
|
|
|
|
|
/// Determines the content type of |media_info|.
|
|
|
|
/// @param media_info is the information about the media.
|
|
|
|
/// @return content type of the @a media_info.
|
|
|
|
ContentType GetContentType(const MediaInfo& media_info);
|
|
|
|
|
2015-08-26 20:25:29 +00:00
|
|
|
/// Converts uint8 vector into base64 encoded string.
|
|
|
|
std::string Uint8VectorToBase64(const std::vector<uint8_t>& input);
|
2015-07-22 06:57:21 +00:00
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2015-07-22 06:57:21 +00:00
|
|
|
|
|
|
|
#endif // MPD_BASE_MPD_NOTIFIER_UTIL_H_
|