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 4b06344b9099b5..fc11d1b38948cf 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 @@ -154,36 +154,6 @@ CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeSupportedSnapshotParams(const return err; } -CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeCurrentVideoCodecs(const AttributeValueEncoder::ListEncodeHelper & encoder) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // Tell the delegate the read is starting.. - ReturnErrorOnFailure(mDelegate.StartCurrentVideoCodecsRead()); - - for (uint8_t i = 0; true; i++) - { - VideoCodecEnum videoCodec; - - err = mDelegate.GetCurrentVideoCodecByIndex(i, videoCodec); - SuccessOrExit(err); - - err = encoder.Encode(videoCodec); - SuccessOrExit(err); - } - -exit: - if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) - { - // Convert end of list to CHIP_NO_ERROR - err = CHIP_NO_ERROR; - } - - // Tell the delegate the read is complete - err = mDelegate.EndCurrentVideoCodecsRead(); - return err; -} - CHIP_ERROR CameraAVStreamMgmtServer::ReadAndEncodeFabricsUsingCamera(const AttributeValueEncoder::ListEncodeHelper & encoder) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -415,17 +385,6 @@ CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPat ChipLogError(Zcl, "CameraAVStreamMgmt: can not get HDRModeEnabled, feature is not supported"); ReturnErrorOnFailure(aEncoder.Encode(mHDRModeEnabled)); break; - case CurrentVideoCodecs::Id: - VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, - ChipLogError(Zcl, "CameraAVStreamMgmt: can not get CurrentVideoCodecs, feature is not supported")); - ReturnErrorOnFailure(aEncoder.EncodeList( - [this](const auto & encoder) -> CHIP_ERROR { return this->ReadAndEncodeCurrentVideoCodecs(encoder); })); - break; - case CurrentSnapshotConfig::Id: - VerifyOrReturnError(HasFeature(Feature::kSnapshot), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, - ChipLogError(Zcl, "CameraAVStreamMgmt: can not get CurrentSnapshotConfig, feature is not supported")); - ReturnErrorOnFailure(aEncoder.Encode(mCurrentSnapshotConfig)); - break; case FabricsUsingCamera::Id: VerifyOrReturnError(HasFeature(Feature::kVideo), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, ChipLogError(Zcl, "CameraAVStreamMgmt: can not get FabricsUsingCamera, feature is not supported")); @@ -770,34 +729,6 @@ Status CameraAVStreamMgmtServer::SetHDRModeEnabled(bool aHDRModeEnabled) return Protocols::InteractionModel::Status::Success; } -Status CameraAVStreamMgmtServer::SetCurrentSnapshotConfig(const VideoResolutionStruct & aVideoResolution, uint16_t aMaxFrameRate, - ImageCodecEnum aImageCodecEnum) -{ - bool snapshotConfigChanged = false; - if (mCurrentSnapshotConfig.Resolution != aVideoResolution) - { - mCurrentSnapshotConfig.Resolution = aVideoResolution; - snapshotConfigChanged = true; - } - if (mCurrentSnapshotConfig.MaxFrameRate != aMaxFrameRate) - { - mCurrentSnapshotConfig.MaxFrameRate = aMaxFrameRate; - snapshotConfigChanged = true; - } - if (mCurrentSnapshotConfig.ImageCodec != aImageCodecEnum) - { - mCurrentSnapshotConfig.ImageCodec = aImageCodecEnum; - snapshotConfigChanged = true; - } - if (snapshotConfigChanged) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::CurrentSnapshotConfig::Id); - MatterReportingAttributeChangeCallback(path); - } - - return Protocols::InteractionModel::Status::Success; -} - Status CameraAVStreamMgmtServer::SetSoftRecordingPrivacyModeEnabled(bool aSoftRecordingPrivacyModeEnabled) { if (mSoftRecordingPrivacyModeEnabled != aSoftRecordingPrivacyModeEnabled) @@ -1392,14 +1323,14 @@ void CameraAVStreamMgmtServer::HandleSnapshotStreamAllocate(HandlerContext & ctx Commands::SnapshotStreamAllocateResponse::Type response; auto & imageCodec = commandData.imageCodec; - auto & frameRate = commandData.frameRate; + auto & maxFrameRate = commandData.maxFrameRate; auto & bitRate = commandData.bitRate; auto & minResolution = commandData.minResolution; auto & maxResolution = commandData.maxResolution; auto & quality = commandData.quality; // Call the delegate - Status status = mDelegate.SnapshotStreamAllocate(imageCodec, frameRate, bitRate, minResolution, maxResolution, quality); + Status status = mDelegate.SnapshotStreamAllocate(imageCodec, maxFrameRate, bitRate, minResolution, maxResolution, quality); if (status != Status::Success) { 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 3811aff9fa8953..0b0afc45914ccb 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 @@ -128,10 +128,6 @@ class CameraAVStreamMgmtDelegate virtual CHIP_ERROR GetSupportedSnapshotParamByIndex(uint8_t, Structs::RateDistortionTradeOffPointsStruct::Type &) = 0; virtual CHIP_ERROR EndSupportedSnapshotParamsRead() = 0; - virtual CHIP_ERROR StartCurrentVideoCodecsRead() = 0; - virtual CHIP_ERROR GetCurrentVideoCodecByIndex(uint8_t, VideoCodecEnumType) = 0; - virtual CHIP_ERROR EndCurrentVideoCodecsRead() = 0; - virtual CHIP_ERROR StartFabricsUsingCameraRead() = 0; virtual CHIP_ERROR GetFabricUsingCameraByIndex(uint8_t, chip::FabricIndex) = 0; virtual CHIP_ERROR EndFabricsUsingCameraRead() = 0; @@ -210,10 +206,6 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut Protocols::InteractionModel::Status SetHDRModeEnabled(bool aHDRModeEnabled); - Protocols::InteractionModel::Status - CameraAVStreamMgmtServer::SetCurrentSnapshotConfig(const VideoResolutionStruct & aVideoResolution, uint16_t aMaxFrameRate, - ImageCodecEnumType aImageCodecEnum); - Protocols::InteractionModel::Status SetSoftRecordingPrivacyModeEnabled(bool aSoftRecordingPrivacyModeEnabled); Protocols::InteractionModel::Status SetSoftLivestreamPrivacyModeEnabled(bool aSoftLivestreamPrivacyModeEnabled); @@ -279,7 +271,6 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut uint16_t mCurrentFrameRate; bool mHDRModeEnabled = false; - SnapshotParamsStruct mCurrentSnapshotConfig; bool mSoftRecordingPrivacyModeEnabled = false; bool mSoftLivestreamPrivacyModeEnabled = false; bool mHardPrivacyModeOn = false; @@ -329,7 +320,6 @@ class CameraAVStreamMgmtServer : public CommandHandlerInterface, public Attribut // Helpers to read list items via delegate APIs CHIP_ERROR ReadAndEncodeRateDistortionTradeOffPoints(const AttributeValueEncoder::ListEncodeHelper & encoder); CHIP_ERROR ReadAndEncodeSupportedSnapshotParams(const AttributeValueEncoder::ListEncodeHelper & encoder); - CHIP_ERROR ReadAndEncodeCurrentVideoCodecs(const AttributeValueEncoder::ListEncodeHelper & encoder); CHIP_ERROR ReadAndEncodeFabricsUsingCamera(const AttributeValueEncoder::ListEncodeHelper & encoder); CHIP_ERROR ReadAndEncodeAllocatedVideoStreams(const AttributeValueEncoder::ListEncodeHelper & encoder);