#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "media/mojo/mojom/video_decoder.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "media/mojo/mojom/video_decoder.mojom-params-data.h"
#include "media/mojo/mojom/video_decoder.mojom-shared-message-ids.h"
#include "media/mojo/mojom/video_decoder.mojom-import-headers.h"
#include "media/mojo/mojom/video_decoder.mojom-test-utils.h"
#include "media/mojo/mojom/video_decoder_config_mojom_traits.h"
namespace media::mojom {
SupportedVideoDecoderConfig::SupportedVideoDecoderConfig()
: … { … }
SupportedVideoDecoderConfig::SupportedVideoDecoderConfig(
::media::VideoCodecProfile profile_min_in,
::media::VideoCodecProfile profile_max_in,
const ::gfx::Size& coded_size_min_in,
const ::gfx::Size& coded_size_max_in,
bool allow_encrypted_in,
bool require_encrypted_in)
: … { … }
SupportedVideoDecoderConfig::~SupportedVideoDecoderConfig() = default;
void SupportedVideoDecoderConfig::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SupportedVideoDecoderConfig::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CommandBufferId::CommandBufferId()
: … { … }
CommandBufferId::CommandBufferId(
const ::base::UnguessableToken& channel_token_in,
int32_t route_id_in)
: … { … }
CommandBufferId::~CommandBufferId() = default;
void CommandBufferId::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CommandBufferId::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char VideoFrameHandleReleaser::Name_[] = …;
VideoFrameHandleReleaser::IPCStableHashFunction VideoFrameHandleReleaser::MessageToMethodInfo_(mojo::Message& message) { … }
const char* VideoFrameHandleReleaser::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VideoFrameHandleReleaser::ReleaseVideoFrame_Sym::IPCStableHash() { … }
# endif
VideoFrameHandleReleaserProxy::VideoFrameHandleReleaserProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void VideoFrameHandleReleaserProxy::ReleaseVideoFrame(
const ::base::UnguessableToken& in_release_token, const std::optional<::gpu::SyncToken>& in_release_sync_token) { … }
bool VideoFrameHandleReleaserStubDispatch::Accept(
VideoFrameHandleReleaser* impl,
mojo::Message* message) { … }
bool VideoFrameHandleReleaserStubDispatch::AcceptWithResponder(
VideoFrameHandleReleaser* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kVideoFrameHandleReleaserValidationInfo[] = …;
bool VideoFrameHandleReleaserRequestValidator::Accept(mojo::Message* message) { … }
const char VideoDecoder::Name_[] = …;
VideoDecoder::IPCStableHashFunction VideoDecoder::MessageToMethodInfo_(mojo::Message& message) { … }
const char* VideoDecoder::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VideoDecoder::GetSupportedConfigs_Sym::IPCStableHash() { … }
uint32_t VideoDecoder::Construct_Sym::IPCStableHash() { … }
uint32_t VideoDecoder::Initialize_Sym::IPCStableHash() { … }
uint32_t VideoDecoder::Decode_Sym::IPCStableHash() { … }
uint32_t VideoDecoder::Reset_Sym::IPCStableHash() { … }
uint32_t VideoDecoder::OnOverlayInfoChanged_Sym::IPCStableHash() { … }
# endif
bool VideoDecoder::GetSupportedConfigs(std::vector<::media::SupportedVideoDecoderConfig>* out_supported_configs, ::media::VideoDecoderType* out_decoder_type) { … }
class VideoDecoder_GetSupportedConfigs_HandleSyncResponse
: public mojo::MessageReceiver { … };
class VideoDecoder_GetSupportedConfigs_ForwardToCallback
: public mojo::MessageReceiver { … };
class VideoDecoder_Initialize_ForwardToCallback
: public mojo::MessageReceiver { … };
class VideoDecoder_Decode_ForwardToCallback
: public mojo::MessageReceiver { … };
class VideoDecoder_Reset_ForwardToCallback
: public mojo::MessageReceiver { … };
VideoDecoderProxy::VideoDecoderProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
bool VideoDecoderProxy::GetSupportedConfigs(
std::vector<::media::SupportedVideoDecoderConfig>* out_param_supported_configs, ::media::VideoDecoderType* out_param_decoder_type) { … }
void VideoDecoderProxy::GetSupportedConfigs(
GetSupportedConfigsCallback callback) { … }
void VideoDecoderProxy::Construct(
::mojo::PendingAssociatedRemote<VideoDecoderClient> in_client, ::mojo::PendingRemote<::media::mojom::MediaLog> in_media_log, ::mojo::PendingReceiver<VideoFrameHandleReleaser> in_video_frame_handle_releaser, ::mojo::ScopedDataPipeConsumerHandle in_decoder_buffer_pipe, CommandBufferIdPtr in_command_buffer_id, const ::gfx::ColorSpace& in_target_color_space) { … }
void VideoDecoderProxy::Initialize(
const ::media::VideoDecoderConfig& in_config, bool in_low_delay, const std::optional<::base::UnguessableToken>& in_cdm_id, InitializeCallback callback) { … }
void VideoDecoderProxy::Decode(
::media::mojom::DecoderBufferPtr in_buffer, DecodeCallback callback) { … }
void VideoDecoderProxy::Reset(
ResetCallback callback) { … }
void VideoDecoderProxy::OnOverlayInfoChanged(
const ::media::OverlayInfo& in_overlay_info) { … }
class VideoDecoder_GetSupportedConfigs_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VideoDecoder_GetSupportedConfigs_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VideoDecoder_GetSupportedConfigs_ProxyToResponder::Run(
const std::vector<::media::SupportedVideoDecoderConfig>& in_supported_configs, ::media::VideoDecoderType in_decoder_type) { … }
bool VideoDecoder_GetSupportedConfigs_HandleSyncResponse::Accept(
mojo::Message* message) { … }
class VideoDecoder_Initialize_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VideoDecoder_Initialize_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VideoDecoder_Initialize_ProxyToResponder::Run(
const ::media::DecoderStatus& in_status, bool in_needs_bitstream_conversion, int32_t in_max_decode_requests, ::media::VideoDecoderType in_decoder_type) { … }
class VideoDecoder_Decode_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VideoDecoder_Decode_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VideoDecoder_Decode_ProxyToResponder::Run(
const ::media::DecoderStatus& in_status) { … }
class VideoDecoder_Reset_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VideoDecoder_Reset_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VideoDecoder_Reset_ProxyToResponder::Run(
) { … }
bool VideoDecoderStubDispatch::Accept(
VideoDecoder* impl,
mojo::Message* message) { … }
bool VideoDecoderStubDispatch::AcceptWithResponder(
VideoDecoder* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kVideoDecoderValidationInfo[] = …;
bool VideoDecoderRequestValidator::Accept(mojo::Message* message) { … }
bool VideoDecoderResponseValidator::Accept(mojo::Message* message) { … }
const char VideoDecoderClient::Name_[] = …;
VideoDecoderClient::IPCStableHashFunction VideoDecoderClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* VideoDecoderClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VideoDecoderClient::OnVideoFrameDecoded_Sym::IPCStableHash() { … }
uint32_t VideoDecoderClient::OnWaiting_Sym::IPCStableHash() { … }
uint32_t VideoDecoderClient::RequestOverlayInfo_Sym::IPCStableHash() { … }
# endif
VideoDecoderClientProxy::VideoDecoderClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void VideoDecoderClientProxy::OnVideoFrameDecoded(
const ::scoped_refptr<::media::VideoFrame>& in_frame, bool in_can_read_without_stalling, const std::optional<::base::UnguessableToken>& in_release_token) { … }
void VideoDecoderClientProxy::OnWaiting(
::media::WaitingReason in_reason) { … }
void VideoDecoderClientProxy::RequestOverlayInfo(
bool in_restart_for_transitions) { … }
bool VideoDecoderClientStubDispatch::Accept(
VideoDecoderClient* impl,
mojo::Message* message) { … }
bool VideoDecoderClientStubDispatch::AcceptWithResponder(
VideoDecoderClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kVideoDecoderClientValidationInfo[] = …;
bool VideoDecoderClientRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::media::mojom::SupportedVideoDecoderConfig::DataView, ::media::mojom::SupportedVideoDecoderConfigPtr>::Read(
::media::mojom::SupportedVideoDecoderConfig::DataView input,
::media::mojom::SupportedVideoDecoderConfigPtr* output) { … }
bool StructTraits<::media::mojom::CommandBufferId::DataView, ::media::mojom::CommandBufferIdPtr>::Read(
::media::mojom::CommandBufferId::DataView input,
::media::mojom::CommandBufferIdPtr* output) { … }
}
namespace media::mojom {
void VideoFrameHandleReleaserInterceptorForTesting::ReleaseVideoFrame(const ::base::UnguessableToken& release_token, const std::optional<::gpu::SyncToken>& release_sync_token) { … }
VideoFrameHandleReleaserAsyncWaiter::VideoFrameHandleReleaserAsyncWaiter(
VideoFrameHandleReleaser* proxy) : … { … }
VideoFrameHandleReleaserAsyncWaiter::~VideoFrameHandleReleaserAsyncWaiter() = default;
void VideoDecoderInterceptorForTesting::GetSupportedConfigs(GetSupportedConfigsCallback callback) { … }
void VideoDecoderInterceptorForTesting::Construct(::mojo::PendingAssociatedRemote<VideoDecoderClient> client, ::mojo::PendingRemote<::media::mojom::MediaLog> media_log, ::mojo::PendingReceiver<VideoFrameHandleReleaser> video_frame_handle_releaser, ::mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe, CommandBufferIdPtr command_buffer_id, const ::gfx::ColorSpace& target_color_space) { … }
void VideoDecoderInterceptorForTesting::Initialize(const ::media::VideoDecoderConfig& config, bool low_delay, const std::optional<::base::UnguessableToken>& cdm_id, InitializeCallback callback) { … }
void VideoDecoderInterceptorForTesting::Decode(::media::mojom::DecoderBufferPtr buffer, DecodeCallback callback) { … }
void VideoDecoderInterceptorForTesting::Reset(ResetCallback callback) { … }
void VideoDecoderInterceptorForTesting::OnOverlayInfoChanged(const ::media::OverlayInfo& overlay_info) { … }
VideoDecoderAsyncWaiter::VideoDecoderAsyncWaiter(
VideoDecoder* proxy) : … { … }
VideoDecoderAsyncWaiter::~VideoDecoderAsyncWaiter() = default;
void VideoDecoderAsyncWaiter::GetSupportedConfigs(
std::vector<::media::SupportedVideoDecoderConfig>* out_supported_configs, ::media::VideoDecoderType* out_decoder_type) { … }
void VideoDecoderAsyncWaiter::Initialize(
const ::media::VideoDecoderConfig& config, bool low_delay, const std::optional<::base::UnguessableToken>& cdm_id, ::media::DecoderStatus* out_status, bool* out_needs_bitstream_conversion, int32_t* out_max_decode_requests, ::media::VideoDecoderType* out_decoder_type) { … }
void VideoDecoderAsyncWaiter::Decode(
::media::mojom::DecoderBufferPtr buffer, ::media::DecoderStatus* out_status) { … }
::media::DecoderStatus VideoDecoderAsyncWaiter::Decode(
::media::mojom::DecoderBufferPtr buffer) { … }
void VideoDecoderAsyncWaiter::Reset(
) { … }
void VideoDecoderClientInterceptorForTesting::OnVideoFrameDecoded(const ::scoped_refptr<::media::VideoFrame>& frame, bool can_read_without_stalling, const std::optional<::base::UnguessableToken>& release_token) { … }
void VideoDecoderClientInterceptorForTesting::OnWaiting(::media::WaitingReason reason) { … }
void VideoDecoderClientInterceptorForTesting::RequestOverlayInfo(bool restart_for_transitions) { … }
VideoDecoderClientAsyncWaiter::VideoDecoderClientAsyncWaiter(
VideoDecoderClient* proxy) : … { … }
VideoDecoderClientAsyncWaiter::~VideoDecoderClientAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif