2015-02-02 17:26:09 +00:00
|
|
|
// Copyright 2015 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
// Funtions used by MpdBuilder class to generate an MPD file.
|
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#ifndef PACKAGER_MEDIA_BASE_LANGUAGE_UTILS_H_
|
|
|
|
#define PACKAGER_MEDIA_BASE_LANGUAGE_UTILS_H_
|
2015-02-02 17:26:09 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2015-02-02 17:26:09 +00:00
|
|
|
|
2017-03-10 23:18:42 +00:00
|
|
|
class MediaInfo;
|
|
|
|
|
2015-02-02 17:26:09 +00:00
|
|
|
/// Convert a language tag to its shortest form, as required by RFC 5646
|
2017-03-10 23:18:42 +00:00
|
|
|
/// indicated in the MPD and HLS specs. Assumes the input is a valid ISO-639-2
|
|
|
|
/// or ISO-639-1 language tag, or an empty string. Regions and variants are
|
|
|
|
/// preserved in the conversion.
|
2015-02-02 17:26:09 +00:00
|
|
|
std::string LanguageToShortestForm(const std::string& language);
|
|
|
|
|
|
|
|
/// Convert a language tag to a 3-letter ISO-639-2 code, as required by the ISO
|
|
|
|
/// BMFF spec. The input is assumed to be a valid ISO-639-2 or ISO-639-1
|
|
|
|
/// language code. Regions and variants are not supported.
|
|
|
|
std::string LanguageToISO_639_2(const std::string& language);
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2015-02-02 17:26:09 +00:00
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#endif // PACKAGER_MEDIA_BASE_LANGUAGE_UTILS_H_
|