blob: 857072224938f417ac2dde4231c37ee016d32cdd [file] [log] [blame]
// components/chromeos_camera/common/mjpeg_decode_accelerator.mojom-shared-internal.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_CHROMEOS_CAMERA_COMMON_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_INTERNAL_H_
#define COMPONENTS_CHROMEOS_CAMERA_COMMON_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_INTERNAL_H_
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/buffer.h"
#include "components/chromeos_camera/common/dmabuf.mojom-shared-internal.h"
#include "media/mojo/mojom/media_types.mojom-shared-internal.h"
#include "mojo/public/mojom/base/time.mojom-shared-internal.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared-internal.h"
#include "mojo/public/cpp/bindings/lib/native_enum_data.h"
#include "mojo/public/interfaces/bindings/native_struct.mojom-shared-internal.h"
namespace mojo {
namespace internal {
class ValidationContext;
}
}
namespace chromeos_camera::mojom {
namespace internal {
class BitstreamBuffer_Data;
struct DecodeError_Data {
public:
static bool constexpr kIsExtensible = false;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
#pragma pack(push, 1)
class BitstreamBuffer_Data {
public:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
mojo::internal::StructHeader header_;
int32_t id;
mojo::internal::Handle_Data memory_handle;
uint32_t size;
uint8_t pad2_[4];
int64_t offset;
mojo::internal::Pointer<::mojo_base::mojom::internal::TimeDelta_Data> timestamp;
mojo::internal::Pointer<mojo::internal::String_Data> key_id;
mojo::internal::Pointer<mojo::internal::String_Data> iv;
mojo::internal::Pointer<mojo::internal::Array_Data<mojo::internal::Pointer<::media::mojom::internal::SubsampleEntry_Data>>> subsamples;
private:
friend class mojo::internal::MessageFragment<BitstreamBuffer_Data>;
BitstreamBuffer_Data();
~BitstreamBuffer_Data() = delete;
};
static_assert(sizeof(BitstreamBuffer_Data) == 64,
"Bad sizeof(BitstreamBuffer_Data)");
// Used by BitstreamBuffer::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct BitstreamBuffer_UnserializedMessageContext
: public mojo::internal::UnserializedMessageContext {
public:
static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;
BitstreamBuffer_UnserializedMessageContext(
uint32_t message_name,
uint32_t message_flags,
UserType input)
: mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
, user_data_(std::move(input)) {}
~BitstreamBuffer_UnserializedMessageContext() override = default;
UserType TakeData() {
return std::move(user_data_);
}
private:
// mojo::internal::UnserializedMessageContext:
void Serialize(mojo::Message& message) override {
mojo::internal::MessageFragment<BitstreamBuffer_Data> fragment(message);
mojo::internal::Serialize<DataView>(user_data_, fragment);
}
UserType user_data_;
};
template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
BitstreamBuffer_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
#pragma pack(pop)
} // namespace internal
} // chromeos_camera::mojom
#endif // COMPONENTS_CHROMEOS_CAMERA_COMMON_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_INTERNAL_H_