| // camera/mojo/camera_diagnostics.mojom-shared.cc 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. |
| |
| #include "camera/mojo/camera_diagnostics.mojom-shared.h" |
| |
| // Used to support stream output operator for enums. |
| // TODO(dcheng): Consider omitting this somehow if not needed. |
| #include <ostream> |
| #include <utility> |
| |
| #include "base/strings/stringprintf.h" |
| #include "mojo/public/cpp/bindings/lib/validate_params.h" |
| #include "mojo/public/cpp/bindings/lib/validation_errors.h" |
| #include "mojo/public/cpp/bindings/lib/validation_util.h" |
| #include "third_party/perfetto/include/perfetto/tracing/traced_value.h" |
| |
| #include "camera/mojo/camera_diagnostics.mojom-params-data.h" |
| namespace cros { |
| namespace camera_diag { |
| namespace mojom { |
| |
| NOINLINE static const char* AnalyzerStatusToStringHelper(AnalyzerStatus value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case AnalyzerStatus::kNotRun: |
| return "kNotRun"; |
| case AnalyzerStatus::kPassed: |
| return "kPassed"; |
| case AnalyzerStatus::kFailed: |
| return "kFailed"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string AnalyzerStatusToString(AnalyzerStatus value) { |
| const char *str = AnalyzerStatusToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown AnalyzerStatus value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, AnalyzerStatus value) { |
| return os << AnalyzerStatusToString(value); |
| } |
| |
| NOINLINE static const char* AnalyzerTypeToStringHelper(AnalyzerType value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case AnalyzerType::kUnknown: |
| return "kUnknown"; |
| case AnalyzerType::kPrivacyShutterSwTest: |
| return "kPrivacyShutterSwTest"; |
| case AnalyzerType::kDirtyLens: |
| return "kDirtyLens"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string AnalyzerTypeToString(AnalyzerType value) { |
| const char *str = AnalyzerTypeToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown AnalyzerType value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, AnalyzerType value) { |
| return os << AnalyzerTypeToString(value); |
| } |
| |
| NOINLINE static const char* CameraIssueToStringHelper(CameraIssue value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case CameraIssue::kNone: |
| return "kNone"; |
| case CameraIssue::kManufacturerIssue: |
| return "kManufacturerIssue"; |
| case CameraIssue::kPrivacyShutterOn: |
| return "kPrivacyShutterOn"; |
| case CameraIssue::kDirtyLens: |
| return "kDirtyLens"; |
| case CameraIssue::kCameraServiceDown: |
| return "kCameraServiceDown"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string CameraIssueToString(CameraIssue value) { |
| const char *str = CameraIssueToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown CameraIssue value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, CameraIssue value) { |
| return os << CameraIssueToString(value); |
| } |
| |
| NOINLINE static const char* ClientTypeToStringHelper(ClientType value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case ClientType::kUnknown: |
| return "kUnknown"; |
| case ClientType::kHealthd: |
| return "kHealthd"; |
| case ClientType::kCca: |
| return "kCca"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string ClientTypeToString(ClientType value) { |
| const char *str = ClientTypeToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown ClientType value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, ClientType value) { |
| return os << ClientTypeToString(value); |
| } |
| |
| NOINLINE static const char* DataSourceToStringHelper(DataSource value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case DataSource::kChrome: |
| return "kChrome"; |
| case DataSource::kCameraService: |
| return "kCameraService"; |
| case DataSource::kClientApp: |
| return "kClientApp"; |
| case DataSource::kCameraDiagnostics: |
| return "kCameraDiagnostics"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string DataSourceToString(DataSource value) { |
| const char *str = DataSourceToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown DataSource value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, DataSource value) { |
| return os << DataSourceToString(value); |
| } |
| |
| NOINLINE static const char* ErrorCodeToStringHelper(ErrorCode value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case ErrorCode::kUnknown: |
| return "kUnknown"; |
| case ErrorCode::kCameraClosed: |
| return "kCameraClosed"; |
| case ErrorCode::kMultipleOpenCameras: |
| return "kMultipleOpenCameras"; |
| case ErrorCode::kAlreadyRunningAnalysis: |
| return "kAlreadyRunningAnalysis"; |
| case ErrorCode::kNotEnoughFrames: |
| return "kNotEnoughFrames"; |
| case ErrorCode::kInvalidDuration: |
| return "kInvalidDuration"; |
| case ErrorCode::kCrosCameraControllerNotRegistered: |
| return "kCrosCameraControllerNotRegistered"; |
| case ErrorCode::kDiagnosticsInternal: |
| return "kDiagnosticsInternal"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string ErrorCodeToString(ErrorCode value) { |
| const char *str = ErrorCodeToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown ErrorCode value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, ErrorCode value) { |
| return os << ErrorCodeToString(value); |
| } |
| |
| NOINLINE static const char* PixelFormatToStringHelper(PixelFormat value) { |
| // Defined in a helper function to ensure that Clang generates a lookup table. |
| switch(value) { |
| case PixelFormat::kYuv420: |
| return "kYuv420"; |
| case PixelFormat::kJpeg: |
| return "kJpeg"; |
| default: |
| return nullptr; |
| } |
| } |
| |
| std::string PixelFormatToString(PixelFormat value) { |
| const char *str = PixelFormatToStringHelper(value); |
| if (!str) { |
| return base::StringPrintf("Unknown PixelFormat value: %i", static_cast<int32_t>(value)); |
| } |
| return str; |
| } |
| |
| std::ostream& operator<<(std::ostream& os, PixelFormat value) { |
| return os << PixelFormatToString(value); |
| } |
| |
| namespace internal { |
| // static |
| bool FrameAnalysisResult_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context, |
| bool inlined) { |
| if (!data) { |
| DCHECK(!inlined); |
| return true; |
| } |
| |
| // If it is inlined, the alignment is already enforced by its enclosing |
| // object. We don't have to validate that. |
| DCHECK(!inlined || mojo::internal::IsAligned(data)); |
| |
| if (!inlined && |
| !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory( |
| data, validation_context)) { |
| return false; |
| } |
| |
| const FrameAnalysisResult_Data* object = static_cast<const FrameAnalysisResult_Data*>(data); |
| |
| if (inlined && object->is_null()) |
| return true; |
| |
| switch (object->tag) { |
| |
| case FrameAnalysisResult_Tag::kError: { |
| |
| |
| if (!::cros::camera_diag::mojom::internal::ErrorCode_Data |
| ::Validate(object->data.f_error, validation_context)) |
| return false; |
| return true; |
| } |
| case FrameAnalysisResult_Tag::kRes: { |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->data.f_res, 2, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->data.f_res, validation_context)) |
| return false; |
| return true; |
| } |
| default: { |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG, |
| "unknown tag in FrameAnalysisResult"); |
| return false; |
| } |
| } |
| } |
| // static |
| bool StartStreamingResult_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context, |
| bool inlined) { |
| if (!data) { |
| DCHECK(!inlined); |
| return true; |
| } |
| |
| // If it is inlined, the alignment is already enforced by its enclosing |
| // object. We don't have to validate that. |
| DCHECK(!inlined || mojo::internal::IsAligned(data)); |
| |
| if (!inlined && |
| !mojo::internal::ValidateNonInlinedUnionHeaderAndClaimMemory( |
| data, validation_context)) { |
| return false; |
| } |
| |
| const StartStreamingResult_Data* object = static_cast<const StartStreamingResult_Data*>(data); |
| |
| if (inlined && object->is_null()) |
| return true; |
| |
| switch (object->tag) { |
| |
| case StartStreamingResult_Tag::kError: { |
| |
| |
| if (!::cros::camera_diag::mojom::internal::ErrorCode_Data |
| ::Validate(object->data.f_error, validation_context)) |
| return false; |
| return true; |
| } |
| case StartStreamingResult_Tag::kStream: { |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->data.f_stream, 2, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->data.f_stream, validation_context)) |
| return false; |
| return true; |
| } |
| default: { |
| |
| ReportValidationError( |
| validation_context, |
| mojo::internal::VALIDATION_ERROR_UNKNOWN_UNION_TAG, |
| "unknown tag in StartStreamingResult"); |
| return false; |
| } |
| } |
| } |
| |
| |
| // static |
| bool AnalyzerResult_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const AnalyzerResult_Data* object = |
| static_cast<const AnalyzerResult_Data*>(data); |
| |
| |
| if (!::cros::camera_diag::mojom::internal::AnalyzerType_Data |
| ::Validate(object->type, validation_context)) |
| return false; |
| |
| |
| if (!::cros::camera_diag::mojom::internal::AnalyzerStatus_Data |
| ::Validate(object->status, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| AnalyzerResult_Data::AnalyzerResult_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool DiagnosticsResult_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 24, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const DiagnosticsResult_Data* object = |
| static_cast<const DiagnosticsResult_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->analyzer_results, 2, validation_context)) { |
| return false; |
| } |
| constexpr const mojo::internal::ContainerValidateParams& analyzer_results_validate_params = |
| mojo::internal::GetArrayValidator<0, false, nullptr>(); |
| if (!mojo::internal::ValidateContainer(object->analyzer_results, validation_context, |
| &analyzer_results_validate_params)) { |
| return false; |
| } |
| |
| |
| if (!::cros::camera_diag::mojom::internal::CameraIssue_Data |
| ::Validate(object->suggested_issue, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| DiagnosticsResult_Data::DiagnosticsResult_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool FrameAnalysisConfig_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const FrameAnalysisConfig_Data* object = |
| static_cast<const FrameAnalysisConfig_Data*>(data); |
| |
| |
| if (!::cros::camera_diag::mojom::internal::ClientType_Data |
| ::Validate(object->client_type, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| FrameAnalysisConfig_Data::FrameAnalysisConfig_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CameraFrameBuffer_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CameraFrameBuffer_Data* object = |
| static_cast<const CameraFrameBuffer_Data*>(data); |
| |
| if (!mojo::internal::ValidateHandleOrInterfaceNonNullable( |
| object->shm_handle, 2, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateHandleOrInterface(object->shm_handle, |
| validation_context)) { |
| return false; |
| } |
| |
| return true; |
| } |
| |
| CameraFrameBuffer_Data::CameraFrameBuffer_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CameraStream_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 24, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CameraStream_Data* object = |
| static_cast<const CameraStream_Data*>(data); |
| |
| |
| if (!::cros::camera_diag::mojom::internal::PixelFormat_Data |
| ::Validate(object->pixel_format, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CameraStream_Data::CameraStream_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CameraFrame_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 40, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CameraFrame_Data* object = |
| static_cast<const CameraFrame_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->stream, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->stream, validation_context)) |
| return false; |
| |
| |
| if (!::cros::camera_diag::mojom::internal::DataSource_Data |
| ::Validate(object->source, validation_context)) |
| return false; |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->buffer, 5, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->buffer, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CameraFrame_Data::CameraFrame_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool StreamingConfig_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const StreamingConfig_Data* object = |
| static_cast<const StreamingConfig_Data*>(data); |
| |
| return true; |
| } |
| |
| StreamingConfig_Data::StreamingConfig_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CameraDiagnostics_RunFrameAnalysis_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CameraDiagnostics_RunFrameAnalysis_Params_Data* object = |
| static_cast<const CameraDiagnostics_RunFrameAnalysis_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->config, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->config, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CameraDiagnostics_RunFrameAnalysis_Params_Data::CameraDiagnostics_RunFrameAnalysis_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CameraDiagnostics_RunFrameAnalysis_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 24, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CameraDiagnostics_RunFrameAnalysis_ResponseParams_Data* object = |
| static_cast<const CameraDiagnostics_RunFrameAnalysis_ResponseParams_Data*>(data); |
| |
| if (!mojo::internal::ValidateInlinedUnionNonNullable( |
| object->res, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateInlinedUnion(object->res, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CameraDiagnostics_RunFrameAnalysis_ResponseParams_Data::CameraDiagnostics_RunFrameAnalysis_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CrosCameraDiagnosticsService_SendFrame_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CrosCameraDiagnosticsService_SendFrame_Params_Data* object = |
| static_cast<const CrosCameraDiagnosticsService_SendFrame_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->frame, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->frame, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CrosCameraDiagnosticsService_SendFrame_Params_Data::CrosCameraDiagnosticsService_SendFrame_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CrosCameraController_StartStreaming_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CrosCameraController_StartStreaming_Params_Data* object = |
| static_cast<const CrosCameraController_StartStreaming_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->config, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->config, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CrosCameraController_StartStreaming_Params_Data::CrosCameraController_StartStreaming_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CrosCameraController_StartStreaming_ResponseParams_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 24, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CrosCameraController_StartStreaming_ResponseParams_Data* object = |
| static_cast<const CrosCameraController_StartStreaming_ResponseParams_Data*>(data); |
| |
| if (!mojo::internal::ValidateInlinedUnionNonNullable( |
| object->res, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateInlinedUnion(object->res, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CrosCameraController_StartStreaming_ResponseParams_Data::CrosCameraController_StartStreaming_ResponseParams_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CrosCameraController_StopStreaming_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 8, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CrosCameraController_StopStreaming_Params_Data* object = |
| static_cast<const CrosCameraController_StopStreaming_Params_Data*>(data); |
| |
| return true; |
| } |
| |
| CrosCameraController_StopStreaming_Params_Data::CrosCameraController_StopStreaming_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| |
| // static |
| bool CrosCameraController_RequestFrame_Params_Data::Validate( |
| const void* data, |
| mojo::internal::ValidationContext* validation_context) { |
| if (!data) |
| return true; |
| if (!ValidateUnversionedStructHeaderAndSizeAndClaimMemory( |
| data, 16, validation_context)) { |
| return false; |
| } |
| |
| // NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if |
| // the message comes from an older version. |
| [[maybe_unused]] const CrosCameraController_RequestFrame_Params_Data* object = |
| static_cast<const CrosCameraController_RequestFrame_Params_Data*>(data); |
| |
| if (!mojo::internal::ValidatePointerNonNullable( |
| object->frame, 1, validation_context)) { |
| return false; |
| } |
| if (!mojo::internal::ValidateStruct(object->frame, validation_context)) |
| return false; |
| |
| return true; |
| } |
| |
| CrosCameraController_RequestFrame_Params_Data::CrosCameraController_RequestFrame_Params_Data() |
| : header_({sizeof(*this), 0}) {} |
| |
| } // namespace internal |
| } // namespace mojom |
| } // namespace camera_diag |
| } // namespace cros |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::AnalyzerStatus>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::AnalyzerStatus value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::AnalyzerStatusToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::AnalyzerType>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::AnalyzerType value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::AnalyzerTypeToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::CameraIssue>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::CameraIssue value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::CameraIssueToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::ClientType>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::ClientType value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::ClientTypeToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::DataSource>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::DataSource value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::DataSourceToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::ErrorCode>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::ErrorCode value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::ErrorCodeToString(value)); |
| } |
| |
| } // namespace perfetto |
| |
| namespace perfetto { |
| |
| // static |
| void TraceFormatTraits<::cros::camera_diag::mojom::PixelFormat>::WriteIntoTrace( |
| perfetto::TracedValue context, ::cros::camera_diag::mojom::PixelFormat value) { |
| return std::move(context).WriteString(::cros::camera_diag::mojom::PixelFormatToString(value)); |
| } |
| |
| } // namespace perfetto |