// media/mojo/mojom/media_types.mojom.cc is auto generated by mojom_bindings_generator.py, do not edit

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

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "media/mojo/mojom/media_types.mojom.h"

#include <math.h>
#include <stdint.h>
#include <utility>

#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/common/task_annotator.h"
#include "base/trace_event/trace_conversion_helper.h"
#include "base/trace_event/traced_value.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/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_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"

#include "media/mojo/mojom/media_types.mojom-params-data.h"
#include "media/mojo/mojom/media_types.mojom-shared-message-ids.h"

#include "media/mojo/mojom/media_types.mojom-import-headers.h"


#ifndef MEDIA_MOJO_MOJOM_MEDIA_TYPES_MOJOM_JUMBO_H_
#define MEDIA_MOJO_MOJOM_MEDIA_TYPES_MOJOM_JUMBO_H_
#endif
namespace media {
namespace mojom {
VideoTransformation::VideoTransformation()
    : rotation(),
      mirrored() {}

VideoTransformation::VideoTransformation(
    ::media::VideoRotation rotation_in,
    bool mirrored_in)
    : rotation(std::move(rotation_in)),
      mirrored(std::move(mirrored_in)) {}

VideoTransformation::~VideoTransformation() = default;

void VideoTransformation::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("rotation", static_cast<int>(this->rotation));
  value->SetBoolean("mirrored", this->mirrored);
}

bool VideoTransformation::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
EncryptionPattern::EncryptionPattern()
    : crypt_byte_block(),
      skip_byte_block() {}

EncryptionPattern::EncryptionPattern(
    uint32_t crypt_byte_block_in,
    uint32_t skip_byte_block_in)
    : crypt_byte_block(std::move(crypt_byte_block_in)),
      skip_byte_block(std::move(skip_byte_block_in)) {}

EncryptionPattern::~EncryptionPattern() = default;

void EncryptionPattern::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("crypt_byte_block", base::NumberToString(this->crypt_byte_block));
  value->SetString("skip_byte_block", base::NumberToString(this->skip_byte_block));
}

bool EncryptionPattern::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VideoColorSpace::VideoColorSpace()
    : primaries(),
      transfer(),
      matrix(),
      range() {}

VideoColorSpace::VideoColorSpace(
    ::media::VideoColorSpace::PrimaryID primaries_in,
    VideoColorSpace::TransferID transfer_in,
    VideoColorSpace::MatrixID matrix_in,
    VideoColorSpace::RangeID range_in)
    : primaries(std::move(primaries_in)),
      transfer(std::move(transfer_in)),
      matrix(std::move(matrix_in)),
      range(std::move(range_in)) {}

VideoColorSpace::~VideoColorSpace() = default;

void VideoColorSpace::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("primaries", static_cast<int>(this->primaries));
  value->SetInteger("transfer", static_cast<int>(this->transfer));
  value->SetInteger("matrix", static_cast<int>(this->matrix));
  value->SetInteger("range", static_cast<int>(this->range));
}

bool VideoColorSpace::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
AudioDecoderConfig::AudioDecoderConfig()
    : codec(),
      profile(),
      sample_format(),
      channel_layout(),
      samples_per_second(),
      extra_data(),
      seek_preroll(),
      codec_delay(),
      encryption_scheme() {}

AudioDecoderConfig::AudioDecoderConfig(
    ::media::AudioCodec codec_in,
    ::media::AudioCodecProfile profile_in,
    ::media::SampleFormat sample_format_in,
    ::media::ChannelLayout channel_layout_in,
    int32_t samples_per_second_in,
    std::vector<uint8_t> extra_data_in,
    ::base::TimeDelta seek_preroll_in,
    int32_t codec_delay_in,
    ::media::EncryptionScheme encryption_scheme_in)
    : codec(std::move(codec_in)),
      profile(std::move(profile_in)),
      sample_format(std::move(sample_format_in)),
      channel_layout(std::move(channel_layout_in)),
      samples_per_second(std::move(samples_per_second_in)),
      extra_data(std::move(extra_data_in)),
      seek_preroll(std::move(seek_preroll_in)),
      codec_delay(std::move(codec_delay_in)),
      encryption_scheme(std::move(encryption_scheme_in)) {}

AudioDecoderConfig::~AudioDecoderConfig() = default;

void AudioDecoderConfig::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("codec", static_cast<int>(this->codec));
  value->SetInteger("profile", static_cast<int>(this->profile));
  value->SetInteger("sample_format", static_cast<int>(this->sample_format));
  value->SetInteger("channel_layout", static_cast<int>(this->channel_layout));
  value->SetInteger("samples_per_second", this->samples_per_second);
  value->BeginArray("extra_data");
  for (const auto& item0 : this->extra_data) {
    value->AppendInteger(item0);
  }
  value->EndArray();
  value->SetString("seek_preroll", base::trace_event::ValueToString(this->seek_preroll, "<value of type ::base::TimeDelta>"));
  value->SetInteger("codec_delay", this->codec_delay);
  value->SetInteger("encryption_scheme", static_cast<int>(this->encryption_scheme));
}

bool AudioDecoderConfig::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VideoDecoderConfig::VideoDecoderConfig()
    : codec(),
      profile(),
      level(),
      has_alpha(),
      transformation(),
      coded_size(),
      visible_rect(),
      natural_size(),
      extra_data(),
      encryption_scheme(),
      color_space_info(),
      hdr_metadata() {}

VideoDecoderConfig::VideoDecoderConfig(
    ::media::VideoCodec codec_in,
    ::media::VideoCodecProfile profile_in,
    uint32_t level_in,
    bool has_alpha_in,
    const ::media::VideoTransformation& transformation_in,
    const ::gfx::Size& coded_size_in,
    const ::gfx::Rect& visible_rect_in,
    const ::gfx::Size& natural_size_in,
    std::vector<uint8_t> extra_data_in,
    ::media::EncryptionScheme encryption_scheme_in,
    VideoColorSpacePtr color_space_info_in,
    const base::Optional<::gl::HDRMetadata>& hdr_metadata_in)
    : codec(std::move(codec_in)),
      profile(std::move(profile_in)),
      level(std::move(level_in)),
      has_alpha(std::move(has_alpha_in)),
      transformation(std::move(transformation_in)),
      coded_size(std::move(coded_size_in)),
      visible_rect(std::move(visible_rect_in)),
      natural_size(std::move(natural_size_in)),
      extra_data(std::move(extra_data_in)),
      encryption_scheme(std::move(encryption_scheme_in)),
      color_space_info(std::move(color_space_info_in)),
      hdr_metadata(std::move(hdr_metadata_in)) {}

VideoDecoderConfig::~VideoDecoderConfig() = default;

void VideoDecoderConfig::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("codec", static_cast<int>(this->codec));
  value->SetInteger("profile", static_cast<int>(this->profile));
  value->SetString("level", base::NumberToString(this->level));
  value->SetBoolean("has_alpha", this->has_alpha);
  value->SetString("transformation", base::trace_event::ValueToString(this->transformation, "<value of type const ::media::VideoTransformation&>"));
  value->SetString("coded_size", base::trace_event::ValueToString(this->coded_size, "<value of type const ::gfx::Size&>"));
  value->SetString("visible_rect", base::trace_event::ValueToString(this->visible_rect, "<value of type const ::gfx::Rect&>"));
  value->SetString("natural_size", base::trace_event::ValueToString(this->natural_size, "<value of type const ::gfx::Size&>"));
  value->BeginArray("extra_data");
  for (const auto& item0 : this->extra_data) {
    value->AppendInteger(item0);
  }
  value->EndArray();
  value->SetInteger("encryption_scheme", static_cast<int>(this->encryption_scheme));
  if (this->color_space_info.is_null()) {
    value->SetString("color_space_info", "nullptr");
  } else {
    value->BeginDictionary("color_space_info");
    this->color_space_info->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("hdr_metadata", base::trace_event::ValueToString(this->hdr_metadata, "<value of type const base::Optional<::gl::HDRMetadata>&>"));
}

