#include "media/base/mime_util_internal.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "media/base/media.h"
#include "media/base/media_client.h"
#include "media/base/media_switches.h"
#include "media/base/supported_types.h"
#include "media/base/video_codec_string_parsers.h"
#include "media/base/video_codecs.h"
#include "media/base/video_color_space.h"
#include "media/media_buildflags.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#include "media/base/android/media_codec_util.h"
#endif
namespace media::internal {
StringToCodecMap;
const StringToCodecMap& GetStringToCodecMap() { … }
static std::optional<VideoType> ParseVp9CodecID(
std::string_view mime_type_lower_case,
std::string_view codec_id) { … }
static bool IsValidH264Level(uint8_t level_idc) { … }
static MimeUtil::ParsedCodecResult MakeDefaultParsedCodecResult() { … }
MimeUtil::MimeUtil() { … }
MimeUtil::~MimeUtil() = default;
AudioCodec MimeUtilToAudioCodec(MimeUtil::Codec codec) { … }
VideoCodec MimeUtilToVideoCodec(MimeUtil::Codec codec) { … }
SupportsType MimeUtil::AreSupportedCodecs(
const std::vector<ParsedCodecResult>& parsed_codecs,
std::string_view mime_type_lower_case,
bool is_encrypted) const { … }
void MimeUtil::InitializeMimeTypeMaps() { … }
void MimeUtil::AddSupportedMediaFormats() { … }
void MimeUtil::AddContainerWithCodecs(std::string mime_type, CodecSet codecs) { … }
bool MimeUtil::IsSupportedMediaMimeType(std::string_view mime_type) const { … }
void MimeUtil::SplitCodecs(std::string_view codecs,
std::vector<std::string>* codecs_out) const { … }
void MimeUtil::StripCodecs(std::vector<std::string>* codecs) const { … }
std::optional<VideoType> MimeUtil::ParseVideoCodecString(
std::string_view mime_type,
std::string_view codec_id,
bool allow_ambiguous_matches) const { … }
bool MimeUtil::ParseAudioCodecString(std::string_view mime_type,
std::string_view codec_id,
bool* out_is_ambiguous,
AudioCodec* out_codec) const { … }
SupportsType MimeUtil::IsSupportedMediaFormat(
std::string_view mime_type,
const std::vector<std::string>& codecs,
bool is_encrypted) const { … }
bool MimeUtil::IsCodecSupportedOnAndroid(Codec codec,
std::string_view mime_type_lower_case,
bool is_encrypted,
VideoCodecProfile video_profile,
const PlatformInfo& platform_info) { … }
bool MimeUtil::ParseCodecStrings(
std::string_view mime_type_lower_case,
const std::vector<std::string>& codecs,
std::vector<ParsedCodecResult>* out_results) const { … }
bool MimeUtil::ParseCodecHelper(std::string_view mime_type_lower_case,
std::string_view codec_id,
ParsedCodecResult* out_result) const { … }
SupportsType MimeUtil::IsCodecSupported(std::string_view mime_type_lower_case,
Codec codec,
VideoCodecProfile video_profile,
VideoCodecLevel video_level,
const VideoColorSpace& color_space,
bool is_encrypted) const { … }
bool MimeUtil::GetDefaultCodec(std::string_view mime_type,
Codec* default_codec) const { … }
}