Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/camera-webrtc-provider' into cam…
Browse files Browse the repository at this point in the history
…era-webrtc-provider

# Conflicts:
#	src/app/zap-templates/zcl/data-model/chip/web-rtc-provider-cluster.xml
  • Loading branch information
gmarcosb committed Oct 2, 2024
2 parents 87af5e1 + 68c8dde commit cabfe70
Show file tree
Hide file tree
Showing 52 changed files with 8,977 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Generally regenerate using one of:
| 1294 | 0x50E | AccountLogin |
| 1295 | 0x50F | ContentControl |
| 1296 | 0x510 | ContentAppObserver |
| 1363 | 0x553 | WebRTCTransportProvider |
| 1366 | 0x556 | Chime |
| 1872 | 0x750 | EcosystemInformation |
| 1873 | 0x751 | CommissionerControl |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ Git: 0.9-fall2024-231-gf50161121
<item fieldId="7" name="MetadataOptions" type="WebRTCMetadataOptions" default="0x00" min="0x00" max="0x01"/>
</struct>

<cluster>
<cluster apiMaturity="provisional">
<domain name="General"/>
<name>WebRTC Transport Provider</name>
<code>0x0553</code>
<define>WEB_RTC_TRANSPORT_PROVIDER_CLUSTER</define>
<description>The following process SHALL be followed when the server receives this command:</description>
<description>The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC.</description>
<client init="false" tick="false">true</client>
<server init="false" tick="false">true</server>
<globalAttribute code="0xFFFD" side="either" value="1"/>
Expand Down Expand Up @@ -138,7 +138,7 @@ Git: 0.9-fall2024-231-gf50161121
<command code="0x07" source="client" name="EndSession" optional="false">
<description>This command instructs the stream provider to end the WebRTC session.</description>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="Reason" type="WebRTCEndReasonEnum" default="0x0B" min="0x00" max="0x0B"/>
<arg id="2" name="Reason" type="WebRTCEndReasonEnum" min="0x00" max="0x0B" default="0x0B"/>
</command>

</cluster>
Expand Down
115 changes: 115 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9415,6 +9415,121 @@ provisional cluster ContentAppObserver = 1296 {
command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0;
}

/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
provisional cluster WebRTCTransportProvider = 1363 {
revision 1;

enum StreamTypeEnum : enum8 {
kInternal = 0;
kRecording = 1;
kAnalysis = 2;
kLiveView = 3;
}

enum WebRTCEndReasonEnum : enum8 {
kIceFailed = 0;
kIceTimeout = 1;
kUserHangup = 2;
kUserBusy = 3;
kReplaced = 4;
kNoUserMedia = 5;
kInviteTimeout = 6;
kAnsweredElsewhere = 7;
kOutOfResources = 8;
kMediaTimeout = 9;
kLowPower = 10;
kUnknownReason = 11;
}

bitmap WebRTCMetadataOptions : bitmap8 {
kDataTLV = 0x1;
}

struct ICEServerStruct {
char_string urls[] = 1;
optional char_string username = 2;
optional char_string credential = 3;
optional int16u caid = 4;
}

struct WebRTCSessionStruct {
int16u id = 1;
node_id peerNodeID = 2;
fabric_idx peerFabricIndex = 3;
StreamTypeEnum streamType = 4;
nullable int16u videoStreamID = 5;
nullable int16u audioStreamID = 6;
WebRTCMetadataOptions metadataOptions = 7;
}

readonly attribute WebRTCSessionStruct currentSessions[] = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct SolicitOfferRequest {
StreamTypeEnum streamType = 0;
optional nullable int16u videoStreamID = 1;
optional nullable int16u audioStreamID = 2;
optional ICEServerStruct ICEServers[] = 3;
optional char_string ICETransportPolicy = 4;
optional WebRTCMetadataOptions metadataOptions = 5;
}

response struct SolicitOfferResponse = 2 {
int16u webRTCSessionID = 0;
boolean deferredOffer = 1;
optional nullable int16u videoStreamID = 2;
optional nullable int16u audioStreamID = 3;
}

request struct ProvideOfferRequest {
nullable int16u webRTCSessionID = 0;
char_string sdp = 1;
StreamTypeEnum streamType = 2;
optional nullable int16u videoStreamID = 3;
optional nullable int16u audioStreamID = 4;
optional ICEServerStruct ICEServers[] = 5;
optional char_string ICETransportPolicy = 6;
optional WebRTCMetadataOptions metadataOptions = 7;
}

response struct ProvideOfferResponse = 4 {
int16u webRTCSessionID = 0;
int16u videoStreamID = 1;
int16u audioStreamID = 2;
}

request struct ProvideAnswerRequest {
int16u webRTCSessionID = 0;
char_string sdp = 1;
}

request struct ProvideICECandidateRequest {
int16u webRTCSessionID = 0;
char_string ICECandidate = 1;
}

request struct EndSessionRequest {
int16u webRTCSessionID = 0;
WebRTCEndReasonEnum reason = 1;
}

/** Requests that the Provider initiates a new session with the Offer / Answer flow in a way that allows for options to be passed and work with devices needing the standby flow. */
command SolicitOffer(SolicitOfferRequest): SolicitOfferResponse = 1;
/** This command allows an SDP Offer to be set and start a new session. */
command ProvideOffer(ProvideOfferRequest): ProvideOfferResponse = 3;
/** This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. */
command ProvideAnswer(ProvideAnswerRequest): DefaultSuccess = 5;
/** This command allows for https://www.rfc-editor.org/rfc/rfc8839#section-4.2.1.2 nominated after the initial Offer / Answer exchange to be added to a session during the gathering phase. */
command ProvideICECandidate(ProvideICECandidateRequest): DefaultSuccess = 6;
/** This command instructs the stream provider to end the WebRTC session. */
command EndSession(EndSessionRequest): DefaultSuccess = 7;
}

/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
provisional cluster Chime = 1366 {
revision 1;
Expand Down
Loading

0 comments on commit cabfe70

Please sign in to comment.