bool VideoDecoderConfig::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
DecryptConfig::DecryptConfig()
    : encryption_scheme(),
      key_id(),
      iv(),
      subsamples(),
      encryption_pattern() {}

DecryptConfig::DecryptConfig(
    ::media::EncryptionScheme encryption_scheme_in,
    const std::string& key_id_in,
    const std::string& iv_in,
    std::vector<::media::SubsampleEntry> subsamples_in,
    const base::Optional<::media::EncryptionPattern>& encryption_pattern_in)
    : encryption_scheme(std::move(encryption_scheme_in)),
      key_id(std::move(key_id_in)),
      iv(std::move(iv_in)),
      subsamples(std::move(subsamples_in)),
      encryption_pattern(std::move(encryption_pattern_in)) {}

DecryptConfig::~DecryptConfig() = default;

void DecryptConfig::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("encryption_scheme", static_cast<int>(this->encryption_scheme));
  value->SetString("key_id", this->key_id);
  value->SetString("iv", this->iv);
  value->BeginArray("subsamples");
  for (const auto& item0 : this->subsamples) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::media::SubsampleEntry&>"));
  }
  value->EndArray();
  value->SetString("encryption_pattern", base::trace_event::ValueToString(this->encryption_pattern, "<value of type const base::Optional<::media::EncryptionPattern>&>"));
}

bool DecryptConfig::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
DecoderBuffer::DecoderBuffer()
    : timestamp(),
      duration(),
      is_end_of_stream(),
      data_size(),
      is_key_frame(),
      side_data(),
      decrypt_config(),
      front_discard(),
      back_discard() {}

DecoderBuffer::DecoderBuffer(
    ::base::TimeDelta timestamp_in,
    ::base::TimeDelta duration_in,
    bool is_end_of_stream_in,
    uint32_t data_size_in,
    bool is_key_frame_in,
    std::vector<uint8_t> side_data_in,
    DecryptConfigPtr decrypt_config_in,
    ::base::TimeDelta front_discard_in,
    ::base::TimeDelta back_discard_in)
    : timestamp(std::move(timestamp_in)),
      duration(std::move(duration_in)),
      is_end_of_stream(std::move(is_end_of_stream_in)),
      data_size(std::move(data_size_in)),
      is_key_frame(std::move(is_key_frame_in)),
      side_data(std::move(side_data_in)),
      decrypt_config(std::move(decrypt_config_in)),
      front_discard(std::move(front_discard_in)),
      back_discard(std::move(back_discard_in)) {}

DecoderBuffer::~DecoderBuffer() = default;

void DecoderBuffer::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("timestamp", base::trace_event::ValueToString(this->timestamp, "<value of type ::base::TimeDelta>"));
  value->SetString("duration", base::trace_event::ValueToString(this->duration, "<value of type ::base::TimeDelta>"));
  value->SetBoolean("is_end_of_stream", this->is_end_of_stream);
  value->SetString("data_size", base::NumberToString(this->data_size));
  value->SetBoolean("is_key_frame", this->is_key_frame);
  value->BeginArray("side_data");
  for (const auto& item0 : this->side_data) {
    value->AppendInteger(item0);
  }
  value->EndArray();
  if (this->decrypt_config.is_null()) {
    value->SetString("decrypt_config", "nullptr");
  } else {
    value->BeginDictionary("decrypt_config");
    this->decrypt_config->AsValueInto(value);
    value->EndDictionary();
  }
  value->SetString("front_discard", base::trace_event::ValueToString(this->front_discard, "<value of type ::base::TimeDelta>"));
  value->SetString("back_discard", base::trace_event::ValueToString(this->back_discard, "<value of type ::base::TimeDelta>"));
}

bool DecoderBuffer::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
AudioBuffer::AudioBuffer()
    : sample_format(),
      channel_layout(),
      channel_count(),
      sample_rate(),
      frame_count(),
      end_of_stream(),
      timestamp(),
      data() {}

AudioBuffer::AudioBuffer(
    ::media::SampleFormat sample_format_in,
    ::media::ChannelLayout channel_layout_in,
    int32_t channel_count_in,
    int32_t sample_rate_in,
    int32_t frame_count_in,
    bool end_of_stream_in,
    ::base::TimeDelta timestamp_in,
    std::vector<uint8_t> data_in)
    : sample_format(std::move(sample_format_in)),
      channel_layout(std::move(channel_layout_in)),
      channel_count(std::move(channel_count_in)),
      sample_rate(std::move(sample_rate_in)),
      frame_count(std::move(frame_count_in)),
      end_of_stream(std::move(end_of_stream_in)),
      timestamp(std::move(timestamp_in)),
      data(std::move(data_in)) {}

AudioBuffer::~AudioBuffer() = default;

void AudioBuffer::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("sample_format", static_cast<int>(this->sample_format));
  value->SetInteger("channel_layout", static_cast<int>(this->channel_layout));
  value->SetInteger("channel_count", this->channel_count);
  value->SetInteger("sample_rate", this->sample_rate);
  value->SetInteger("frame_count", this->frame_count);
  value->SetBoolean("end_of_stream", this->end_of_stream);
  value->SetString("timestamp", base::trace_event::ValueToString(this->timestamp, "<value of type ::base::TimeDelta>"));
  value->BeginArray("data");
  for (const auto& item0 : this->data) {
    value->AppendInteger(item0);
  }
  value->EndArray();
}

bool AudioBuffer::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
AudioDataS16::AudioDataS16()
    : channel_count(),
      sample_rate(),
      frame_count(),
      data() {}

AudioDataS16::AudioDataS16(
    int32_t channel_count_in,
    int32_t sample_rate_in,
    int32_t frame_count_in,
    std::vector<int16_t> data_in)
    : channel_count(std::move(channel_count_in)),
      sample_rate(std::move(sample_rate_in)),
      frame_count(std::move(frame_count_in)),
      data(std::move(data_in)) {}

AudioDataS16::~AudioDataS16() = default;

void AudioDataS16::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("channel_count", this->channel_count);
  value->SetInteger("sample_rate", this->sample_rate);
  value->SetInteger("frame_count", this->frame_count);
  value->BeginArray("data");
  for (const auto& item0 : this->data) {
    value->AppendInteger(item0);
  }
  value->EndArray();
}

bool AudioDataS16::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VideoFrameMetadata::VideoFrameMetadata()
    : allow_overlay(),
      capture_begin_time(),
      capture_end_time(),
      has_capture_counter(),
      capture_counter(),
      capture_update_rect(),
      has_copy_mode(),
      copy_mode(),
      end_of_stream(),
      frame_duration(),
      has_frame_rate(),
      frame_rate(),
      interactive_content(),
      reference_time(),
      read_lock_fences_enabled(),
      has_rotation(),
      rotation(),
      texture_owner(),
      wants_promotion_hint(),
      protected_video(),
      hw_protected(),
      overlay_plane_id(),
      power_efficient(),
      has_device_scale_factor(),
      device_scale_factor(),
      has_page_scale_factor(),
      page_scale_factor(),
      has_root_scroll_offset_x(),
      root_scroll_offset_x(),
      has_root_scroll_offset_y(),
      root_scroll_offset_y(),
      has_top_controls_visible_height(),
      top_controls_visible_height(),
      decode_begin_time(),
      decode_end_time(),
      processing_time(),
      has_rtp_timestamp(),
      rtp_timestamp(),
      receive_time(),
      wallclock_frame_duration() {}

VideoFrameMetadata::VideoFrameMetadata(
    bool allow_overlay_in,
    base::Optional<::base::TimeTicks> capture_begin_time_in,
    base::Optional<::base::TimeTicks> capture_end_time_in,
    bool has_capture_counter_in,
    int32_t capture_counter_in,
    const base::Optional<::gfx::Rect>& capture_update_rect_in,
    bool has_copy_mode_in,
    ::media::VideoFrameMetadata::CopyMode copy_mode_in,
    bool end_of_stream_in,
    base::Optional<::base::TimeDelta> frame_duration_in,
    bool has_frame_rate_in,
    double frame_rate_in,
    bool interactive_content_in,
    base::Optional<::base::TimeTicks> reference_time_in,
    bool read_lock_fences_enabled_in,
    bool has_rotation_in,
    ::media::VideoRotation rotation_in,
    bool texture_owner_in,
    bool wants_promotion_hint_in,
    bool protected_video_in,
    bool hw_protected_in,
    const base::Optional<::base::UnguessableToken>& overlay_plane_id_in,
    bool power_efficient_in,
    bool has_device_scale_factor_in,
    double device_scale_factor_in,
    bool has_page_scale_factor_in,
    double page_scale_factor_in,
    bool has_root_scroll_offset_x_in,
    double root_scroll_offset_x_in,
    bool has_root_scroll_offset_y_in,
    double root_scroll_offset_y_in,
    bool has_top_controls_visible_height_in,
    double top_controls_visible_height_in,
    base::Optional<::base::TimeTicks> decode_begin_time_in,
    base::Optional<::base::TimeTicks> decode_end_time_in,
    base::Optional<::base::TimeDelta> processing_time_in,
    bool has_rtp_timestamp_in,
    double rtp_timestamp_in,
    base::Optional<::base::TimeTicks> receive_time_in,
    base::Optional<::base::TimeDelta> wallclock_frame_duration_in)
    : allow_overlay(std::move(allow_overlay_in)),
      capture_begin_time(std::move(capture_begin_time_in)),
      capture_end_time(std::move(capture_end_time_in)),
      has_capture_counter(std::move(has_capture_counter_in)),
      capture_counter(std::move(capture_counter_in)),
      capture_update_rect(std::move(capture_update_rect_in)),
      has_copy_mode(std::move(has_copy_mode_in)),
      copy_mode(std::move(copy_mode_in)),
      end_of_stream(std::move(end_of_stream_in)),
      frame_duration(std::move(frame_duration_in)),
      has_frame_rate(std::move(has_frame_rate_in)),
      frame_rate(std::move(frame_rate_in)),
      interactive_content(std::move(interactive_content_in)),
      reference_time(std::move(reference_time_in)),
      read_lock_fences_enabled(std::move(read_lock_fences_enabled_in)),
      has_rotation(std::move(has_rotation_in)),
      rotation(std::move(rotation_in)),
      texture_owner(std::move(texture_owner_in)),
      wants_promotion_hint(std::move(wants_promotion_hint_in)),
      protected_video(std::move(protected_video_in)),
      hw_protected(std::move(hw_protected_in)),
      overlay_plane_id(std::move(overlay_plane_id_in)),
      power_efficient(std::move(power_efficient_in)),
      has_device_scale_factor(std::move(has_device_scale_factor_in)),
      device_scale_factor(std::move(device_scale_factor_in)),
      has_page_scale_factor(std::move(has_page_scale_factor_in)),
      page_scale_factor(std::move(page_scale_factor_in)),
      has_root_scroll_offset_x(std::move(has_root_scroll_offset_x_in)),
      root_scroll_offset_x(std::move(root_scroll_offset_x_in)),
      has_root_scroll_offset_y(std::move(has_root_scroll_offset_y_in)),
      root_scroll_offset_y(std::move(root_scroll_offset_y_in)),
      has_top_controls_visible_height(std::move(has_top_controls_visible_height_in)),
      top_controls_visible_height(std::move(top_controls_visible_height_in)),
      decode_begin_time(std::move(decode_begin_time_in)),
      decode_end_time(std::move(decode_end_time_in)),
      processing_time(std::move(processing_time_in)),
      has_rtp_timestamp(std::move(has_rtp_timestamp_in)),
      rtp_timestamp(std::move(rtp_timestamp_in)),
      receive_time(std::move(receive_time_in)),
      wallclock_frame_duration(std::move(wallclock_frame_duration_in)) {}

VideoFrameMetadata::~VideoFrameMetadata() = default;

