#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "media/mojo/mojom/remoting.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/remoting.mojom-params-data.h"
#include "media/mojo/mojom/remoting.mojom-shared-message-ids.h"
#include "media/mojo/mojom/remoting.mojom-import-headers.h"
#include "media/mojo/mojom/remoting.mojom-test-utils.h"
namespace media::mojom {
const char RemoterFactory::Name_[] = …;
RemoterFactory::IPCStableHashFunction RemoterFactory::MessageToMethodInfo_(mojo::Message& message) { … }
const char* RemoterFactory::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t RemoterFactory::Create_Sym::IPCStableHash() { … }
# endif
RemoterFactoryProxy::RemoterFactoryProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemoterFactoryProxy::Create(
::mojo::PendingRemote<RemotingSource> in_source, ::mojo::PendingReceiver<Remoter> in_remoter) { … }
bool RemoterFactoryStubDispatch::Accept(
RemoterFactory* impl,
mojo::Message* message) { … }
bool RemoterFactoryStubDispatch::AcceptWithResponder(
RemoterFactory* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemoterFactoryValidationInfo[] = …;
bool RemoterFactoryRequestValidator::Accept(mojo::Message* message) { … }
const char RemotingDataStreamSender::Name_[] = …;
RemotingDataStreamSender::IPCStableHashFunction RemotingDataStreamSender::MessageToMethodInfo_(mojo::Message& message) { … }
const char* RemotingDataStreamSender::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t RemotingDataStreamSender::SendFrame_Sym::IPCStableHash() { … }
uint32_t RemotingDataStreamSender::CancelInFlightData_Sym::IPCStableHash() { … }
# endif
class RemotingDataStreamSender_SendFrame_ForwardToCallback
: public mojo::MessageReceiver { … };
RemotingDataStreamSenderProxy::RemotingDataStreamSenderProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemotingDataStreamSenderProxy::SendFrame(
::media::mojom::DecoderBufferPtr in_frame, SendFrameCallback callback) { … }
void RemotingDataStreamSenderProxy::CancelInFlightData(
) { … }
class RemotingDataStreamSender_SendFrame_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool RemotingDataStreamSender_SendFrame_ForwardToCallback::Accept(
mojo::Message* message) { … }
void RemotingDataStreamSender_SendFrame_ProxyToResponder::Run(
) { … }
bool RemotingDataStreamSenderStubDispatch::Accept(
RemotingDataStreamSender* impl,
mojo::Message* message) { … }
bool RemotingDataStreamSenderStubDispatch::AcceptWithResponder(
RemotingDataStreamSender* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemotingDataStreamSenderValidationInfo[] = …;
bool RemotingDataStreamSenderRequestValidator::Accept(mojo::Message* message) { … }
bool RemotingDataStreamSenderResponseValidator::Accept(mojo::Message* message) { … }
const char Remoter::Name_[] = …;
Remoter::IPCStableHashFunction Remoter::MessageToMethodInfo_(mojo::Message& message) { … }
const char* Remoter::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t Remoter::Start_Sym::IPCStableHash() { … }
uint32_t Remoter::StartWithPermissionAlreadyGranted_Sym::IPCStableHash() { … }
uint32_t Remoter::StartDataStreams_Sym::IPCStableHash() { … }
uint32_t Remoter::Stop_Sym::IPCStableHash() { … }
uint32_t Remoter::SendMessageToSink_Sym::IPCStableHash() { … }
uint32_t Remoter::EstimateTransmissionCapacity_Sym::IPCStableHash() { … }
# endif
class Remoter_EstimateTransmissionCapacity_ForwardToCallback
: public mojo::MessageReceiver { … };
RemoterProxy::RemoterProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemoterProxy::Start(
) { … }
void RemoterProxy::StartWithPermissionAlreadyGranted(
) { … }
void RemoterProxy::StartDataStreams(
::mojo::ScopedDataPipeConsumerHandle in_audio_pipe, ::mojo::ScopedDataPipeConsumerHandle in_video_pipe, ::mojo::PendingReceiver<RemotingDataStreamSender> in_audio_sender, ::mojo::PendingReceiver<RemotingDataStreamSender> in_video_sender) { … }
void RemoterProxy::Stop(
::media::mojom::RemotingStopReason in_reason) { … }
void RemoterProxy::SendMessageToSink(
const std::vector<uint8_t>& in_message) { … }
void RemoterProxy::EstimateTransmissionCapacity(
EstimateTransmissionCapacityCallback callback) { … }
class Remoter_EstimateTransmissionCapacity_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool Remoter_EstimateTransmissionCapacity_ForwardToCallback::Accept(
mojo::Message* message) { … }
void Remoter_EstimateTransmissionCapacity_ProxyToResponder::Run(
double in_rate) { … }
bool RemoterStubDispatch::Accept(
Remoter* impl,
mojo::Message* message) { … }
bool RemoterStubDispatch::AcceptWithResponder(
Remoter* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemoterValidationInfo[] = …;
bool RemoterRequestValidator::Accept(mojo::Message* message) { … }
bool RemoterResponseValidator::Accept(mojo::Message* message) { … }
const char RemotingSource::Name_[] = …;
RemotingSource::IPCStableHashFunction RemotingSource::MessageToMethodInfo_(mojo::Message& message) { … }
const char* RemotingSource::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t RemotingSource::OnSinkAvailable_Sym::IPCStableHash() { … }
uint32_t RemotingSource::OnSinkGone_Sym::IPCStableHash() { … }
uint32_t RemotingSource::OnStarted_Sym::IPCStableHash() { … }
uint32_t RemotingSource::OnStartFailed_Sym::IPCStableHash() { … }
uint32_t RemotingSource::OnMessageFromSink_Sym::IPCStableHash() { … }
uint32_t RemotingSource::OnStopped_Sym::IPCStableHash() { … }
# endif
RemotingSourceProxy::RemotingSourceProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemotingSourceProxy::OnSinkAvailable(
::media::mojom::RemotingSinkMetadataPtr in_metadata) { … }
void RemotingSourceProxy::OnSinkGone(
) { … }
void RemotingSourceProxy::OnStarted(
) { … }
void RemotingSourceProxy::OnStartFailed(
::media::mojom::RemotingStartFailReason in_reason) { … }
void RemotingSourceProxy::OnMessageFromSink(
const std::vector<uint8_t>& in_message) { … }
void RemotingSourceProxy::OnStopped(
::media::mojom::RemotingStopReason in_reason) { … }
bool RemotingSourceStubDispatch::Accept(
RemotingSource* impl,
mojo::Message* message) { … }
bool RemotingSourceStubDispatch::AcceptWithResponder(
RemotingSource* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemotingSourceValidationInfo[] = …;
bool RemotingSourceRequestValidator::Accept(mojo::Message* message) { … }
const char Remotee::Name_[] = …;
Remotee::IPCStableHashFunction Remotee::MessageToMethodInfo_(mojo::Message& message) { … }
const char* Remotee::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t Remotee::OnRemotingSinkReady_Sym::IPCStableHash() { … }
uint32_t Remotee::SendMessageToSource_Sym::IPCStableHash() { … }
uint32_t Remotee::StartDataStreams_Sym::IPCStableHash() { … }
uint32_t Remotee::OnFlushUntil_Sym::IPCStableHash() { … }
uint32_t Remotee::OnVideoNaturalSizeChange_Sym::IPCStableHash() { … }
# endif
RemoteeProxy::RemoteeProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemoteeProxy::OnRemotingSinkReady(
::mojo::PendingRemote<RemotingSink> in_sink) { … }
void RemoteeProxy::SendMessageToSource(
const std::vector<uint8_t>& in_message) { … }
void RemoteeProxy::StartDataStreams(
::mojo::PendingRemote<RemotingDataStreamReceiver> in_audio_stream, ::mojo::PendingRemote<RemotingDataStreamReceiver> in_video_stream) { … }
void RemoteeProxy::OnFlushUntil(
uint32_t in_audio_frame_count, uint32_t in_video_frame_count) { … }
void RemoteeProxy::OnVideoNaturalSizeChange(
const ::gfx::Size& in_size) { … }
bool RemoteeStubDispatch::Accept(
Remotee* impl,
mojo::Message* message) { … }
bool RemoteeStubDispatch::AcceptWithResponder(
Remotee* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemoteeValidationInfo[] = …;
bool RemoteeRequestValidator::Accept(mojo::Message* message) { … }
const char RemotingSink::Name_[] = …;
RemotingSink::IPCStableHashFunction RemotingSink::MessageToMethodInfo_(mojo::Message& message) { … }
const char* RemotingSink::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t RemotingSink::OnMessageFromSource_Sym::IPCStableHash() { … }
# endif
RemotingSinkProxy::RemotingSinkProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemotingSinkProxy::OnMessageFromSource(
const std::vector<uint8_t>& in_message) { … }
bool RemotingSinkStubDispatch::Accept(
RemotingSink* impl,
mojo::Message* message) { … }
bool RemotingSinkStubDispatch::AcceptWithResponder(
RemotingSink* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemotingSinkValidationInfo[] = …;
bool RemotingSinkRequestValidator::Accept(mojo::Message* message) { … }
const char RemotingDataStreamReceiver::Name_[] = …;
RemotingDataStreamReceiver::IPCStableHashFunction RemotingDataStreamReceiver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* RemotingDataStreamReceiver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t RemotingDataStreamReceiver::InitializeDataPipe_Sym::IPCStableHash() { … }
uint32_t RemotingDataStreamReceiver::ReceiveFrame_Sym::IPCStableHash() { … }
uint32_t RemotingDataStreamReceiver::FlushUntil_Sym::IPCStableHash() { … }
# endif
RemotingDataStreamReceiverProxy::RemotingDataStreamReceiverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void RemotingDataStreamReceiverProxy::InitializeDataPipe(
::mojo::ScopedDataPipeConsumerHandle in_data_pipe) { … }
void RemotingDataStreamReceiverProxy::ReceiveFrame(
uint32_t in_frame_count, ::media::mojom::DecoderBufferPtr in_buffer) { … }
void RemotingDataStreamReceiverProxy::FlushUntil(
uint32_t in_frame_count) { … }
bool RemotingDataStreamReceiverStubDispatch::Accept(
RemotingDataStreamReceiver* impl,
mojo::Message* message) { … }
bool RemotingDataStreamReceiverStubDispatch::AcceptWithResponder(
RemotingDataStreamReceiver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kRemotingDataStreamReceiverValidationInfo[] = …;
bool RemotingDataStreamReceiverRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
}
namespace media::mojom {
void RemoterFactoryInterceptorForTesting::Create(::mojo::PendingRemote<RemotingSource> source, ::mojo::PendingReceiver<Remoter> remoter) { … }
RemoterFactoryAsyncWaiter::RemoterFactoryAsyncWaiter(
RemoterFactory* proxy) : … { … }
RemoterFactoryAsyncWaiter::~RemoterFactoryAsyncWaiter() = default;
void RemotingDataStreamSenderInterceptorForTesting::SendFrame(::media::mojom::DecoderBufferPtr frame, SendFrameCallback callback) { … }
void RemotingDataStreamSenderInterceptorForTesting::CancelInFlightData() { … }
RemotingDataStreamSenderAsyncWaiter::RemotingDataStreamSenderAsyncWaiter(
RemotingDataStreamSender* proxy) : … { … }
RemotingDataStreamSenderAsyncWaiter::~RemotingDataStreamSenderAsyncWaiter() = default;
void RemotingDataStreamSenderAsyncWaiter::SendFrame(
::media::mojom::DecoderBufferPtr frame) { … }
void RemoterInterceptorForTesting::Start() { … }
void RemoterInterceptorForTesting::StartWithPermissionAlreadyGranted() { … }
void RemoterInterceptorForTesting::StartDataStreams(::mojo::ScopedDataPipeConsumerHandle audio_pipe, ::mojo::ScopedDataPipeConsumerHandle video_pipe, ::mojo::PendingReceiver<RemotingDataStreamSender> audio_sender, ::mojo::PendingReceiver<RemotingDataStreamSender> video_sender) { … }
void RemoterInterceptorForTesting::Stop(::media::mojom::RemotingStopReason reason) { … }
void RemoterInterceptorForTesting::SendMessageToSink(const std::vector<uint8_t>& message) { … }
void RemoterInterceptorForTesting::EstimateTransmissionCapacity(EstimateTransmissionCapacityCallback callback) { … }
RemoterAsyncWaiter::RemoterAsyncWaiter(
Remoter* proxy) : … { … }
RemoterAsyncWaiter::~RemoterAsyncWaiter() = default;
void RemoterAsyncWaiter::EstimateTransmissionCapacity(
double* out_rate) { … }
double RemoterAsyncWaiter::EstimateTransmissionCapacity(
) { … }
void RemotingSourceInterceptorForTesting::OnSinkAvailable(::media::mojom::RemotingSinkMetadataPtr metadata) { … }
void RemotingSourceInterceptorForTesting::OnSinkGone() { … }
void RemotingSourceInterceptorForTesting::OnStarted() { … }
void RemotingSourceInterceptorForTesting::OnStartFailed(::media::mojom::RemotingStartFailReason reason) { … }
void RemotingSourceInterceptorForTesting::OnMessageFromSink(const std::vector<uint8_t>& message) { … }
void RemotingSourceInterceptorForTesting::OnStopped(::media::mojom::RemotingStopReason reason) { … }
RemotingSourceAsyncWaiter::RemotingSourceAsyncWaiter(
RemotingSource* proxy) : … { … }
RemotingSourceAsyncWaiter::~RemotingSourceAsyncWaiter() = default;
void RemoteeInterceptorForTesting::OnRemotingSinkReady(::mojo::PendingRemote<RemotingSink> sink) { … }
void RemoteeInterceptorForTesting::SendMessageToSource(const std::vector<uint8_t>& message) { … }
void RemoteeInterceptorForTesting::StartDataStreams(::mojo::PendingRemote<RemotingDataStreamReceiver> audio_stream, ::mojo::PendingRemote<RemotingDataStreamReceiver> video_stream) { … }
void RemoteeInterceptorForTesting::OnFlushUntil(uint32_t audio_frame_count, uint32_t video_frame_count) { … }
void RemoteeInterceptorForTesting::OnVideoNaturalSizeChange(const ::gfx::Size& size) { … }
RemoteeAsyncWaiter::RemoteeAsyncWaiter(
Remotee* proxy) : … { … }
RemoteeAsyncWaiter::~RemoteeAsyncWaiter() = default;
void RemotingSinkInterceptorForTesting::OnMessageFromSource(const std::vector<uint8_t>& message) { … }
RemotingSinkAsyncWaiter::RemotingSinkAsyncWaiter(
RemotingSink* proxy) : … { … }
RemotingSinkAsyncWaiter::~RemotingSinkAsyncWaiter() = default;
void RemotingDataStreamReceiverInterceptorForTesting::InitializeDataPipe(::mojo::ScopedDataPipeConsumerHandle data_pipe) { … }
void RemotingDataStreamReceiverInterceptorForTesting::ReceiveFrame(uint32_t frame_count, ::media::mojom::DecoderBufferPtr buffer) { … }
void RemotingDataStreamReceiverInterceptorForTesting::FlushUntil(uint32_t frame_count) { … }
RemotingDataStreamReceiverAsyncWaiter::RemotingDataStreamReceiverAsyncWaiter(
RemotingDataStreamReceiver* proxy) : … { … }
RemotingDataStreamReceiverAsyncWaiter::~RemotingDataStreamReceiverAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif