@@ -509,17 +509,20 @@ CHIP_ERROR CameraAVStreamMgmtServer::Read(const ConcreteReadAttributePath & aPat
509
509
ReturnErrorOnFailure (aEncoder.Encode (mMicrophoneAGCEnabled ));
510
510
break ;
511
511
case ImageRotation::Id:
512
- VerifyOrReturnError (HasFeature (Feature::kImageControl ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
512
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageRotation ),
513
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
513
514
ChipLogError (Zcl, " CameraAVStreamMgmt: can not get ImageRotation, feature is not supported" ));
514
515
ReturnErrorOnFailure (aEncoder.Encode (mImageRotation ));
515
516
break ;
516
517
case ImageFlipHorizontal::Id:
517
- VerifyOrReturnError (HasFeature (Feature::kImageControl ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
518
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageFlipHorizontal ),
519
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
518
520
ChipLogError (Zcl, " CameraAVStreamMgmt: can not get ImageFlipHorizontal, feature is not supported" ));
519
521
ReturnErrorOnFailure (aEncoder.Encode (mImageFlipHorizontal ));
520
522
break ;
521
523
case ImageFlipVertical::Id:
522
- VerifyOrReturnError (HasFeature (Feature::kImageControl ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
524
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageFlipVertical ),
525
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
523
526
ChipLogError (Zcl, " CameraAVStreamMgmt: can not get ImageFlipHorizontal, feature is not supported" ));
524
527
ReturnErrorOnFailure (aEncoder.Encode (mImageFlipVertical ));
525
528
break ;
@@ -569,15 +572,6 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa
569
572
ReturnErrorOnFailure (SetHDRModeEnabled (hdrModeEnabled));
570
573
return CHIP_NO_ERROR;
571
574
}
572
- case RankedVideoStreamPrioritiesList::Id: { // TODO
573
- VerifyOrReturnError (
574
- HasFeature (Feature::kVideo ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
575
- ChipLogError (Zcl, " CameraAVStreamMgmt: can not set RankedVideoStreamPrioritiesList, feature is not supported" ));
576
- uint8_t newValue;
577
- ReturnErrorOnFailure (aDecoder.Decode (newValue));
578
- ReturnErrorOnFailure (mDelegate .SetRankedVideoStreamPrioritiesList (newValue));
579
- return CHIP_NO_ERROR;
580
- }
581
575
case SoftRecordingPrivacyModeEnabled::Id: {
582
576
VerifyOrReturnError (
583
577
HasFeature (Feature::kPrivacy ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
@@ -621,9 +615,8 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa
621
615
return CHIP_NO_ERROR;
622
616
}
623
617
case Viewport::Id: {
624
- VerifyOrReturnError (
625
- HasFeature (Feature::kVideo ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
626
- ChipLogError (Zcl, " CameraAVStreamMgmt: can not set RankedVideoStreamPrioritiesList, feature is not supported" ));
618
+ VerifyOrReturnError (HasFeature (Feature::kVideo ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
619
+ ChipLogError (Zcl, " CameraAVStreamMgmt: can not set Viewport, feature is not supported" ));
627
620
ViewportStruct viewPort;
628
621
ReturnErrorOnFailure (aDecoder.Decode (viewPort));
629
622
ReturnErrorOnFailure (SetViewport (viewPort));
@@ -670,6 +663,33 @@ CHIP_ERROR CameraAVStreamMgmtServer::Write(const ConcreteDataAttributePath & aPa
670
663
ReturnErrorOnFailure (SetMicrophoneAGCEnabled (micAGCEnabled));
671
664
return CHIP_NO_ERROR;
672
665
}
666
+ case ImageRotation::Id: {
667
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageRotation ),
668
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
669
+ ChipLogError (Zcl, " CameraAVStreamMgmt: can not set ImageRotation, feature is not supported" ));
670
+ uint16_t imageRotation;
671
+ ReturnErrorOnFailure (aDecoder.Decode (imageRotation));
672
+ ReturnErrorOnFailure (SetImageRotation (imageRotation));
673
+ return CHIP_NO_ERROR;
674
+ }
675
+ case ImageFlipHorizontal::Id: {
676
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageFlipHorizontal ),
677
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
678
+ ChipLogError (Zcl, " CameraAVStreamMgmt: can not set ImageFlipHorizontal, feature is not supported" ));
679
+ bool imageFlipHorizontal;
680
+ ReturnErrorOnFailure (aDecoder.Decode (imageFlipHorizontal));
681
+ ReturnErrorOnFailure (SetImageFlipHorizontal (imageFlipHorizontal));
682
+ return CHIP_NO_ERROR;
683
+ }
684
+ case ImageFlipVertical::Id: {
685
+ VerifyOrReturnError (HasFeature (Feature::kImageControl ) && SupportsOptAttr (OptionalAttributes::kSupportsImageFlipVertical ),
686
+ CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
687
+ ChipLogError (Zcl, " CameraAVStreamMgmt: can not set ImageFlipVertical, feature is not supported" ));
688
+ bool imageFlipVertical;
689
+ ReturnErrorOnFailure (aDecoder.Decode (imageFlipVertical));
690
+ ReturnErrorOnFailure (SetImageFlipVertical (imageFlipVertical));
691
+ return CHIP_NO_ERROR;
692
+ }
673
693
case LocalVideoRecordingEnabled::Id: {
674
694
VerifyOrReturnError (
675
695
HasFeature (Feature::kVideo ) && HasFeature (Feature::kStorage ), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE,
0 commit comments