// services/video_capture/public/mojom/video_frame_handler.mojom-data-view.h is auto generated by mojom_bindings_generator.py, do not edit

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_MOJOM_VIDEO_FRAME_HANDLER_MOJOM_DATA_VIEW_H_
#define SERVICES_VIDEO_CAPTURE_PUBLIC_MOJOM_VIDEO_FRAME_HANDLER_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "services/video_capture/public/mojom/video_frame_handler.mojom-shared-internal.h"
#include "media/capture/mojom/video_capture_buffer.mojom-shared.h"
#include "media/capture/mojom/video_capture_types.mojom-shared.h"
#include "media/mojo/mojom/media_types.mojom-shared.h"


namespace video_capture::mojom {
class ReadyFrameInBufferDataView;



}  // video_capture::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::video_capture::mojom::ReadyFrameInBufferDataView> {
  using Data = ::video_capture::mojom::internal::ReadyFrameInBuffer_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace video_capture::mojom {
// Interface base classes. They are used for type safety check.
class VideoFrameAccessHandlerInterfaceBase {};

using VideoFrameAccessHandlerPtrDataView =
    mojo::InterfacePtrDataView<VideoFrameAccessHandlerInterfaceBase>;
using VideoFrameAccessHandlerRequestDataView =
    mojo::InterfaceRequestDataView<VideoFrameAccessHandlerInterfaceBase>;
using VideoFrameAccessHandlerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<VideoFrameAccessHandlerInterfaceBase>;
using VideoFrameAccessHandlerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<VideoFrameAccessHandlerInterfaceBase>;
class VideoFrameHandlerInterfaceBase {};

using VideoFrameHandlerPtrDataView =
    mojo::InterfacePtrDataView<VideoFrameHandlerInterfaceBase>;
using VideoFrameHandlerRequestDataView =
    mojo::InterfaceRequestDataView<VideoFrameHandlerInterfaceBase>;
using VideoFrameHandlerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<VideoFrameHandlerInterfaceBase>;
using VideoFrameHandlerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<VideoFrameHandlerInterfaceBase>;


class ReadyFrameInBufferDataView {
 public:
  ReadyFrameInBufferDataView() = default;

  ReadyFrameInBufferDataView(
      internal::ReadyFrameInBuffer_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  int32_t buffer_id() const {
    return data_->buffer_id;
  }
  int32_t frame_feedback_id() const {
    return data_->frame_feedback_id;
  }
  inline void GetFrameInfoDataView(
      ::media::mojom::VideoFrameInfoDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFrameInfo(UserType* output) {
    
    auto* pointer = data_->frame_info.Get();
    return mojo::internal::Deserialize<::media::mojom::VideoFrameInfoDataView>(
        pointer, output, message_);
  }
 private:
  internal::ReadyFrameInBuffer_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // video_capture::mojom

#endif  // SERVICES_VIDEO_CAPTURE_PUBLIC_MOJOM_VIDEO_FRAME_HANDLER_MOJOM_DATA_VIEW_H_