#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "media/mojo/mojom/watch_time_recorder.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/watch_time_recorder.mojom-params-data.h"
#include "media/mojo/mojom/watch_time_recorder.mojom-shared-message-ids.h"
#include "media/mojo/mojom/watch_time_recorder.mojom-import-headers.h"
#include "media/mojo/mojom/watch_time_recorder.mojom-test-utils.h"
namespace media::mojom {
PlaybackProperties::PlaybackProperties()
: … { … }
PlaybackProperties::PlaybackProperties(
bool has_audio_in,
bool has_video_in,
bool is_background_in,
bool is_muted_in,
bool is_mse_in,
bool is_eme_in,
bool is_embedded_media_experience_in,
::media::mojom::MediaStreamType media_stream_type_in,
::media::RendererType renderer_type_in)
: … { … }
PlaybackProperties::~PlaybackProperties() = default;
void PlaybackProperties::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool PlaybackProperties::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
SecondaryPlaybackProperties::SecondaryPlaybackProperties()
: … { … }
SecondaryPlaybackProperties::SecondaryPlaybackProperties(
::media::AudioCodec audio_codec_in,
::media::VideoCodec video_codec_in,
::media::AudioCodecProfile audio_codec_profile_in,
::media::VideoCodecProfile video_codec_profile_in,
::media::AudioDecoderType audio_decoder_in,
::media::VideoDecoderType video_decoder_in,
::media::EncryptionScheme audio_encryption_scheme_in,
::media::EncryptionScheme video_encryption_scheme_in,
const ::gfx::Size& natural_size_in)
: … { … }
SecondaryPlaybackProperties::~SecondaryPlaybackProperties() = default;
void SecondaryPlaybackProperties::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SecondaryPlaybackProperties::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char WatchTimeRecorder::Name_[] = …;
WatchTimeRecorder::IPCStableHashFunction WatchTimeRecorder::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WatchTimeRecorder::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WatchTimeRecorder::RecordWatchTime_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::FinalizeWatchTime_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::OnError_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::UpdateSecondaryProperties_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::SetAutoplayInitiated_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::OnDurationChanged_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::UpdateVideoDecodeStats_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::UpdateUnderflowCount_Sym::IPCStableHash() { … }
uint32_t WatchTimeRecorder::UpdateUnderflowDuration_Sym::IPCStableHash() { … }
# endif
WatchTimeRecorderProxy::WatchTimeRecorderProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WatchTimeRecorderProxy::RecordWatchTime(
::media::WatchTimeKey in_key, ::base::TimeDelta in_watch_time) { … }
void WatchTimeRecorderProxy::FinalizeWatchTime(
const std::vector<::media::WatchTimeKey>& in_watch_time_keys) { … }
void WatchTimeRecorderProxy::OnError(
const ::media::PipelineStatus& in_status) { … }
void WatchTimeRecorderProxy::UpdateSecondaryProperties(
SecondaryPlaybackPropertiesPtr in_secondary_properties) { … }
void WatchTimeRecorderProxy::SetAutoplayInitiated(
bool in_value) { … }
void WatchTimeRecorderProxy::OnDurationChanged(
::base::TimeDelta in_duration) { … }
void WatchTimeRecorderProxy::UpdateVideoDecodeStats(
uint32_t in_frames_decoded, uint32_t in_frames_dropped) { … }
void WatchTimeRecorderProxy::UpdateUnderflowCount(
int32_t in_total_count) { … }
void WatchTimeRecorderProxy::UpdateUnderflowDuration(
int32_t in_total_completed_count, ::base::TimeDelta in_total_duration) { … }
bool WatchTimeRecorderStubDispatch::Accept(
WatchTimeRecorder* impl,
mojo::Message* message) { … }
bool WatchTimeRecorderStubDispatch::AcceptWithResponder(
WatchTimeRecorder* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWatchTimeRecorderValidationInfo[] = …;
bool WatchTimeRecorderRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::media::mojom::PlaybackProperties::DataView, ::media::mojom::PlaybackPropertiesPtr>::Read(
::media::mojom::PlaybackProperties::DataView input,
::media::mojom::PlaybackPropertiesPtr* output) { … }
bool StructTraits<::media::mojom::SecondaryPlaybackProperties::DataView, ::media::mojom::SecondaryPlaybackPropertiesPtr>::Read(
::media::mojom::SecondaryPlaybackProperties::DataView input,
::media::mojom::SecondaryPlaybackPropertiesPtr* output) { … }
}
namespace media::mojom {
void WatchTimeRecorderInterceptorForTesting::RecordWatchTime(::media::WatchTimeKey key, ::base::TimeDelta watch_time) { … }
void WatchTimeRecorderInterceptorForTesting::FinalizeWatchTime(const std::vector<::media::WatchTimeKey>& watch_time_keys) { … }
void WatchTimeRecorderInterceptorForTesting::OnError(const ::media::PipelineStatus& status) { … }
void WatchTimeRecorderInterceptorForTesting::UpdateSecondaryProperties(SecondaryPlaybackPropertiesPtr secondary_properties) { … }
void WatchTimeRecorderInterceptorForTesting::SetAutoplayInitiated(bool value) { … }
void WatchTimeRecorderInterceptorForTesting::OnDurationChanged(::base::TimeDelta duration) { … }
void WatchTimeRecorderInterceptorForTesting::UpdateVideoDecodeStats(uint32_t frames_decoded, uint32_t frames_dropped) { … }
void WatchTimeRecorderInterceptorForTesting::UpdateUnderflowCount(int32_t total_count) { … }
void WatchTimeRecorderInterceptorForTesting::UpdateUnderflowDuration(int32_t total_completed_count, ::base::TimeDelta total_duration) { … }
WatchTimeRecorderAsyncWaiter::WatchTimeRecorderAsyncWaiter(
WatchTimeRecorder* proxy) : … { … }
WatchTimeRecorderAsyncWaiter::~WatchTimeRecorderAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif