#include "content/renderer/media/render_media_client.h"
#include "base/command_line.h"
#include "base/time/default_tick_clock.h"
#include "content/public/common/content_client.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/render_thread_impl.h"
#include "media/base/audio_parameters.h"
#include "media/base/media_switches.h"
#include "media/base/video_color_space.h"
#include "media/mojo/buildflags.h"
#include "ui/display/display_switches.h"
namespace {
#if BUILDFLAG(PLATFORM_HAS_OPTIONAL_HEVC_SUPPORT)
void UpdateVideoProfilesInternal(
const media::SupportedVideoDecoderConfigs& supported_configs) {
base::flat_set<media::VideoCodecProfile> media_profiles;
for (const auto& config : supported_configs) {
for (int profile = config.profile_min; profile <= config.profile_max;
profile++) {
media_profiles.insert(static_cast<media::VideoCodecProfile>(profile));
}
}
media::UpdateDefaultSupportedVideoProfiles(media_profiles);
}
#endif
#if BUILDFLAG(ENABLE_MOJO_AUDIO_DECODER)
void UpdateAudioTypesInternal(
const media::SupportedAudioDecoderConfigs& supported_configs) {
base::flat_set<media::AudioType> supported_types;
for (const auto& config : supported_configs) {
media::AudioType type{config.codec, config.profile, false};
supported_types.insert(type);
}
media::UpdateDefaultSupportedAudioTypes(supported_types);
}
#endif
}
namespace content {
void RenderMediaClient::Initialize() { … }
RenderMediaClient::RenderMediaClient()
: … { … }
RenderMediaClient::~RenderMediaClient() { … }
bool RenderMediaClient::IsSupportedAudioType(const media::AudioType& type) { … }
bool RenderMediaClient::IsSupportedVideoType(const media::VideoType& type) { … }
bool RenderMediaClient::IsSupportedBitstreamAudioCodec(
media::AudioCodec codec) { … }
std::optional<::media::AudioRendererAlgorithmParameters>
RenderMediaClient::GetAudioRendererAlgorithmParameters(
media::AudioParameters audio_parameters) { … }
void RenderMediaClient::OnInterfaceFactoryDisconnected() { … }
void RenderMediaClient::OnAudioDecoderDisconnected() { … }
void RenderMediaClient::OnVideoDecoderDisconnected() { … }
void RenderMediaClient::OnGetSupportedVideoDecoderConfigs(
const media::SupportedVideoDecoderConfigs& configs,
media::VideoDecoderType type) { … }
media::ExternalMemoryAllocator* RenderMediaClient::GetMediaAllocator() { … }
void RenderMediaClient::OnGetSupportedAudioDecoderConfigs(
const media::SupportedAudioDecoderConfigs& configs) { … }
}