chromium/media/base/video_codec_string_parsers.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/base/video_codec_string_parsers.h"

#include <string_view>

#include "base/logging.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 "media/base/video_color_space.h"
#include "ui/gfx/color_space.h"

namespace {

bool IsDolbyVisionAVCCodecId(std::string_view codec_id) {}

bool IsDolbyVisionHEVCCodecId(std::string_view codec_id) {}

}  // namespace

namespace media {

std::optional<VideoType> ParseNewStyleVp9CodecID(std::string_view codec_id) {}

std::optional<VideoType> ParseLegacyVp9CodecID(std::string_view codec_id) {}

std::optional<VideoType> ParseAv1CodecId(std::string_view codec_id) {}

std::optional<VideoType> ParseAVCCodecId(std::string_view codec_id) {}

// The specification for HEVC codec id strings can be found in ISO IEC 14496-15
// dated 2012 or newer in the Annex E.3
std::optional<VideoType> ParseHEVCCodecId(std::string_view codec_id) {}
// The specification for VVC codec id strings can be found in ISO/IEC 14496-15
// 2022, annex E.6.
// In detail it would be:
// <sample entry FourCC>    ("vvi1: if config is inband, or "vvc1" otherwise.)
// .<general_profile_idc>   (base10)
// .<general_tier_flag>     ("L" or "H")
// <op_level_idc>           (base10. <= general_level_idc in SPS)
// .C<ptl_frame_only_constraint_flag><ptl_multi_layer_enabled_flag> (optional)
// <general_constraint_info)  (base32 with "=" might be omitted.)
// .S<general_sub_profile_idc1>  (Optional, base32 with "=" might be omitted.)
// <+general_sub_profile_
// .O<ols_idx>+<max_tid>   (Optional, base10 OlsIdx & MaxTid)
std::optional<VideoType> ParseVVCCodecId(std::string_view codec_id) {}

// The specification for Dolby Vision codec id strings can be found in Dolby
// Vision streams within the MPEG-DASH format:
// https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolbyvisioninmpegdashspecification_v2_0_public_20190107.pdf
std::optional<VideoType> ParseDolbyVisionCodecId(std::string_view codec_id) {}

std::optional<VideoType> ParseCodec(std::string_view codec_id) {}

VideoCodec StringToVideoCodec(std::string_view codec_id) {}

std::string TranslateLegacyAvc1CodecIds(std::string_view codec_id) {}

}  // namespace media