From 947f42fc40a93e6d2b9e1246834b78bdd7279aca Mon Sep 17 00:00:00 2001 From: Pradip De Date: Wed, 13 Nov 2024 20:38:07 +0000 Subject: [PATCH] Restyle --- .../camera-av-stream-management-server.cpp | 37 +++++++++++-------- .../camera-av-stream-management-server.h | 8 ++-- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp index fc11d1b38948cf..61292d2e270288 100644 --- a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp +++ b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.cpp @@ -42,8 +42,8 @@ namespace CameraAVStreamMgmt { CameraAVStreamMgmtServer::CameraAVStreamMgmtServer(CameraAVStreamMgmtDelegate & aDelegate, EndpointId aEndpointId, ClusterId aClusterId, BitMask aFeature, - OptionalAttributes aOptionalAttrs, - uint8_t aMaxConcurrentVideoEncoders, uint32_t aMaxEncodedPixelRate, + OptionalAttributes aOptionalAttrs, uint8_t aMaxConcurrentVideoEncoders, + uint32_t aMaxEncodedPixelRate, const VideoSensorParamsStruct & aVideoSensorParams, bool aNightVisionCapable, const VideoResolutionStruct & aMinViewPort, uint32_t aMaxContentBufferSize, const AudioCapabilitiesStruct & aMicrophoneCapabilities, @@ -51,9 +51,10 @@ CameraAVStreamMgmtServer::CameraAVStreamMgmtServer(CameraAVStreamMgmtDelegate & TwoWayTalkSupportTypeEnum aTwoWayTalkSupport, uint32_t aMaxNetworkBandwidth) : CommandHandlerInterface(MakeOptional(aEndpointId), aClusterId), AttributeAccessInterface(MakeOptional(aEndpointId), aClusterId), mDelegate(aDelegate), mEndpointId(aEndpointId), - mClusterId(aClusterId), mFeature(aFeature), mOptionalAttrs(aOptionalAttrs), mMaxConcurrentVideoEncoders(aMaxConcurrentVideoEncoders), - mMaxEncodedPixelRate(aMaxEncodedPixelRate), mVideoSensorParams(aVideoSensorParams), mNightVisionCapable(aNightVisionCapable), - mMinViewPort(aMinViewPort), mMaxContentBufferSize(aMaxContentBufferSize), mMicrophoneCapabilities(aMicrophoneCapabilities), + mClusterId(aClusterId), mFeature(aFeature), mOptionalAttrs(aOptionalAttrs), + mMaxConcurrentVideoEncoders(aMaxConcurrentVideoEncoders), mMaxEncodedPixelRate(aMaxEncodedPixelRate), + mVideoSensorParams(aVideoSensorParams), mNightVisionCapable(aNightVisionCapable), mMinViewPort(aMinViewPort), + mMaxContentBufferSize(aMaxContentBufferSize), mMicrophoneCapabilities(aMicrophoneCapabilities), mSpeakerCapabilities(aSpeakerCapabilities), mTwoWayTalkSupport(aTwoWayTalkSupport), mMaxNetworkBandwidth(aMaxNetworkBandwidth) { mDelegate.SetCameraAVStreamMgmtServer(this); @@ -389,21 +390,24 @@ CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPat VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not get FabricsUsingCamera, feature is not supported")); ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeFabricsUsingCamera(encoder); })); + [this](const auto & encoder) -> CHIP_ERROR { + return this->ReadAndEncodeFabricsUsingCamera(encoder); })); break; case AllocatedVideoStreams::Id: VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedVideoStreams, feature is not supported")); ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedVideoStreams(encoder); })); + [this](const auto & encoder) -> CHIP_ERROR { + return this->ReadAndEncodeAllocatedVideoStreams(encoder); })); break; case AllocatedAudioStreams::Id: VerifyOrReturnError(HasFeature(Feature::kAudio), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedAudioStreams, feature is not supported")); ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedAudioStreams(encoder); })); + [this](const auto & encoder) -> CHIP_ERROR { + return this->ReadAndEncodeAllocatedAudioStreams(encoder); })); break; case AllocatedSnapshotStreams::Id: VerifyOrReturnError( @@ -411,7 +415,8 @@ CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPat ChipLogError(Zcl, "CameraAVStreamMgmt: can not get AllocatedSnapshotStreams, feature is not supported")); ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeAllocatedSnapshotStreams(encoder); })); + [this](const auto & encoder) -> CHIP_ERROR { + return this->ReadAndEncodeAllocatedSnapshotStreams(encoder); })); break; case RankedVideoStreamPrioritiesList::Id: VerifyOrReturnError( @@ -419,7 +424,8 @@ CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPat ChipLogError(Zcl, "CameraAVStreamMgmt: can not get RankedVideoStreamPrioritiesList, feature is not supported")); ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeRankedVideoStreamPrioritiesList(encoder); })); + [this](const auto & encoder) -> CHIP_ERROR { + return this->ReadAndEncodeRankedVideoStreamPrioritiesList(encoder); })); break; case SoftRecordingPrivacyModeEnabled::Id: VerifyOrReturnError( @@ -563,7 +569,7 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa ReturnErrorOnFailure(SetHDRModeEnabled(hdrModeEnabled)); return CHIP_NO_ERROR; } - case RankedVideoStreamPrioritiesList::Id: {// TODO + case RankedVideoStreamPrioritiesList::Id: { // TODO VerifyOrReturnError( HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not set RankedVideoStreamPrioritiesList, feature is not supported")); @@ -594,7 +600,8 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa } case NightVision::Id: { VerifyOrReturnError((HasFeature(Feature::kVideo) || HasFeature(Feature::kSnapshot)) && - SupportsOptAttr(OptionalAttributes::kSupportsNightVision), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + SupportsOptAttr(OptionalAttributes::kSupportsNightVision), + CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not set NightVision, feature is not supported")); TriStateAutoEnum nightVision; @@ -604,7 +611,8 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa } case NightVisionIllum::Id: { VerifyOrReturnError((HasFeature(Feature::kVideo) || HasFeature(Feature::kSnapshot)) && - SupportsOptAttr(OptionalAttributes::kSupportsNightVisionIllum), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + SupportsOptAttr(OptionalAttributes::kSupportsNightVisionIllum), + CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not set NightVisionIllumination, feature is not supported")); TriStateAutoEnum nightVisionIllum; @@ -616,7 +624,7 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa VerifyOrReturnError( HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not set RankedVideoStreamPrioritiesList, feature is not supported")); - ViewportStruct viewPort; + ViewportStruct viewPort; ReturnErrorOnFailure(aDecoder.Decode(viewPort)); ReturnErrorOnFailure(SetViewport(viewPort)); return CHIP_NO_ERROR; @@ -1203,7 +1211,6 @@ void CameraAVStreamMgmtServer::InvokeCommand(HandlerContext & handlerContext) [this](HandlerContext & ctx, const auto & commandData) { HandleCaptureSnapshot(ctx, commandData); }); } return; - } } diff --git a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h index 0b0afc45914ccb..e55de76d68b990 100644 --- a/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h +++ b/src/app/clusters/camera-av-stream-management-server/camera-av-stream-management-server.h @@ -179,8 +179,9 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut * @param aFeature The bitmask value that identifies which features are supported by this instance. */ CameraAVStreamMgmtServer(CameraAVStreamMgmtDelegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, - BitMask aFeature, OptionalAttributes aOptionalAttrs, uint8_t aMaxConVideoEncoders, - uint32_t aMaxEncodedPixelRate, VideoSensorParamsStruct aVideoSensorParams, bool aNightVisionCapable, + BitMask aFeature, OptionalAttributes aOptionalAttrs, + uint8_t aMaxConVideoEncoders, uint32_t aMaxEncodedPixelRate, + VideoSensorParamsStruct aVideoSensorParams, bool aNightVisionCapable, VideoResolutionStruct minViewPort, uint32_t aMaxContentBufferSize, AudioCapabilitiesStruct aMicCapabilities, AudioCapabilitiesStruct aSpkrCapabilities, TwoWayTalkSupportTypeEnum aTwoWayTalkSupport, uint32_t aMaxNetworkBandwidth); @@ -270,7 +271,7 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut const uint32_t mMaxNetworkBandwidth; uint16_t mCurrentFrameRate; - bool mHDRModeEnabled = false; + bool mHDRModeEnabled = false; bool mSoftRecordingPrivacyModeEnabled = false; bool mSoftLivestreamPrivacyModeEnabled = false; bool mHardPrivacyModeOn = false; @@ -348,7 +349,6 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut void HandleSnapshotStreamDeallocate(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); void HandleCaptureSnapshot(HandlerContext & ctx, const Commands::VideoStreamModify::DecodableType & req); - }; } // namespace CameraAVStreamMgmt