void VideoFrameMetadata::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetBoolean("allow_overlay", this->allow_overlay);
  value->SetString("capture_begin_time", base::trace_event::ValueToString(this->capture_begin_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetString("capture_end_time", base::trace_event::ValueToString(this->capture_end_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetBoolean("has_capture_counter", this->has_capture_counter);
  value->SetInteger("capture_counter", this->capture_counter);
  value->SetString("capture_update_rect", base::trace_event::ValueToString(this->capture_update_rect, "<value of type const base::Optional<::gfx::Rect>&>"));
  value->SetBoolean("has_copy_mode", this->has_copy_mode);
  value->SetInteger("copy_mode", static_cast<int>(this->copy_mode));
  value->SetBoolean("end_of_stream", this->end_of_stream);
  value->SetString("frame_duration", base::trace_event::ValueToString(this->frame_duration, "<value of type base::Optional<::base::TimeDelta>>"));
  value->SetBoolean("has_frame_rate", this->has_frame_rate);
  value->SetDouble("frame_rate", this->frame_rate);
  value->SetBoolean("interactive_content", this->interactive_content);
  value->SetString("reference_time", base::trace_event::ValueToString(this->reference_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetBoolean("read_lock_fences_enabled", this->read_lock_fences_enabled);
  value->SetBoolean("has_rotation", this->has_rotation);
  value->SetInteger("rotation", static_cast<int>(this->rotation));
  value->SetBoolean("texture_owner", this->texture_owner);
  value->SetBoolean("wants_promotion_hint", this->wants_promotion_hint);
  value->SetBoolean("protected_video", this->protected_video);
  value->SetBoolean("hw_protected", this->hw_protected);
  value->SetString("overlay_plane_id", base::trace_event::ValueToString(this->overlay_plane_id, "<value of type const base::Optional<::base::UnguessableToken>&>"));
  value->SetBoolean("power_efficient", this->power_efficient);
  value->SetBoolean("has_device_scale_factor", this->has_device_scale_factor);
  value->SetDouble("device_scale_factor", this->device_scale_factor);
  value->SetBoolean("has_page_scale_factor", this->has_page_scale_factor);
  value->SetDouble("page_scale_factor", this->page_scale_factor);
  value->SetBoolean("has_root_scroll_offset_x", this->has_root_scroll_offset_x);
  value->SetDouble("root_scroll_offset_x", this->root_scroll_offset_x);
  value->SetBoolean("has_root_scroll_offset_y", this->has_root_scroll_offset_y);
  value->SetDouble("root_scroll_offset_y", this->root_scroll_offset_y);
  value->SetBoolean("has_top_controls_visible_height", this->has_top_controls_visible_height);
  value->SetDouble("top_controls_visible_height", this->top_controls_visible_height);
  value->SetString("decode_begin_time", base::trace_event::ValueToString(this->decode_begin_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetString("decode_end_time", base::trace_event::ValueToString(this->decode_end_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetString("processing_time", base::trace_event::ValueToString(this->processing_time, "<value of type base::Optional<::base::TimeDelta>>"));
  value->SetBoolean("has_rtp_timestamp", this->has_rtp_timestamp);
  value->SetDouble("rtp_timestamp", this->rtp_timestamp);
  value->SetString("receive_time", base::trace_event::ValueToString(this->receive_time, "<value of type base::Optional<::base::TimeTicks>>"));
  value->SetString("wallclock_frame_duration", base::trace_event::ValueToString(this->wallclock_frame_duration, "<value of type base::Optional<::base::TimeDelta>>"));
}

bool VideoFrameMetadata::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VideoFrame::VideoFrame()
    : format(),
      coded_size(),
      visible_rect(),
      natural_size(),
      timestamp(),
      data(),
      metadata(),
      color_space(),
      hdr_metadata() {}

VideoFrame::VideoFrame(
    ::media::VideoPixelFormat format_in,
    const ::gfx::Size& coded_size_in,
    const ::gfx::Rect& visible_rect_in,
    const ::gfx::Size& natural_size_in,
    ::base::TimeDelta timestamp_in,
    VideoFrameDataPtr data_in,
    const ::media::VideoFrameMetadata& metadata_in,
    const ::gfx::ColorSpace& color_space_in,
    const base::Optional<::gl::HDRMetadata>& hdr_metadata_in)
    : format(std::move(format_in)),
      coded_size(std::move(coded_size_in)),
      visible_rect(std::move(visible_rect_in)),
      natural_size(std::move(natural_size_in)),
      timestamp(std::move(timestamp_in)),
      data(std::move(data_in)),
      metadata(std::move(metadata_in)),
      color_space(std::move(color_space_in)),
      hdr_metadata(std::move(hdr_metadata_in)) {}

VideoFrame::~VideoFrame() = default;

void VideoFrame::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("format", static_cast<int>(this->format));
  value->SetString("coded_size", base::trace_event::ValueToString(this->coded_size, "<value of type const ::gfx::Size&>"));
  value->SetString("visible_rect", base::trace_event::ValueToString(this->visible_rect, "<value of type const ::gfx::Rect&>"));
  value->SetString("natural_size", base::trace_event::ValueToString(this->natural_size, "<value of type const ::gfx::Size&>"));
  value->SetString("timestamp", base::trace_event::ValueToString(this->timestamp, "<value of type ::base::TimeDelta>"));
  value->SetString("data", base::trace_event::ValueToString(this->data, "<value of type VideoFrameDataPtr>"));
  value->SetString("metadata", base::trace_event::ValueToString(this->metadata, "<value of type const ::media::VideoFrameMetadata&>"));
  value->SetString("color_space", base::trace_event::ValueToString(this->color_space, "<value of type const ::gfx::ColorSpace&>"));
  value->SetString("hdr_metadata", base::trace_event::ValueToString(this->hdr_metadata, "<value of type const base::Optional<::gl::HDRMetadata>&>"));
}

bool VideoFrame::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
EosVideoFrameData::EosVideoFrameData() {}

EosVideoFrameData::~EosVideoFrameData() = default;
size_t EosVideoFrameData::Hash(size_t seed) const {
  return seed;
}

void EosVideoFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
}

bool EosVideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
SharedBufferVideoFrameData::SharedBufferVideoFrameData()
    : frame_data(),
      frame_data_size(),
      strides(),
      offsets() {}

SharedBufferVideoFrameData::SharedBufferVideoFrameData(
    ::mojo::ScopedSharedBufferHandle frame_data_in,
    uint64_t frame_data_size_in,
    std::vector<int32_t> strides_in,
    std::vector<uint32_t> offsets_in)
    : frame_data(std::move(frame_data_in)),
      frame_data_size(std::move(frame_data_size_in)),
      strides(std::move(strides_in)),
      offsets(std::move(offsets_in)) {}

SharedBufferVideoFrameData::~SharedBufferVideoFrameData() = default;

void SharedBufferVideoFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetBoolean("frame_data", this->frame_data.is_valid());
  value->SetString("frame_data_size", base::NumberToString(this->frame_data_size));
  value->BeginArray("strides");
  for (const auto& item0 : this->strides) {
    value->AppendInteger(item0);
  }
  value->EndArray();
  value->BeginArray("offsets");
  for (const auto& item0 : this->offsets) {
    value->AppendString(base::NumberToString(item0));
  }
  value->EndArray();
}

bool SharedBufferVideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
DmabufVideoFrameData::DmabufVideoFrameData()
    : dmabuf_fds() {}

DmabufVideoFrameData::DmabufVideoFrameData(
    std::vector<::mojo::PlatformHandle> dmabuf_fds_in)
    : dmabuf_fds(std::move(dmabuf_fds_in)) {}

DmabufVideoFrameData::~DmabufVideoFrameData() = default;

void DmabufVideoFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("dmabuf_fds");
  for (const auto& item0 : this->dmabuf_fds) {
    value->AppendBoolean(item0.is_valid());
  }
  value->EndArray();
}

bool DmabufVideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
GpuMemoryBufferVideoFrameData::GpuMemoryBufferVideoFrameData()
    : gpu_memory_buffer_handle(),
      mailbox_holder() {}

GpuMemoryBufferVideoFrameData::GpuMemoryBufferVideoFrameData(
    ::gfx::GpuMemoryBufferHandle gpu_memory_buffer_handle_in,
    std::vector<::gpu::MailboxHolder> mailbox_holder_in)
    : gpu_memory_buffer_handle(std::move(gpu_memory_buffer_handle_in)),
      mailbox_holder(std::move(mailbox_holder_in)) {}

GpuMemoryBufferVideoFrameData::~GpuMemoryBufferVideoFrameData() = default;

void GpuMemoryBufferVideoFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("gpu_memory_buffer_handle", base::trace_event::ValueToString(this->gpu_memory_buffer_handle, "<value of type ::gfx::GpuMemoryBufferHandle>"));
  value->BeginArray("mailbox_holder");
  for (const auto& item0 : this->mailbox_holder) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::gpu::MailboxHolder&>"));
  }
  value->EndArray();
}

bool GpuMemoryBufferVideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
MailboxVideoFrameData::MailboxVideoFrameData()
    : mailbox_holder(),
      ycbcr_data() {}

MailboxVideoFrameData::MailboxVideoFrameData(
    std::vector<::gpu::MailboxHolder> mailbox_holder_in,
    base::Optional<::gpu::VulkanYCbCrInfo> ycbcr_data_in)
    : mailbox_holder(std::move(mailbox_holder_in)),
      ycbcr_data(std::move(ycbcr_data_in)) {}

MailboxVideoFrameData::~MailboxVideoFrameData() = default;

void MailboxVideoFrameData::AsValueInto(base::trace_event::TracedValue* value) const {
  value->BeginArray("mailbox_holder");
  for (const auto& item0 : this->mailbox_holder) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::gpu::MailboxHolder&>"));
  }
  value->EndArray();
  value->SetString("ycbcr_data", base::trace_event::ValueToString(this->ycbcr_data, "<value of type base::Optional<::gpu::VulkanYCbCrInfo>>"));
}

bool MailboxVideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PipelineStatistics::PipelineStatistics()
    : audio_bytes_decoded(),
      video_bytes_decoded(),
      video_frames_decoded(),
      video_frames_dropped(),
      audio_memory_usage(),
      video_memory_usage() {}

PipelineStatistics::PipelineStatistics(
    uint64_t audio_bytes_decoded_in,
    uint64_t video_bytes_decoded_in,
    uint32_t video_frames_decoded_in,
    uint32_t video_frames_dropped_in,
    int64_t audio_memory_usage_in,
    int64_t video_memory_usage_in)
    : audio_bytes_decoded(std::move(audio_bytes_decoded_in)),
      video_bytes_decoded(std::move(video_bytes_decoded_in)),
      video_frames_decoded(std::move(video_frames_decoded_in)),
      video_frames_dropped(std::move(video_frames_dropped_in)),
      audio_memory_usage(std::move(audio_memory_usage_in)),
      video_memory_usage(std::move(video_memory_usage_in)) {}

PipelineStatistics::~PipelineStatistics() = default;

void PipelineStatistics::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("audio_bytes_decoded", base::NumberToString(this->audio_bytes_decoded));
  value->SetString("video_bytes_decoded", base::NumberToString(this->video_bytes_decoded));
  value->SetString("video_frames_decoded", base::NumberToString(this->video_frames_decoded));
  value->SetString("video_frames_dropped", base::NumberToString(this->video_frames_dropped));
  value->SetString("audio_memory_usage", base::NumberToString(this->audio_memory_usage));
  value->SetString("video_memory_usage", base::NumberToString(this->video_memory_usage));
}

bool PipelineStatistics::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PredictionFeatures::PredictionFeatures()
    : profile(),
      video_size(),
      frames_per_sec(0),
      key_system(),
      use_hw_secure_codecs(false) {}

PredictionFeatures::PredictionFeatures(
    ::media::VideoCodecProfile profile_in,
    const ::gfx::Size& video_size_in,
    double frames_per_sec_in,
    const std::string& key_system_in,
    bool use_hw_secure_codecs_in)
    : profile(std::move(profile_in)),
      video_size(std::move(video_size_in)),
      frames_per_sec(std::move(frames_per_sec_in)),
      key_system(std::move(key_system_in)),
      use_hw_secure_codecs(std::move(use_hw_secure_codecs_in)) {}

PredictionFeatures::~PredictionFeatures() = default;

void PredictionFeatures::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("profile", static_cast<int>(this->profile));
  value->SetString("video_size", base::trace_event::ValueToString(this->video_size, "<value of type const ::gfx::Size&>"));
  value->SetDouble("frames_per_sec", this->frames_per_sec);
  value->SetString("key_system", this->key_system);
  value->SetBoolean("use_hw_secure_codecs", this->use_hw_secure_codecs);
}

