| // camera/mojo/algorithm/camera_algorithm.mojom.h is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2013 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_ALGORITHM_CAMERA_ALGORITHM_MOJOM_H_ |
| #define CAMERA_MOJO_ALGORITHM_CAMERA_ALGORITHM_MOJOM_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <optional> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "base/types/cxx23_to_underlying.h" |
| #include "mojo/public/cpp/bindings/clone_traits.h" |
| #include "mojo/public/cpp/bindings/equals_traits.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/struct_ptr.h" |
| #include "mojo/public/cpp/bindings/struct_traits.h" |
| #include "mojo/public/cpp/bindings/union_traits.h" |
| |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" |
| |
| #include "camera/mojo/algorithm/camera_algorithm.mojom-features.h" |
| #include "camera/mojo/algorithm/camera_algorithm.mojom-shared.h" |
| #include "camera/mojo/algorithm/camera_algorithm.mojom-forward.h" |
| #include <string> |
| #include <vector> |
| |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/lib/message_size_estimator.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| |
| |
| |
| |
| |
| |
| namespace cros::mojom { |
| |
| class CameraAlgorithmOpsProxy; |
| |
| template <typename ImplRefTraits> |
| class CameraAlgorithmOpsStub; |
| |
| class CameraAlgorithmOpsRequestValidator; |
| class CameraAlgorithmOpsResponseValidator; |
| |
| |
| class CameraAlgorithmOps |
| : public CameraAlgorithmOpsInterfaceBase { |
| public: |
| using IPCStableHashFunction = uint32_t(*)(); |
| |
| static const char Name_[]; |
| static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = CameraAlgorithmOpsInterfaceBase; |
| using Proxy_ = CameraAlgorithmOpsProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = CameraAlgorithmOpsStub<ImplRefTraits>; |
| |
| using RequestValidator_ = CameraAlgorithmOpsRequestValidator; |
| using ResponseValidator_ = CameraAlgorithmOpsResponseValidator; |
| enum MethodMinVersions : uint32_t { |
| kInitializeMinVersion = 0, |
| kRegisterBufferMinVersion = 0, |
| kRequestMinVersion = 0, |
| kDeregisterBuffersMinVersion = 0, |
| kUpdateReturnMinVersion = 0, |
| kDeinitializeMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct Initialize_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct RegisterBuffer_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct Request_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct DeregisterBuffers_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct UpdateReturn_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct Deinitialize_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~CameraAlgorithmOps() = default; |
| |
| |
| using InitializeCallback = base::OnceCallback<void(int32_t)>; |
| |
| virtual void Initialize(::mojo::PendingRemote<CameraAlgorithmCallbackOps> callbacks, InitializeCallback callback) = 0; |
| |
| |
| using RegisterBufferCallback = base::OnceCallback<void(int32_t)>; |
| |
| virtual void RegisterBuffer(::mojo::ScopedHandle buffer_fd, RegisterBufferCallback callback) = 0; |
| |
| |
| virtual void Request(uint32_t req_id, const std::vector<uint8_t>& req_header, int32_t buffer_handle) = 0; |
| |
| |
| virtual void DeregisterBuffers(const std::vector<int32_t>& buffer_handles) = 0; |
| |
| |
| virtual void UpdateReturn(uint32_t upd_id, uint32_t status, ::mojo::ScopedHandle buffer_fd) = 0; |
| |
| |
| virtual void Deinitialize() = 0; |
| }; |
| |
| class CameraAlgorithmCallbackOpsProxy; |
| |
| template <typename ImplRefTraits> |
| class CameraAlgorithmCallbackOpsStub; |
| |
| class CameraAlgorithmCallbackOpsRequestValidator; |
| |
| |
| class CameraAlgorithmCallbackOps |
| : public CameraAlgorithmCallbackOpsInterfaceBase { |
| public: |
| using IPCStableHashFunction = uint32_t(*)(); |
| |
| static const char Name_[]; |
| static IPCStableHashFunction MessageToMethodInfo_(mojo::Message& message); |
| static const char* MessageToMethodName_(mojo::Message& message); |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasUninterruptableMethods_ = false; |
| |
| using Base_ = CameraAlgorithmCallbackOpsInterfaceBase; |
| using Proxy_ = CameraAlgorithmCallbackOpsProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = CameraAlgorithmCallbackOpsStub<ImplRefTraits>; |
| |
| using RequestValidator_ = CameraAlgorithmCallbackOpsRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kReturnMinVersion = 0, |
| kUpdateMinVersion = 0, |
| }; |
| |
| // crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK |
| // with not having this data in traces there. |
| #if !BUILDFLAG(IS_FUCHSIA) |
| struct Return_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| struct Update_Sym { |
| NOINLINE static uint32_t IPCStableHash(); |
| }; |
| #endif // !BUILDFLAG(IS_FUCHSIA) |
| virtual ~CameraAlgorithmCallbackOps() = default; |
| |
| |
| virtual void Return(uint32_t req_id, uint32_t status, int32_t buffer_handle) = 0; |
| |
| |
| virtual void Update(uint32_t upd_id, const std::vector<uint8_t>& upd_header, ::mojo::ScopedHandle buffer_fd) = 0; |
| }; |
| |
| |
| |
| class CameraAlgorithmOpsProxy |
| : public CameraAlgorithmOps { |
| public: |
| using InterfaceType = CameraAlgorithmOps; |
| |
| explicit CameraAlgorithmOpsProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| void Initialize(::mojo::PendingRemote<CameraAlgorithmCallbackOps> callbacks, InitializeCallback callback) final; |
| |
| void RegisterBuffer(::mojo::ScopedHandle buffer_fd, RegisterBufferCallback callback) final; |
| |
| void Request(uint32_t req_id, const std::vector<uint8_t>& req_header, int32_t buffer_handle) final; |
| |
| void DeregisterBuffers(const std::vector<int32_t>& buffer_handles) final; |
| |
| void UpdateReturn(uint32_t upd_id, uint32_t status, ::mojo::ScopedHandle buffer_fd) final; |
| |
| void Deinitialize() final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| |
| |
| |
| class CameraAlgorithmCallbackOpsProxy |
| : public CameraAlgorithmCallbackOps { |
| public: |
| using InterfaceType = CameraAlgorithmCallbackOps; |
| |
| explicit CameraAlgorithmCallbackOpsProxy(mojo::MessageReceiverWithResponder* receiver); |
| |
| void Return(uint32_t req_id, uint32_t status, int32_t buffer_handle) final; |
| |
| void Update(uint32_t upd_id, const std::vector<uint8_t>& upd_header, ::mojo::ScopedHandle buffer_fd) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class CameraAlgorithmOpsStubDispatch { |
| public: |
| static bool Accept(CameraAlgorithmOps* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| CameraAlgorithmOps* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<CameraAlgorithmOps>> |
| class CameraAlgorithmOpsStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| CameraAlgorithmOpsStub() = default; |
| ~CameraAlgorithmOpsStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return CameraAlgorithmOpsStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return CameraAlgorithmOpsStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class CameraAlgorithmCallbackOpsStubDispatch { |
| public: |
| static bool Accept(CameraAlgorithmCallbackOps* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| CameraAlgorithmCallbackOps* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<CameraAlgorithmCallbackOps>> |
| class CameraAlgorithmCallbackOpsStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| CameraAlgorithmCallbackOpsStub() = default; |
| ~CameraAlgorithmCallbackOpsStub() override = default; |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return CameraAlgorithmCallbackOpsStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return CameraAlgorithmCallbackOpsStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class CameraAlgorithmOpsRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class CameraAlgorithmCallbackOpsRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class CameraAlgorithmOpsResponseValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| } // cros::mojom |
| |
| namespace mojo { |
| |
| } // namespace mojo |
| |
| #endif // CAMERA_MOJO_ALGORITHM_CAMERA_ALGORITHM_MOJOM_H_ |