Skip to content

Commit f38ccfa

Browse files
committed
Add CameraAVStreamMgmt cluster to EP1 of camera-app.zap.
1 parent ef6ec1b commit f38ccfa

File tree

2 files changed

+952
-16
lines changed

2 files changed

+952
-16
lines changed

examples/camera-app/camera-common/camera-app.matter

+355
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,315 @@ cluster UserLabel = 65 {
21192119
readonly attribute int16u clusterRevision = 65533;
21202120
}
21212121

2122+
/** The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. */
2123+
provisional cluster CameraAvStreamManagement = 1361 {
2124+
revision 1;
2125+
2126+
enum AudioCodecEnum : enum8 {
2127+
kOPUS = 0;
2128+
kAACLC = 1;
2129+
}
2130+
2131+
enum ImageCodecEnum : enum8 {
2132+
kJPEG = 0;
2133+
}
2134+
2135+
enum StreamUsageEnum : enum8 {
2136+
kInternal = 0;
2137+
kRecording = 1;
2138+
kAnalysis = 2;
2139+
kLiveView = 3;
2140+
}
2141+
2142+
enum TriStateAutoEnum : enum8 {
2143+
kOff = 0;
2144+
kOn = 1;
2145+
kAuto = 2;
2146+
}
2147+
2148+
enum TwoWayTalkSupportTypeEnum : enum8 {
2149+
kNotSupported = 0;
2150+
kHalfDuplex = 1;
2151+
kFullDuplex = 2;
2152+
}
2153+
2154+
enum VideoCodecEnum : enum8 {
2155+
kH264 = 0;
2156+
kHEVC = 1;
2157+
kVVC = 2;
2158+
kAV1 = 3;
2159+
}
2160+
2161+
bitmap Feature : bitmap32 {
2162+
kAudio = 0x1;
2163+
kVideo = 0x2;
2164+
kSnapshot = 0x4;
2165+
kPrivacy = 0x8;
2166+
kSpeaker = 0x10;
2167+
kImageControl = 0x20;
2168+
kWatermark = 0x40;
2169+
kOnScreenDisplay = 0x80;
2170+
kLocalStorage = 0x100;
2171+
}
2172+
2173+
struct VideoResolutionStruct {
2174+
int16u width = 0;
2175+
int16u height = 1;
2176+
}
2177+
2178+
struct VideoStreamStruct {
2179+
int16u videoStreamID = 0;
2180+
StreamUsageEnum streamUsage = 1;
2181+
VideoCodecEnum videoCodec = 2;
2182+
int16u minFrameRate = 3;
2183+
int16u maxFrameRate = 4;
2184+
VideoResolutionStruct minResolution = 5;
2185+
VideoResolutionStruct maxResolution = 6;
2186+
int32u minBitRate = 7;
2187+
int32u maxBitRate = 8;
2188+
int16u minFragmentLen = 9;
2189+
int16u maxFragmentLen = 10;
2190+
optional boolean watermarkEnabled = 11;
2191+
optional boolean OSDEnabled = 12;
2192+
int8u referenceCount = 13;
2193+
}
2194+
2195+
struct SnapshotStreamStruct {
2196+
int16u snapshotStreamID = 0;
2197+
ImageCodecEnum imageCodec = 1;
2198+
int16u frameRate = 2;
2199+
int32u bitRate = 3;
2200+
VideoResolutionStruct minResolution = 4;
2201+
VideoResolutionStruct maxResolution = 5;
2202+
int8u quality = 6;
2203+
int8u referenceCount = 7;
2204+
}
2205+
2206+
struct SnapshotParamsStruct {
2207+
VideoResolutionStruct resolution = 0;
2208+
int16u maxFrameRate = 1;
2209+
ImageCodecEnum imageCodec = 2;
2210+
}
2211+
2212+
struct RateDistortionTradeOffPointsStruct {
2213+
VideoCodecEnum codec = 0;
2214+
VideoResolutionStruct resolution = 1;
2215+
int32u minBitRate = 2;
2216+
}
2217+
2218+
struct AudioCapabilitiesStruct {
2219+
int8u maxNumberOfChannels = 0;
2220+
AudioCodecEnum supportedCodecs[] = 1;
2221+
int32u supportedSampleRates[] = 2;
2222+
int8u supportedBitDepths[] = 3;
2223+
}
2224+
2225+
struct AudioStreamStruct {
2226+
int16u audioStreamID = 0;
2227+
StreamUsageEnum streamUsage = 1;
2228+
AudioCodecEnum audioCodec = 2;
2229+
int8u channelCount = 3;
2230+
int32u sampleRate = 4;
2231+
int32u bitRate = 5;
2232+
int8u bitDepth = 6;
2233+
int8u referenceCount = 7;
2234+
}
2235+
2236+
struct VideoSensorParamsStruct {
2237+
int16u sensorWidth = 0;
2238+
int16u sensorHeight = 1;
2239+
boolean HDRCapable = 2;
2240+
int16u maxFPS = 3;
2241+
int16u maxHDRFPS = 4;
2242+
}
2243+
2244+
struct ViewportStruct {
2245+
int16u x1 = 0;
2246+
int16u y1 = 1;
2247+
int16u x2 = 2;
2248+
int16u y2 = 3;
2249+
}
2250+
2251+
info event VideoStreamChanged = 0 {
2252+
int16u videoStreamID = 0;
2253+
optional StreamUsageEnum streamUsage = 1;
2254+
optional VideoCodecEnum videoCodec = 2;
2255+
optional int16u minFrameRate = 3;
2256+
optional int16u maxFrameRate = 4;
2257+
optional VideoResolutionStruct minResolution = 5;
2258+
optional VideoResolutionStruct maxResolution = 6;
2259+
optional int32u minBitRate = 7;
2260+
optional int32u maxBitRate = 8;
2261+
optional int16u minFragmentLen = 9;
2262+
optional int16u maxFragmentLen = 10;
2263+
}
2264+
2265+
info event AudioStreamChanged = 1 {
2266+
int16u audioStreamID = 0;
2267+
optional StreamUsageEnum streamUsage = 1;
2268+
optional AudioCodecEnum audioCodec = 2;
2269+
optional int8u channelCount = 3;
2270+
optional int32u sampleRate = 4;
2271+
optional int32u bitRate = 5;
2272+
optional int8u bitDepth = 6;
2273+
}
2274+
2275+
info event SnapshotStreamChanged = 2 {
2276+
int16u snapshotStreamID = 0;
2277+
optional ImageCodecEnum imageCodec = 1;
2278+
optional int16u frameRate = 2;
2279+
optional int32u bitRate = 3;
2280+
optional VideoResolutionStruct minResolution = 4;
2281+
optional VideoResolutionStruct maxResolution = 5;
2282+
optional int8u quality = 6;
2283+
}
2284+
2285+
readonly attribute optional int8u maxConcurrentVideoEncoders = 0;
2286+
readonly attribute optional int32u maxEncodedPixelRate = 1;
2287+
readonly attribute optional VideoSensorParamsStruct videoSensorParams = 2;
2288+
readonly attribute optional boolean nightVisionCapable = 3;
2289+
readonly attribute optional VideoResolutionStruct minViewport = 4;
2290+
readonly attribute optional RateDistortionTradeOffPointsStruct rateDistortionTradeOffPoints[] = 5;
2291+
readonly attribute optional int32u maxContentBufferSize = 6;
2292+
readonly attribute optional AudioCapabilitiesStruct microphoneCapabilities = 7;
2293+
readonly attribute optional AudioCapabilitiesStruct speakerCapabilities = 8;
2294+
readonly attribute optional TwoWayTalkSupportTypeEnum twoWayTalkSupport = 9;
2295+
readonly attribute optional SnapshotParamsStruct supportedSnapshotParams[] = 10;
2296+
readonly attribute int32u maxNetworkBandwidth = 11;
2297+
readonly attribute optional int16u currentFrameRate = 12;
2298+
attribute access(read: manage, write: manage) optional boolean HDRModeEnabled = 13;
2299+
readonly attribute fabric_idx fabricsUsingCamera[] = 14;
2300+
readonly attribute optional VideoStreamStruct allocatedVideoStreams[] = 15;
2301+
readonly attribute optional AudioStreamStruct allocatedAudioStreams[] = 16;
2302+
readonly attribute optional SnapshotStreamStruct allocatedSnapshotStreams[] = 17;
2303+
readonly attribute optional StreamUsageEnum rankedVideoStreamPrioritiesList[] = 18;
2304+
attribute optional boolean softRecordingPrivacyModeEnabled = 19;
2305+
attribute optional boolean softLivestreamPrivacyModeEnabled = 20;
2306+
readonly attribute optional boolean hardPrivacyModeOn = 21;
2307+
attribute access(read: manage, write: manage) optional TriStateAutoEnum nightVision = 22;
2308+
attribute access(read: manage, write: manage) optional TriStateAutoEnum nightVisionIllum = 23;
2309+
attribute access(read: manage, write: manage) optional ViewportStruct viewport = 24;
2310+
attribute access(read: manage, write: manage) optional boolean speakerMuted = 25;
2311+
attribute access(read: manage, write: manage) optional int8u speakerVolumeLevel = 26;
2312+
readonly attribute access(read: manage) optional int8u speakerMaxLevel = 27;
2313+
readonly attribute access(read: manage) optional int8u speakerMinLevel = 28;
2314+
attribute access(read: manage, write: manage) optional boolean microphoneMuted = 29;
2315+
attribute access(read: manage, write: manage) optional int8u microphoneVolumeLevel = 30;
2316+
readonly attribute access(read: manage) optional int8u microphoneMaxLevel = 31;
2317+
readonly attribute access(read: manage) optional int8u microphoneMinLevel = 32;
2318+
attribute access(read: manage, write: manage) optional boolean microphoneAGCEnabled = 33;
2319+
attribute access(read: manage, write: manage) optional int16u imageRotation = 34;
2320+
attribute access(read: manage, write: manage) optional boolean imageFlipHorizontal = 35;
2321+
attribute access(read: manage, write: manage) optional boolean imageFlipVertical = 36;
2322+
attribute access(read: manage, write: manage) optional boolean localVideoRecordingEnabled = 37;
2323+
attribute access(read: manage, write: manage) optional boolean localSnapshotRecordingEnabled = 38;
2324+
attribute access(read: manage, write: manage) optional boolean statusLightEnabled = 39;
2325+
attribute access(read: manage, write: manage) optional ThreeLevelAutoEnum statusLightBrightness = 40;
2326+
readonly attribute command_id generatedCommandList[] = 65528;
2327+
readonly attribute command_id acceptedCommandList[] = 65529;
2328+
readonly attribute event_id eventList[] = 65530;
2329+
readonly attribute attrib_id attributeList[] = 65531;
2330+
readonly attribute bitmap32 featureMap = 65532;
2331+
readonly attribute int16u clusterRevision = 65533;
2332+
2333+
request struct AudioStreamAllocateRequest {
2334+
StreamUsageEnum streamUsage = 0;
2335+
AudioCodecEnum audioCodec = 1;
2336+
int8u channelCount = 2;
2337+
int32u sampleRate = 3;
2338+
int32u bitRate = 4;
2339+
int8u bitDepth = 5;
2340+
}
2341+
2342+
response struct AudioStreamAllocateResponse = 1 {
2343+
int16u audioStreamID = 0;
2344+
}
2345+
2346+
request struct AudioStreamDeallocateRequest {
2347+
int16u audioStreamID = 0;
2348+
}
2349+
2350+
request struct VideoStreamAllocateRequest {
2351+
StreamUsageEnum streamUsage = 0;
2352+
VideoCodecEnum videoCodec = 1;
2353+
int16u minFrameRate = 2;
2354+
int16u maxFrameRate = 3;
2355+
VideoResolutionStruct minResolution = 4;
2356+
VideoResolutionStruct maxResolution = 5;
2357+
int32u minBitRate = 6;
2358+
int32u maxBitRate = 7;
2359+
int16u minFragmentLen = 8;
2360+
int16u maxFragmentLen = 9;
2361+
optional boolean watermarkEnabled = 10;
2362+
optional boolean OSDEnabled = 11;
2363+
}
2364+
2365+
response struct VideoStreamAllocateResponse = 4 {
2366+
int16u videoStreamID = 0;
2367+
}
2368+
2369+
request struct VideoStreamModifyRequest {
2370+
int16u videoStreamID = 0;
2371+
optional boolean watermarkEnabled = 1;
2372+
optional boolean OSDEnabled = 2;
2373+
}
2374+
2375+
request struct VideoStreamDeallocateRequest {
2376+
int16u videoStreamID = 0;
2377+
}
2378+
2379+
request struct SnapshotStreamAllocateRequest {
2380+
ImageCodecEnum imageCodec = 0;
2381+
int16u maxFrameRate = 1;
2382+
int32u bitRate = 2;
2383+
VideoResolutionStruct minResolution = 3;
2384+
VideoResolutionStruct maxResolution = 4;
2385+
int8u quality = 5;
2386+
}
2387+
2388+
response struct SnapshotStreamAllocateResponse = 8 {
2389+
int16u snapshotStreamID = 0;
2390+
}
2391+
2392+
request struct SnapshotStreamDeallocateRequest {
2393+
int16u snapshotStreamID = 0;
2394+
}
2395+
2396+
request struct SetStreamPrioritiesRequest {
2397+
StreamUsageEnum streamPriorities[] = 0;
2398+
}
2399+
2400+
request struct CaptureSnapshotRequest {
2401+
int16u snapshotStreamID = 0;
2402+
VideoResolutionStruct requestedResolution = 1;
2403+
}
2404+
2405+
response struct CaptureSnapshotResponse = 12 {
2406+
octet_string data = 0;
2407+
ImageCodecEnum imageCodec = 1;
2408+
VideoResolutionStruct resolution = 2;
2409+
}
2410+
2411+
/** This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. */
2412+
command access(invoke: manage) AudioStreamAllocate(AudioStreamAllocateRequest): AudioStreamAllocateResponse = 0;
2413+
/** This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. */
2414+
command access(invoke: manage) AudioStreamDeallocate(AudioStreamDeallocateRequest): DefaultSuccess = 2;
2415+
/** This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. */
2416+
command access(invoke: manage) VideoStreamAllocate(VideoStreamAllocateRequest): VideoStreamAllocateResponse = 3;
2417+
/** This command SHALL be used to modify a stream specified by the VideoStreamID. */
2418+
command access(invoke: manage) VideoStreamModify(VideoStreamModifyRequest): DefaultSuccess = 5;
2419+
/** This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. */
2420+
command access(invoke: manage) VideoStreamDeallocate(VideoStreamDeallocateRequest): DefaultSuccess = 6;
2421+
/** This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. */
2422+
command access(invoke: manage) SnapshotStreamAllocate(SnapshotStreamAllocateRequest): SnapshotStreamAllocateResponse = 7;
2423+
/** This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. */
2424+
command access(invoke: manage) SnapshotStreamDeallocate(SnapshotStreamDeallocateRequest): DefaultSuccess = 9;
2425+
/** This command SHALL set the relative priorities of the various stream usages on the camera. */
2426+
command access(invoke: administer) SetStreamPriorities(SetStreamPrioritiesRequest): DefaultSuccess = 10;
2427+
/** This command SHALL return a Snapshot from the camera. */
2428+
command CaptureSnapshot(CaptureSnapshotRequest): CaptureSnapshotResponse = 11;
2429+
}
2430+
21222431
/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
21232432
provisional cluster Chime = 1366 {
21242433
revision 1;
@@ -2581,6 +2890,52 @@ endpoint 1 {
25812890
handle command SetDefaultNTP;
25822891
}
25832892

2893+
server cluster CameraAvStreamManagement {
2894+
callback attribute maxConcurrentVideoEncoders;
2895+
callback attribute maxEncodedPixelRate;
2896+
callback attribute videoSensorParams;
2897+
callback attribute nightVisionCapable;
2898+
callback attribute minViewport;
2899+
callback attribute rateDistortionTradeOffPoints;
2900+
callback attribute maxContentBufferSize;
2901+
callback attribute microphoneCapabilities;
2902+
callback attribute supportedSnapshotParams;
2903+
callback attribute maxNetworkBandwidth;
2904+
callback attribute currentFrameRate;
2905+
callback attribute HDRModeEnabled;
2906+
callback attribute fabricsUsingCamera;
2907+
callback attribute allocatedVideoStreams;
2908+
callback attribute allocatedAudioStreams;
2909+
callback attribute allocatedSnapshotStreams;
2910+
callback attribute rankedVideoStreamPrioritiesList;
2911+
callback attribute softLivestreamPrivacyModeEnabled;
2912+
callback attribute nightVision;
2913+
callback attribute viewport;
2914+
callback attribute microphoneMuted;
2915+
callback attribute microphoneVolumeLevel;
2916+
callback attribute microphoneMaxLevel;
2917+
callback attribute microphoneMinLevel;
2918+
callback attribute generatedCommandList;
2919+
callback attribute acceptedCommandList;
2920+
callback attribute attributeList;
2921+
callback attribute featureMap;
2922+
ram attribute clusterRevision default = 1;
2923+
2924+
handle command AudioStreamAllocate;
2925+
handle command AudioStreamAllocateResponse;
2926+
handle command AudioStreamDeallocate;
2927+
handle command VideoStreamAllocate;
2928+
handle command VideoStreamAllocateResponse;
2929+
handle command VideoStreamModify;
2930+
handle command VideoStreamDeallocate;
2931+
handle command SnapshotStreamAllocate;
2932+
handle command SnapshotStreamAllocateResponse;
2933+
handle command SnapshotStreamDeallocate;
2934+
handle command SetStreamPriorities;
2935+
handle command CaptureSnapshot;
2936+
handle command CaptureSnapshotResponse;
2937+
}
2938+
25842939
server cluster Chime {
25852940
callback attribute installedChimeSounds;
25862941
callback attribute activeChimeID;

0 commit comments

Comments
 (0)