| // camera/mojo/gpu/mjpeg_decode_accelerator.mojom-shared.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 CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_H_ |
| #define CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_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/enum_traits.h" |
| #include "mojo/public/cpp/bindings/interface_data_view.h" |
| #include "mojo/public/cpp/bindings/lib/bindings_internal.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/map_data_view.h" |
| #include "mojo/public/cpp/bindings/string_data_view.h" |
| |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h" |
| |
| #include "camera/mojo/gpu/mjpeg_decode_accelerator.mojom-shared-internal.h" |
| #include "camera/mojo/gpu/dmabuf.mojom-shared.h" |
| #include "mojo/public/cpp/bindings/lib/interface_serialization.h" |
| #include "mojo/public/cpp/system/data_pipe.h" |
| |
| |
| |
| |
| |
| |
| namespace cros::mojom { |
| |
| |
| } // cros::mojom |
| |
| namespace mojo { |
| namespace internal { |
| |
| } // namespace internal |
| } // namespace mojo |
| |
| |
| namespace cros::mojom { |
| |
| |
| enum class DecodeError : int32_t { |
| |
| NO_ERRORS = 0, |
| |
| INVALID_ARGUMENT = 1, |
| |
| UNREADABLE_INPUT = 2, |
| |
| PARSE_JPEG_FAILED = 3, |
| |
| UNSUPPORTED_JPEG = 4, |
| |
| PLATFORM_FAILURE = 5, |
| kMinValue = 0, |
| kMaxValue = 5, |
| }; |
| |
| std::ostream& operator<<(std::ostream& os, DecodeError value); |
| inline bool IsKnownEnumValue(DecodeError value) { |
| return internal::DecodeError_Data::IsKnownValue( |
| static_cast<int32_t>(value)); |
| } |
| // Interface base classes. They are used for type safety check. |
| class MjpegDecodeAcceleratorInterfaceBase {}; |
| |
| using MjpegDecodeAcceleratorPtrDataView = |
| mojo::InterfacePtrDataView<MjpegDecodeAcceleratorInterfaceBase>; |
| using MjpegDecodeAcceleratorRequestDataView = |
| mojo::InterfaceRequestDataView<MjpegDecodeAcceleratorInterfaceBase>; |
| using MjpegDecodeAcceleratorAssociatedPtrInfoDataView = |
| mojo::AssociatedInterfacePtrInfoDataView<MjpegDecodeAcceleratorInterfaceBase>; |
| using MjpegDecodeAcceleratorAssociatedRequestDataView = |
| mojo::AssociatedInterfaceRequestDataView<MjpegDecodeAcceleratorInterfaceBase>; |
| |
| |
| } // cros::mojom |
| |
| namespace std { |
| |
| template <> |
| struct hash<::cros::mojom::DecodeError> |
| : public mojo::internal::EnumHashImpl<::cros::mojom::DecodeError> {}; |
| |
| } // namespace std |
| |
| namespace mojo { |
| |
| |
| namespace internal { |
| |
| template <typename MaybeConstUserType> |
| struct Serializer<::cros::mojom::DecodeError, MaybeConstUserType> { |
| using UserType = typename std::remove_const<MaybeConstUserType>::type; |
| using Traits = EnumTraits<::cros::mojom::DecodeError, UserType>; |
| |
| static void Serialize(UserType input, int32_t* output) { |
| *output = static_cast<int32_t>(Traits::ToMojom(input)); |
| } |
| |
| static bool Deserialize(int32_t input, UserType* output) { |
| return Traits::FromMojom(::mojo::internal::ToKnownEnumValueHelper( |
| static_cast<::cros::mojom::DecodeError>(input)), output); |
| } |
| }; |
| |
| } // namespace internal |
| |
| } // namespace mojo |
| |
| |
| namespace cros::mojom { |
| |
| |
| } // cros::mojom |
| |
| // Declare TraceFormatTraits for enums, which should be defined in ::perfetto |
| // namespace. |
| |
| namespace perfetto { |
| |
| template <> |
| struct TraceFormatTraits<::cros::mojom::DecodeError> { |
| static void WriteIntoTrace(perfetto::TracedValue context, ::cros::mojom::DecodeError value); |
| }; |
| |
| } // namespace perfetto |
| |
| #endif // CAMERA_MOJO_GPU_MJPEG_DECODE_ACCELERATOR_MOJOM_SHARED_H_ |