chromium/media/base/mime_util_internal.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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"

// TODO(dalecurtis): This include is not allowed by media/base since
// media/base/android is technically a different component. We should move
// mime_util*.{cc,h} out of media/base to fix this.
#include "media/base/android/media_codec_util.h"  // nogncheck
#endif

namespace media::internal {

// A map from codec string to MimeUtil::Codec.
StringToCodecMap;

// Wrapped to avoid static initializer startup cost.
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) {}

// Make a default ParsedCodecResult. Values should indicate "unspecified"
// where possible. Color space is an exception where we choose a default value
// because most codec strings will not describe a color space.
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() {}

// Each call to AddContainerWithCodecs() contains a media type
// (https://en.wikipedia.org/wiki/Media_type) and corresponding media codec(s)
// supported by these types/containers.
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 {}

// static
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 {}

}  // namespace media::internal