bool PredictionFeatures::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PredictionTargets::PredictionTargets()
    : frames_decoded(0U),
      frames_dropped(0U),
      frames_power_efficient(0U) {}

PredictionTargets::PredictionTargets(
    uint32_t frames_decoded_in,
    uint32_t frames_dropped_in,
    uint32_t frames_power_efficient_in)
    : frames_decoded(std::move(frames_decoded_in)),
      frames_dropped(std::move(frames_dropped_in)),
      frames_power_efficient(std::move(frames_power_efficient_in)) {}

PredictionTargets::~PredictionTargets() = default;
size_t PredictionTargets::Hash(size_t seed) const {
  seed = mojo::internal::Hash(seed, this->frames_decoded);
  seed = mojo::internal::Hash(seed, this->frames_dropped);
  seed = mojo::internal::Hash(seed, this->frames_power_efficient);
  return seed;
}

void PredictionTargets::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("frames_decoded", base::NumberToString(this->frames_decoded));
  value->SetString("frames_dropped", base::NumberToString(this->frames_dropped));
  value->SetString("frames_power_efficient", base::NumberToString(this->frames_power_efficient));
}

bool PredictionTargets::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
PipelineDecoderInfo::PipelineDecoderInfo()
    : decoder_name(),
      is_platform_decoder(false),
      has_decrypting_demuxer_stream(false) {}

PipelineDecoderInfo::PipelineDecoderInfo(
    const std::string& decoder_name_in,
    bool is_platform_decoder_in,
    bool has_decrypting_demuxer_stream_in)
    : decoder_name(std::move(decoder_name_in)),
      is_platform_decoder(std::move(is_platform_decoder_in)),
      has_decrypting_demuxer_stream(std::move(has_decrypting_demuxer_stream_in)) {}

PipelineDecoderInfo::~PipelineDecoderInfo() = default;

void PipelineDecoderInfo::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("decoder_name", this->decoder_name);
  value->SetBoolean("is_platform_decoder", this->is_platform_decoder);
  value->SetBoolean("has_decrypting_demuxer_stream", this->has_decrypting_demuxer_stream);
}

bool PipelineDecoderInfo::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
Status::Status()
    : code(),
      message(),
      frames(),
      causes(),
      data() {}

Status::Status(
    ::media::StatusCode code_in,
    const base::Optional<std::string>& message_in,
    std::vector<::base::Value> frames_in,
    std::vector<::media::Status> causes_in,
    base::Optional<::base::Value> data_in)
    : code(std::move(code_in)),
      message(std::move(message_in)),
      frames(std::move(frames_in)),
      causes(std::move(causes_in)),
      data(std::move(data_in)) {}

Status::~Status() = default;

void Status::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetInteger("code", static_cast<int>(this->code));
  if (this->message.has_value()) {
    value->SetString("message", this->message.value());
  } else {
    value->SetString("message", "base::nullopt");
  }
  value->BeginArray("frames");
  for (const auto& item0 : this->frames) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type ::base::Value>"));
  }
  value->EndArray();
  value->BeginArray("causes");
  for (const auto& item0 : this->causes) {
    value->AppendString(base::trace_event::ValueToString(item0, "<value of type const ::media::Status&>"));
  }
  value->EndArray();
  value->SetString("data", base::trace_event::ValueToString(this->data, "<value of type base::Optional<::base::Value>>"));
}

bool Status::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
VideoFrameData::VideoFrameData() : tag_(Tag::EOS_DATA) {
  data_.eos_data = new EosVideoFrameDataPtr;
}

VideoFrameData::~VideoFrameData() {
  DestroyActive();
}


