| // camera/mojo/gpu/mjpeg_decode_accelerator.mojom-params-data.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2019 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_PARAMS_DATA_H_ |
| #define CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_PARAMS_DATA_H_ |
| |
| #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
| #include "mojo/public/cpp/bindings/lib/buffer.h" |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wunused-private-field" |
| #endif |
| |
| namespace mojo::internal { |
| class ValidationContext; |
| } |
| |
| |
| namespace cros::mojom { |
| namespace internal { |
| class MjpegDecodeAccelerator_Initialize_Params_Data { |
| public: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| |
| mojo::internal::StructHeader header_; |
| |
| private: |
| friend class mojo::internal::MessageFragment<MjpegDecodeAccelerator_Initialize_Params_Data>; |
| |
| MjpegDecodeAccelerator_Initialize_Params_Data(); |
| ~MjpegDecodeAccelerator_Initialize_Params_Data() = delete; |
| }; |
| static_assert(sizeof(MjpegDecodeAccelerator_Initialize_Params_Data) == 8, |
| "Bad sizeof(MjpegDecodeAccelerator_Initialize_Params_Data)"); |
| class MjpegDecodeAccelerator_Initialize_ResponseParams_Data { |
| public: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| |
| mojo::internal::StructHeader header_; |
| uint8_t success : 1; |
| uint8_t padfinal_[7]; |
| |
| private: |
| friend class mojo::internal::MessageFragment<MjpegDecodeAccelerator_Initialize_ResponseParams_Data>; |
| |
| MjpegDecodeAccelerator_Initialize_ResponseParams_Data(); |
| ~MjpegDecodeAccelerator_Initialize_ResponseParams_Data() = delete; |
| }; |
| static_assert(sizeof(MjpegDecodeAccelerator_Initialize_ResponseParams_Data) == 16, |
| "Bad sizeof(MjpegDecodeAccelerator_Initialize_ResponseParams_Data)"); |
| class MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data { |
| public: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| |
| mojo::internal::StructHeader header_; |
| int32_t task_id; |
| mojo::internal::Handle_Data src_dmabuf_fd; |
| uint32_t src_size; |
| uint32_t src_offset; |
| mojo::internal::Pointer<::cros::mojom::internal::DmaBufVideoFrame_Data> dst_frame; |
| |
| private: |
| friend class mojo::internal::MessageFragment<MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data>; |
| |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data(); |
| ~MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data() = delete; |
| }; |
| static_assert(sizeof(MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data) == 32, |
| "Bad sizeof(MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data)"); |
| class MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data { |
| public: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| |
| mojo::internal::StructHeader header_; |
| int32_t error; |
| uint8_t padfinal_[4]; |
| |
| private: |
| friend class mojo::internal::MessageFragment<MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data>; |
| |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data(); |
| ~MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data() = delete; |
| }; |
| static_assert(sizeof(MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data) == 16, |
| "Bad sizeof(MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data)"); |
| class MjpegDecodeAccelerator_Uninitialize_Params_Data { |
| public: |
| static bool Validate(const void* data, |
| mojo::internal::ValidationContext* validation_context); |
| |
| mojo::internal::StructHeader header_; |
| |
| private: |
| friend class mojo::internal::MessageFragment<MjpegDecodeAccelerator_Uninitialize_Params_Data>; |
| |
| MjpegDecodeAccelerator_Uninitialize_Params_Data(); |
| ~MjpegDecodeAccelerator_Uninitialize_Params_Data() = delete; |
| }; |
| static_assert(sizeof(MjpegDecodeAccelerator_Uninitialize_Params_Data) == 8, |
| "Bad sizeof(MjpegDecodeAccelerator_Uninitialize_Params_Data)"); |
| |
| } // namespace internal |
| |
| |
| class MjpegDecodeAccelerator_Initialize_ParamsDataView { |
| public: |
| MjpegDecodeAccelerator_Initialize_ParamsDataView() = default; |
| |
| MjpegDecodeAccelerator_Initialize_ParamsDataView( |
| internal::MjpegDecodeAccelerator_Initialize_Params_Data* data, |
| mojo::Message* message) |
| : data_(data) {} |
| |
| bool is_null() const { return !data_; } |
| private: |
| internal::MjpegDecodeAccelerator_Initialize_Params_Data* data_ = nullptr; |
| }; |
| |
| |
| class MjpegDecodeAccelerator_Initialize_ResponseParamsDataView { |
| public: |
| MjpegDecodeAccelerator_Initialize_ResponseParamsDataView() = default; |
| |
| MjpegDecodeAccelerator_Initialize_ResponseParamsDataView( |
| internal::MjpegDecodeAccelerator_Initialize_ResponseParams_Data* data, |
| mojo::Message* message) |
| : data_(data) {} |
| |
| bool is_null() const { return !data_; } |
| bool success() const { |
| return data_->success; |
| } |
| private: |
| internal::MjpegDecodeAccelerator_Initialize_ResponseParams_Data* data_ = nullptr; |
| }; |
| |
| |
| class MjpegDecodeAccelerator_DecodeWithDmaBuf_ParamsDataView { |
| public: |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_ParamsDataView() = default; |
| |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_ParamsDataView( |
| internal::MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data* data, |
| mojo::Message* message) |
| : data_(data), message_(message) {} |
| |
| bool is_null() const { return !data_; } |
| int32_t task_id() const { |
| return data_->task_id; |
| } |
| mojo::ScopedHandle TakeSrcDmabufFd() { |
| mojo::ScopedHandle result; |
| bool ret = |
| mojo::internal::Deserialize<mojo::ScopedHandle>( |
| &data_->src_dmabuf_fd, &result, message_); |
| DCHECK(ret); |
| return result; |
| } |
| uint32_t src_size() const { |
| return data_->src_size; |
| } |
| uint32_t src_offset() const { |
| return data_->src_offset; |
| } |
| inline void GetDstFrameDataView( |
| ::cros::mojom::DmaBufVideoFrameDataView* output); |
| |
| template <typename UserType> |
| [[nodiscard]] bool ReadDstFrame(UserType* output) { |
| |
| auto* pointer = data_->dst_frame.Get(); |
| return mojo::internal::Deserialize<::cros::mojom::DmaBufVideoFrameDataView>( |
| pointer, output, message_); |
| } |
| private: |
| internal::MjpegDecodeAccelerator_DecodeWithDmaBuf_Params_Data* data_ = nullptr; |
| mojo::Message* message_ = nullptr; |
| }; |
| |
| |
| class MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParamsDataView { |
| public: |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParamsDataView() = default; |
| |
| MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParamsDataView( |
| internal::MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data* data, |
| mojo::Message* message) |
| : data_(data) {} |
| |
| bool is_null() const { return !data_; } |
| template <typename UserType> |
| [[nodiscard]] bool ReadError(UserType* output) const { |
| auto data_value = data_->error; |
| return mojo::internal::Deserialize<::cros::mojom::DecodeError>( |
| data_value, output); |
| } |
| DecodeError error() const { |
| return ::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::cros::mojom::DecodeError>(data_->error)); |
| } |
| private: |
| internal::MjpegDecodeAccelerator_DecodeWithDmaBuf_ResponseParams_Data* data_ = nullptr; |
| }; |
| |
| |
| class MjpegDecodeAccelerator_Uninitialize_ParamsDataView { |
| public: |
| MjpegDecodeAccelerator_Uninitialize_ParamsDataView() = default; |
| |
| MjpegDecodeAccelerator_Uninitialize_ParamsDataView( |
| internal::MjpegDecodeAccelerator_Uninitialize_Params_Data* data, |
| mojo::Message* message) |
| : data_(data) {} |
| |
| bool is_null() const { return !data_; } |
| private: |
| internal::MjpegDecodeAccelerator_Uninitialize_Params_Data* data_ = nullptr; |
| }; |
| |
| |
| |
| |
| |
| inline void MjpegDecodeAccelerator_DecodeWithDmaBuf_ParamsDataView::GetDstFrameDataView( |
| ::cros::mojom::DmaBufVideoFrameDataView* output) { |
| auto pointer = data_->dst_frame.Get(); |
| *output = ::cros::mojom::DmaBufVideoFrameDataView(pointer, message_); |
| } |
| |
| |
| |
| |
| |
| |
| |
| } // cros::mojom |
| |
| #if defined(__clang__) |
| #pragma clang diagnostic pop |
| #endif |
| |
| #endif // CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_PARAMS_DATA_H_ |