void VideoFrameData::set_eos_data(
    EosVideoFrameDataPtr eos_data) {
  if (tag_ == Tag::EOS_DATA) {
    *(data_.eos_data) = std::move(eos_data);
  } else {
    DestroyActive();
    tag_ = Tag::EOS_DATA;
    data_.eos_data = new EosVideoFrameDataPtr(
        std::move(eos_data));
  }
}
void VideoFrameData::set_shared_buffer_data(
    SharedBufferVideoFrameDataPtr shared_buffer_data) {
  if (tag_ == Tag::SHARED_BUFFER_DATA) {
    *(data_.shared_buffer_data) = std::move(shared_buffer_data);
  } else {
    DestroyActive();
    tag_ = Tag::SHARED_BUFFER_DATA;
    data_.shared_buffer_data = new SharedBufferVideoFrameDataPtr(
        std::move(shared_buffer_data));
  }
}
void VideoFrameData::set_dmabuf_data(
    DmabufVideoFrameDataPtr dmabuf_data) {
  if (tag_ == Tag::DMABUF_DATA) {
    *(data_.dmabuf_data) = std::move(dmabuf_data);
  } else {
    DestroyActive();
    tag_ = Tag::DMABUF_DATA;
    data_.dmabuf_data = new DmabufVideoFrameDataPtr(
        std::move(dmabuf_data));
  }
}
void VideoFrameData::set_gpu_memory_buffer_data(
    GpuMemoryBufferVideoFrameDataPtr gpu_memory_buffer_data) {
  if (tag_ == Tag::GPU_MEMORY_BUFFER_DATA) {
    *(data_.gpu_memory_buffer_data) = std::move(gpu_memory_buffer_data);
  } else {
    DestroyActive();
    tag_ = Tag::GPU_MEMORY_BUFFER_DATA;
    data_.gpu_memory_buffer_data = new GpuMemoryBufferVideoFrameDataPtr(
        std::move(gpu_memory_buffer_data));
  }
}
void VideoFrameData::set_mailbox_data(
    MailboxVideoFrameDataPtr mailbox_data) {
  if (tag_ == Tag::MAILBOX_DATA) {
    *(data_.mailbox_data) = std::move(mailbox_data);
  } else {
    DestroyActive();
    tag_ = Tag::MAILBOX_DATA;
    data_.mailbox_data = new MailboxVideoFrameDataPtr(
        std::move(mailbox_data));
  }
}

void VideoFrameData::DestroyActive() {
  switch (tag_) {

    case Tag::EOS_DATA:

      delete data_.eos_data;
      break;
    case Tag::SHARED_BUFFER_DATA:

      delete data_.shared_buffer_data;
      break;
    case Tag::DMABUF_DATA:

      delete data_.dmabuf_data;
      break;
    case Tag::GPU_MEMORY_BUFFER_DATA:

      delete data_.gpu_memory_buffer_data;
      break;
    case Tag::MAILBOX_DATA:

      delete data_.mailbox_data;
      break;
  }
}

bool VideoFrameData::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context, false);
}
}  // namespace mojom
}  // namespace media

namespace mojo {


// static
bool StructTraits<::media::mojom::VideoTransformation::DataView, ::media::mojom::VideoTransformationPtr>::Read(
    ::media::mojom::VideoTransformation::DataView input,
    ::media::mojom::VideoTransformationPtr* output) {
  bool success = true;
  ::media::mojom::VideoTransformationPtr result(::media::mojom::VideoTransformation::New());
  
      if (success && !input.ReadRotation(&result->rotation))
        success = false;
      if (success)
        result->mirrored = input.mirrored();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::EncryptionPattern::DataView, ::media::mojom::EncryptionPatternPtr>::Read(
    ::media::mojom::EncryptionPattern::DataView input,
    ::media::mojom::EncryptionPatternPtr* output) {
  bool success = true;
  ::media::mojom::EncryptionPatternPtr result(::media::mojom::EncryptionPattern::New());
  
      if (success)
        result->crypt_byte_block = input.crypt_byte_block();
      if (success)
        result->skip_byte_block = input.skip_byte_block();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::VideoColorSpace::DataView, ::media::mojom::VideoColorSpacePtr>::Read(
    ::media::mojom::VideoColorSpace::DataView input,
    ::media::mojom::VideoColorSpacePtr* output) {
  bool success = true;
  ::media::mojom::VideoColorSpacePtr result(::media::mojom::VideoColorSpace::New());
  
      if (success && !input.ReadPrimaries(&result->primaries))
        success = false;
      if (success && !input.ReadTransfer(&result->transfer))
        success = false;
      if (success && !input.ReadMatrix(&result->matrix))
        success = false;
      if (success && !input.ReadRange(&result->range))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::AudioDecoderConfig::DataView, ::media::mojom::AudioDecoderConfigPtr>::Read(
    ::media::mojom::AudioDecoderConfig::DataView input,
    ::media::mojom::AudioDecoderConfigPtr* output) {
  bool success = true;
  ::media::mojom::AudioDecoderConfigPtr result(::media::mojom::AudioDecoderConfig::New());
  
      if (success && !input.ReadCodec(&result->codec))
        success = false;
      if (success && !input.ReadProfile(&result->profile))
        success = false;
      if (success && !input.ReadSampleFormat(&result->sample_format))
        success = false;
      if (success && !input.ReadChannelLayout(&result->channel_layout))
        success = false;
      if (success)
        result->samples_per_second = input.samples_per_second();
      if (success && !input.ReadExtraData(&result->extra_data))
        success = false;
      if (success && !input.ReadSeekPreroll(&result->seek_preroll))
        success = false;
      if (success)
        result->codec_delay = input.codec_delay();
      if (success && !input.ReadEncryptionScheme(&result->encryption_scheme))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::VideoDecoderConfig::DataView, ::media::mojom::VideoDecoderConfigPtr>::Read(
    ::media::mojom::VideoDecoderConfig::DataView input,
    ::media::mojom::VideoDecoderConfigPtr* output) {
  bool success = true;
  ::media::mojom::VideoDecoderConfigPtr result(::media::mojom::VideoDecoderConfig::New());
  
      if (success && !input.ReadCodec(&result->codec))
        success = false;
      if (success && !input.ReadProfile(&result->profile))
        success = false;
      if (success)
        result->level = input.level();
      if (success)
        result->has_alpha = input.has_alpha();
      if (success && !input.ReadTransformation(&result->transformation))
        success = false;
      if (success && !input.ReadCodedSize(&result->coded_size))
        success = false;
      if (success && !input.ReadVisibleRect(&result->visible_rect))
        success = false;
      if (success && !input.ReadNaturalSize(&result->natural_size))
        success = false;
      if (success && !input.ReadExtraData(&result->extra_data))
        success = false;
      if (success && !input.ReadEncryptionScheme(&result->encryption_scheme))
        success = false;
      if (success && !input.ReadColorSpaceInfo(&result->color_space_info))
        success = false;
      if (success && !input.ReadHdrMetadata(&result->hdr_metadata))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::DecryptConfig::DataView, ::media::mojom::DecryptConfigPtr>::Read(
    ::media::mojom::DecryptConfig::DataView input,
    ::media::mojom::DecryptConfigPtr* output) {
  bool success = true;
  ::media::mojom::DecryptConfigPtr result(::media::mojom::DecryptConfig::New());
  
      if (success && !input.ReadEncryptionScheme(&result->encryption_scheme))
        success = false;
      if (success && !input.ReadKeyId(&result->key_id))
        success = false;
      if (success && !input.ReadIv(&result->iv))
        success = false;
      if (success && !input.ReadSubsamples(&result->subsamples))
        success = false;
      if (success && !input.ReadEncryptionPattern(&result->encryption_pattern))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::DecoderBuffer::DataView, ::media::mojom::DecoderBufferPtr>::Read(
    ::media::mojom::DecoderBuffer::DataView input,
    ::media::mojom::DecoderBufferPtr* output) {
  bool success = true;
  ::media::mojom::DecoderBufferPtr result(::media::mojom::DecoderBuffer::New());
  
      if (success && !input.ReadTimestamp(&result->timestamp))
        success = false;
      if (success && !input.ReadDuration(&result->duration))
        success = false;
      if (success)
        result->is_end_of_stream = input.is_end_of_stream();
      if (success)
        result->data_size = input.data_size();
      if (success)
        result->is_key_frame = input.is_key_frame();
      if (success && !input.ReadSideData(&result->side_data))
        success = false;
      if (success && !input.ReadDecryptConfig(&result->decrypt_config))
        success = false;
      if (success && !input.ReadFrontDiscard(&result->front_discard))
        success = false;
      if (success && !input.ReadBackDiscard(&result->back_discard))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::AudioBuffer::DataView, ::media::mojom::AudioBufferPtr>::Read(
    ::media::mojom::AudioBuffer::DataView input,
    ::media::mojom::AudioBufferPtr* output) {
  bool success = true;
  ::media::mojom::AudioBufferPtr result(::media::mojom::AudioBuffer::New());
  
      if (success && !input.ReadSampleFormat(&result->sample_format))
        success = false;
      if (success && !input.ReadChannelLayout(&result->channel_layout))
        success = false;
      if (success)
        result->channel_count = input.channel_count();
      if (success)
        result->sample_rate = input.sample_rate();
      if (success)
        result->frame_count = input.frame_count();
      if (success)
        result->end_of_stream = input.end_of_stream();
      if (success && !input.ReadTimestamp(&result->timestamp))
        success = false;
      if (success && !input.ReadData(&result->data))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::AudioDataS16::DataView, ::media::mojom::AudioDataS16Ptr>::Read(
    ::media::mojom::AudioDataS16::DataView input,
    ::media::mojom::AudioDataS16Ptr* output) {
  bool success = true;
  ::media::mojom::AudioDataS16Ptr result(::media::mojom::AudioDataS16::New());
  
      if (success)
        result->channel_count = input.channel_count();
      if (success)
        result->sample_rate = input.sample_rate();
      if (success)
        result->frame_count = input.frame_count();
      if (success && !input.ReadData(&result->data))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::VideoFrameMetadata::DataView, ::media::mojom::VideoFrameMetadataPtr>::Read(
    ::media::mojom::VideoFrameMetadata::DataView input,
    ::media::mojom::VideoFrameMetadataPtr* output) {
  bool success = true;
  ::media::mojom::VideoFrameMetadataPtr result(::media::mojom::VideoFrameMetadata::New());
  
      if (success)
        result->allow_overlay = input.allow_overlay();
      if (success && !input.ReadCaptureBeginTime(&result->capture_begin_time))
        success = false;
      if (success && !input.ReadCaptureEndTime(&result->capture_end_time))
        success = false;
      if (success)
        result->has_capture_counter = input.has_capture_counter();
      if (success)
        result->capture_counter = input.capture_counter();
      if (success && !input.ReadCaptureUpdateRect(&result->capture_update_rect))
        success = false;
      if (success)
        result->has_copy_mode = input.has_copy_mode();
      if (success && !input.ReadCopyMode(&result->copy_mode))
        success = false;
      if (success)
        result->end_of_stream = input.end_of_stream();
      if (success && !input.ReadFrameDuration(&result->frame_duration))
        success = false;
      if (success)
        result->has_frame_rate = input.has_frame_rate();
      if (success)
        result->frame_rate = input.frame_rate();
      if (success)
        result->interactive_content = input.interactive_content();
      if (success && !input.ReadReferenceTime(&result->reference_time))
        success = false;
      if (success)
        result->read_lock_fences_enabled = input.read_lock_fences_enabled();
      if (success)
        result->has_rotation = input.has_rotation();
      if (success && !input.ReadRotation(&result->rotation))
        success = false;
      if (success)
        result->texture_owner = input.texture_owner();
      if (success)
        result->wants_promotion_hint = input.wants_promotion_hint();
      if (success)
        result->protected_video = input.protected_video();
      if (success)
        result->hw_protected = input.hw_protected();
      if (success && !input.ReadOverlayPlaneId(&result->overlay_plane_id))
        success = false;
      if (success)
        result->power_efficient = input.power_efficient();
      if (success)
        result->has_device_scale_factor = input.has_device_scale_factor();
      if (success)
        result->device_scale_factor = input.device_scale_factor();
      if (success)
        result->has_page_scale_factor = input.has_page_scale_factor();
      if (success)
        result->page_scale_factor = input.page_scale_factor();
      if (success)
        result->has_root_scroll_offset_x = input.has_root_scroll_offset_x();
      if (success)
        result->root_scroll_offset_x = input.root_scroll_offset_x();
      if (success)
        result->has_root_scroll_offset_y = input.has_root_scroll_offset_y();
      if (success)
        result->root_scroll_offset_y = input.root_scroll_offset_y();
      if (success)
        result->has_top_controls_visible_height = input.has_top_controls_visible_height();
      if (success)
        result->top_controls_visible_height = input.top_controls_visible_height();
      if (success && !input.ReadDecodeBeginTime(&result->decode_begin_time))
        success = false;
      if (success && !input.ReadDecodeEndTime(&result->decode_end_time))
        success = false;
      if (success && !input.ReadProcessingTime(&result->processing_time))
        success = false;
      if (success)
        result->has_rtp_timestamp = input.has_rtp_timestamp();
      if (success)
        result->rtp_timestamp = input.rtp_timestamp();
      if (success && !input.ReadReceiveTime(&result->receive_time))
        success = false;
      if (success && !input.ReadWallclockFrameDuration(&result->wallclock_frame_duration))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::VideoFrame::DataView, ::media::mojom::VideoFramePtr>::Read(
    ::media::mojom::VideoFrame::DataView input,
    ::media::mojom::VideoFramePtr* output) {
  bool success = true;
  ::media::mojom::VideoFramePtr result(::media::mojom::VideoFrame::New());
  
      if (success && !input.ReadFormat(&result->format))
        success = false;
      if (success && !input.ReadCodedSize(&result->coded_size))
        success = false;
      if (success && !input.ReadVisibleRect(&result->visible_rect))
        success = false;
      if (success && !input.ReadNaturalSize(&result->natural_size))
        success = false;
      if (success && !input.ReadTimestamp(&result->timestamp))
        success = false;
      if (success && !input.ReadData(&result->data))
        success = false;
      if (success && !input.ReadMetadata(&result->metadata))
        success = false;
      if (success && !input.ReadColorSpace(&result->color_space))
        success = false;
      if (success && !input.ReadHdrMetadata(&result->hdr_metadata))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::EosVideoFrameData::DataView, ::media::mojom::EosVideoFrameDataPtr>::Read(
    ::media::mojom::EosVideoFrameData::DataView input,
    ::media::mojom::EosVideoFrameDataPtr* output) {
  bool success = true;
  ::media::mojom::EosVideoFrameDataPtr result(::media::mojom::EosVideoFrameData::New());
  
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::SharedBufferVideoFrameData::DataView, ::media::mojom::SharedBufferVideoFrameDataPtr>::Read(
    ::media::mojom::SharedBufferVideoFrameData::DataView input,
    ::media::mojom::SharedBufferVideoFrameDataPtr* output) {
  bool success = true;
  ::media::mojom::SharedBufferVideoFrameDataPtr result(::media::mojom::SharedBufferVideoFrameData::New());
  
      if (success)
        result->frame_data = input.TakeFrameData();
      if (success)
        result->frame_data_size = input.frame_data_size();
      if (success && !input.ReadStrides(&result->strides))
        success = false;
      if (success && !input.ReadOffsets(&result->offsets))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::DmabufVideoFrameData::DataView, ::media::mojom::DmabufVideoFrameDataPtr>::Read(
    ::media::mojom::DmabufVideoFrameData::DataView input,
    ::media::mojom::DmabufVideoFrameDataPtr* output) {
  bool success = true;
  ::media::mojom::DmabufVideoFrameDataPtr result(::media::mojom::DmabufVideoFrameData::New());
  
      if (success && !input.ReadDmabufFds(&result->dmabuf_fds))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::GpuMemoryBufferVideoFrameData::DataView, ::media::mojom::GpuMemoryBufferVideoFrameDataPtr>::Read(
    ::media::mojom::GpuMemoryBufferVideoFrameData::DataView input,
    ::media::mojom::GpuMemoryBufferVideoFrameDataPtr* output) {
  bool success = true;
  ::media::mojom::GpuMemoryBufferVideoFrameDataPtr result(::media::mojom::GpuMemoryBufferVideoFrameData::New());
  
      if (success && !input.ReadGpuMemoryBufferHandle(&result->gpu_memory_buffer_handle))
        success = false;
      if (success && !input.ReadMailboxHolder(&result->mailbox_holder))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::MailboxVideoFrameData::DataView, ::media::mojom::MailboxVideoFrameDataPtr>::Read(
    ::media::mojom::MailboxVideoFrameData::DataView input,
    ::media::mojom::MailboxVideoFrameDataPtr* output) {
  bool success = true;
  ::media::mojom::MailboxVideoFrameDataPtr result(::media::mojom::MailboxVideoFrameData::New());
  
      if (success && !input.ReadMailboxHolder(&result->mailbox_holder))
        success = false;
      if (success && !input.ReadYcbcrData(&result->ycbcr_data))
        success = false;
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::PipelineStatistics::DataView, ::media::mojom::PipelineStatisticsPtr>::Read(
    ::media::mojom::PipelineStatistics::DataView input,
    ::media::mojom::PipelineStatisticsPtr* output) {
  bool success = true;
  ::media::mojom::PipelineStatisticsPtr result(::media::mojom::PipelineStatistics::New());
  
      if (success)
        result->audio_bytes_decoded = input.audio_bytes_decoded();
      if (success)
        result->video_bytes_decoded = input.video_bytes_decoded();
      if (success)
        result->video_frames_decoded = input.video_frames_decoded();
      if (success)
        result->video_frames_dropped = input.video_frames_dropped();
      if (success)
        result->audio_memory_usage = input.audio_memory_usage();
      if (success)
        result->video_memory_usage = input.video_memory_usage();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::PredictionFeatures::DataView, ::media::mojom::PredictionFeaturesPtr>::Read(
    ::media::mojom::PredictionFeatures::DataView input,
    ::media::mojom::PredictionFeaturesPtr* output) {
  bool success = true;
  ::media::mojom::PredictionFeaturesPtr result(::media::mojom::PredictionFeatures::New());
  
      if (success && !input.ReadProfile(&result->profile))
        success = false;
      if (success && !input.ReadVideoSize(&result->video_size))
        success = false;
      if (success)
        result->frames_per_sec = input.frames_per_sec();
      if (success && !input.ReadKeySystem(&result->key_system))
        success = false;
      if (success)
        result->use_hw_secure_codecs = input.use_hw_secure_codecs();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::PredictionTargets::DataView, ::media::mojom::PredictionTargetsPtr>::Read(
    ::media::mojom::PredictionTargets::DataView input,
    ::media::mojom::PredictionTargetsPtr* output) {
  bool success = true;
  ::media::mojom::PredictionTargetsPtr result(::media::mojom::PredictionTargets::New());
  
      if (success)
        result->frames_decoded = input.frames_decoded();
      if (success)
        result->frames_dropped = input.frames_dropped();
      if (success)
        result->frames_power_efficient = input.frames_power_efficient();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::PipelineDecoderInfo::DataView, ::media::mojom::PipelineDecoderInfoPtr>::Read(
    ::media::mojom::PipelineDecoderInfo::DataView input,
    ::media::mojom::PipelineDecoderInfoPtr* output) {
  bool success = true;
  ::media::mojom::PipelineDecoderInfoPtr result(::media::mojom::PipelineDecoderInfo::New());
  
      if (success && !input.ReadDecoderName(&result->decoder_name))
        success = false;
      if (success)
        result->is_platform_decoder = input.is_platform_decoder();
      if (success)
        result->has_decrypting_demuxer_stream = input.has_decrypting_demuxer_stream();
  *output = std::move(result);
  return success;
}


// static
bool StructTraits<::media::mojom::Status::DataView, ::media::mojom::StatusPtr>::Read(
    ::media::mojom::Status::DataView input,
    ::media::mojom::StatusPtr* output) {
  bool success = true;
  ::media::mojom::StatusPtr result(::media::mojom::Status::New());
  
      if (success && !input.ReadCode(&result->code))
        success = false;
      if (success && !input.ReadMessage(&result->message))
        success = false;
      if (success && !input.ReadFrames(&result->frames))
        success = false;
      if (success && !input.ReadCauses(&result->causes))
        success = false;
      if (success && !input.ReadData(&result->data))
        success = false;
  *output = std::move(result);
  return success;
}

// static
bool UnionTraits<::media::mojom::VideoFrameData::DataView, ::media::mojom::VideoFrameDataPtr>::Read(
    ::media::mojom::VideoFrameData::DataView input,
    ::media::mojom::VideoFrameDataPtr* output) {
  using UnionType = ::media::mojom::VideoFrameData;
  using Tag = UnionType::Tag;

  switch (input.tag()) {
    case Tag::EOS_DATA: {
      ::media::mojom::EosVideoFrameDataPtr result_eos_data;
      if (!input.ReadEosData(&result_eos_data))
        return false;

      *output = UnionType::NewEosData(
          std::move(result_eos_data));
      break;
    }
    case Tag::SHARED_BUFFER_DATA: {
      ::media::mojom::SharedBufferVideoFrameDataPtr result_shared_buffer_data;
      if (!input.ReadSharedBufferData(&result_shared_buffer_data))
        return false;

      *output = UnionType::NewSharedBufferData(
          std::move(result_shared_buffer_data));
      break;
    }
    case Tag::DMABUF_DATA: {
      ::media::mojom::DmabufVideoFrameDataPtr result_dmabuf_data;
      if (!input.ReadDmabufData(&result_dmabuf_data))
        return false;

      *output = UnionType::NewDmabufData(
          std::move(result_dmabuf_data));
      break;
    }
    case Tag::GPU_MEMORY_BUFFER_DATA: {
      ::media::mojom::GpuMemoryBufferVideoFrameDataPtr result_gpu_memory_buffer_data;
      if (!input.ReadGpuMemoryBufferData(&result_gpu_memory_buffer_data))
        return false;

      *output = UnionType::NewGpuMemoryBufferData(
          std::move(result_gpu_memory_buffer_data));
      break;
    }
    case Tag::MAILBOX_DATA: {
      ::media::mojom::MailboxVideoFrameDataPtr result_mailbox_data;
      if (!input.ReadMailboxData(&result_mailbox_data))
        return false;

      *output = UnionType::NewMailboxData(
          std::move(result_mailbox_data));
      break;
    }
    default:
      return false;
  }
  return true;
}

}  // namespace mojo

#if defined(__clang__)
#pragma clang diagnostic pop
#endif