Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align XML definition for WebRTC Provider Cluster with spec #37648

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
#define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0)
Expand Down Expand Up @@ -274,7 +274,7 @@
#define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
#define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0)
Expand Down Expand Up @@ -274,7 +274,7 @@
#define MATTER_DM_ZONE_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CAMERA_AV_SETTINGS_USER_LEVEL_MANAGEMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEBRTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_CLIENT_ENDPOINT_COUNT (0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2024 Project CHIP Authors
Copyright (c) 2025 Project CHIP Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,12 +18,11 @@ limitations under the License.
XML generated by Alchemy; DO NOT EDIT.
Source: src/app_clusters/WebRTC_Provider.adoc
Parameters: in-progress
Git: 0.9-fall2024-234-gf4d359001
Git: 0.7-summer-2025-5-g06c4d5596
-->
<configurator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../zcl.xsd">
<domain name="General"/>

<bitmap name="WebRTCMetadataOptions" type="bitmap8">
<domain name="Cameras"/>
<bitmap name="WebRTCMetadataOptionsBitmap" type="bitmap8">
<cluster code="0x0553"/>
<cluster code="0x0554"/>
<field name="DataTLV" mask="0x01"/>
Expand Down Expand Up @@ -64,31 +63,33 @@ Git: 0.9-fall2024-234-gf4d359001
<item fieldId="4" name="StreamUsage" type="StreamUsageEnum" min="0x00" max="0x03"/>
<item fieldId="5" name="VideoStreamID" type="int16u" isNullable="true"/>
<item fieldId="6" name="AudioStreamID" type="int16u" isNullable="true"/>
<item fieldId="7" name="MetadataOptions" type="WebRTCMetadataOptions" default="0x00" min="0x00" max="0x01"/>
<item fieldId="7" name="MetadataOptions" type="WebRTCMetadataOptionsBitmap" default="0x00" min="0x00" max="0x01"/>
</struct>

<cluster apiMaturity="provisional">
<domain name="Cameras"/>
<domain>Cameras</domain>
<name>WebRTC Transport Provider</name>
<code>0x0553</code>
<define>WEBRTC_TRANSPORT_PROVIDER_CLUSTER</define>
<define>WEB_RTC_TRANSPORT_PROVIDER_CLUSTER</define>
<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"/>
<attribute code="0x0000" side="server" define="CURRENT_SESSIONS" type="array" entryType="WebRTCSessionStruct">CurrentSessions</attribute>
<command code="0x01" source="client" name="SolicitOffer" optional="false" response="SolicitOfferResponse">
<description>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.</description>
<quality largeMessage="true"/>
<arg id="1" name="StreamUsage" type="StreamUsageEnum" min="0x00" max="0x03"/>
<arg id="2" name="VideoStreamID" type="int16u" optional="true" isNullable="true"/>
<arg id="3" name="AudioStreamID" type="int16u" optional="true" isNullable="true"/>
<arg id="4" name="ICEServers" array="true" type="ICEServerStruct" optional="true"/>
<arg id="5" name="ICETransportPolicy" type="char_string" optional="true"/>
<arg id="6" name="MetadataOptions" type="WebRTCMetadataOptions" optional="true" min="0x00" max="0x01"/>
<arg id="6" name="MetadataOptions" type="WebRTCMetadataOptionsBitmap" optional="true" min="0x00" max="0x01"/>
</command>

<command code="0x02" source="server" name="SolicitOfferResponse" optional="false" disableDefaultResponse="true">
<description>This command SHALL be generated in response to a SolicitOffer command.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="DeferredOffer" type="boolean"/>
<arg id="3" name="VideoStreamID" type="int16u" optional="true" isNullable="true"/>
Expand All @@ -97,37 +98,42 @@ Git: 0.9-fall2024-234-gf4d359001

<command code="0x03" source="client" name="ProvideOffer" optional="false" response="ProvideOfferResponse">
<description>This command allows an SDP Offer to be set and start a new session.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u" isNullable="true"/>
<arg id="2" name="SDP" type="char_string"/>
<arg id="3" name="StreamUsage" type="StreamUsageEnum" min="0x00" max="0x03"/>
<arg id="4" name="VideoStreamID" type="int16u" optional="true" isNullable="true"/>
<arg id="5" name="AudioStreamID" type="int16u" optional="true" isNullable="true"/>
<arg id="6" name="ICEServers" array="true" type="ICEServerStruct" optional="true"/>
<arg id="7" name="ICETransportPolicy" type="char_string" optional="true"/>
<arg id="8" name="MetadataOptions" type="WebRTCMetadataOptions" optional="true" min="0x00" max="0x01"/>
<arg id="8" name="MetadataOptions" type="WebRTCMetadataOptionsBitmap" optional="true" min="0x00" max="0x01"/>
</command>

<command code="0x04" source="server" name="ProvideOfferResponse" optional="false" disableDefaultResponse="true">
<description>This command contains information about the stream created as a response to the requestor&apos;s offer.</description>
<description>This command contains information about the session and streams created as a response to the requestor&apos;s offer.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="VideoStreamID" type="int16u"/>
<arg id="3" name="AudioStreamID" type="int16u"/>
<arg id="2" name="VideoStreamID" type="int16u" optional="true" isNullable="true"/>
<arg id="3" name="AudioStreamID" type="int16u" optional="true" isNullable="true"/>
</command>

<command code="0x05" source="client" name="ProvideAnswer" optional="false">
<description>This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="SDP" type="char_string"/>
</command>

<command code="0x06" source="client" name="ProvideICECandidate" optional="false">
<description>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.</description>
<command code="0x06" source="client" name="ProvideICECandidates" optional="false">
<description>This command allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="ICECandidate" type="char_string"/>
<arg id="2" name="ICECandidates" array="true" type="char_string" minLength="1"/>
</command>

<command code="0x07" source="client" name="EndSession" optional="false">
<description>This command instructs the stream provider to end the WebRTC session.</description>
<quality largeMessage="true"/>
<arg id="1" name="WebRTCSessionID" type="int16u"/>
<arg id="2" name="Reason" type="WebRTCEndReasonEnum" default="0x0B" min="0x00" max="0x0B"/>
</command>
Expand Down
24 changes: 12 additions & 12 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -10104,7 +10104,7 @@ provisional cluster WebRTCTransportProvider = 1363 {
kUnknownReason = 11;
}

bitmap WebRTCMetadataOptions : bitmap8 {
bitmap WebRTCMetadataOptionsBitmap : bitmap8 {
kDataTLV = 0x1;
}

Expand All @@ -10122,7 +10122,7 @@ provisional cluster WebRTCTransportProvider = 1363 {
StreamUsageEnum streamUsage = 4;
nullable int16u videoStreamID = 5;
nullable int16u audioStreamID = 6;
WebRTCMetadataOptions metadataOptions = 7;
WebRTCMetadataOptionsBitmap metadataOptions = 7;
}

readonly attribute WebRTCSessionStruct currentSessions[] = 0;
Expand All @@ -10139,7 +10139,7 @@ provisional cluster WebRTCTransportProvider = 1363 {
optional nullable int16u audioStreamID = 2;
optional ICEServerStruct ICEServers[] = 3;
optional char_string ICETransportPolicy = 4;
optional WebRTCMetadataOptions metadataOptions = 5;
optional WebRTCMetadataOptionsBitmap metadataOptions = 5;
}

response struct SolicitOfferResponse = 2 {
Expand All @@ -10157,23 +10157,23 @@ provisional cluster WebRTCTransportProvider = 1363 {
optional nullable int16u audioStreamID = 4;
optional ICEServerStruct ICEServers[] = 5;
optional char_string ICETransportPolicy = 6;
optional WebRTCMetadataOptions metadataOptions = 7;
optional WebRTCMetadataOptionsBitmap metadataOptions = 7;
}

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

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

request struct ProvideICECandidateRequest {
request struct ProvideICECandidatesRequest {
int16u webRTCSessionID = 0;
char_string ICECandidate = 1;
char_string ICECandidates[] = 1;
}

request struct EndSessionRequest {
Expand All @@ -10187,8 +10187,8 @@ provisional cluster WebRTCTransportProvider = 1363 {
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 allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase. */
command ProvideICECandidates(ProvideICECandidatesRequest): DefaultSuccess = 6;
/** This command instructs the stream provider to end the WebRTC session. */
command EndSession(EndSessionRequest): DefaultSuccess = 7;
}
Expand Down Expand Up @@ -10219,7 +10219,7 @@ provisional cluster WebRTCTransportRequestor = 1364 {
kUnknownReason = 11;
}

bitmap WebRTCMetadataOptions : bitmap8 {
bitmap WebRTCMetadataOptionsBitmap : bitmap8 {
kDataTLV = 0x1;
}

Expand All @@ -10237,7 +10237,7 @@ provisional cluster WebRTCTransportRequestor = 1364 {
StreamUsageEnum streamUsage = 4;
nullable int16u videoStreamID = 5;
nullable int16u audioStreamID = 6;
WebRTCMetadataOptions metadataOptions = 7;
WebRTCMetadataOptionsBitmap metadataOptions = 7;
}

readonly attribute WebRTCSessionStruct currentSessions[] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62931,9 +62931,9 @@ public void onResponse(StructType invokeStructValue) {
final long webRTCSessionIDFieldID = 0L;
Integer webRTCSessionID = null;
final long videoStreamIDFieldID = 1L;
Integer videoStreamID = null;
@Nullable Optional<Integer> videoStreamID = null;
final long audioStreamIDFieldID = 2L;
Integer audioStreamID = null;
@Nullable Optional<Integer> audioStreamID = null;
for (StructElement element: invokeStructValue.value()) {
if (element.contextTagNum() == webRTCSessionIDFieldID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
Expand All @@ -62943,12 +62943,12 @@ public void onResponse(StructType invokeStructValue) {
} else if (element.contextTagNum() == videoStreamIDFieldID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
videoStreamID = castingValue.value(Integer.class);
videoStreamID = Optional.of(castingValue.value(Integer.class));
}
} else if (element.contextTagNum() == audioStreamIDFieldID) {
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
audioStreamID = castingValue.value(Integer.class);
audioStreamID = Optional.of(castingValue.value(Integer.class));
}
}
}
Expand Down Expand Up @@ -62980,21 +62980,21 @@ public void onResponse(StructType invokeStructValue) {
}}, commandId, commandArgs, timedInvokeTimeoutMs);
}

public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) {
provideICECandidate(callback, webRTCSessionID, ICECandidate, 0);
public void provideICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList<String> ICECandidates) {
provideICECandidates(callback, webRTCSessionID, ICECandidates, 0);
}

public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) {
public void provideICECandidates(DefaultClusterCallback callback, Integer webRTCSessionID, ArrayList<String> ICECandidates, int timedInvokeTimeoutMs) {
final long commandId = 6L;

ArrayList<StructElement> elements = new ArrayList<>();
final long webRTCSessionIDFieldID = 0L;
BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID);
elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue));

final long ICECandidateFieldID = 1L;
BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate);
elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue));
final long ICECandidatesFieldID = 1L;
BaseTLVType ICECandidatestlvValue = ArrayType.generateArrayType(ICECandidates, (elementICECandidates) -> new StringType(elementICECandidates));
elements.add(new StructElement(ICECandidatesFieldID, ICECandidatestlvValue));

StructType commandArgs = new StructType(elements);
invoke(new InvokeCallbackImpl(callback) {
Expand Down Expand Up @@ -63033,7 +63033,7 @@ public interface SolicitOfferResponseCallback extends BaseClusterCallback {
}

public interface ProvideOfferResponseCallback extends BaseClusterCallback {
void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID);
void onSuccess(Integer webRTCSessionID, @Nullable Optional<Integer> videoStreamID, @Nullable Optional<Integer> audioStreamID);
}

public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17825,7 +17825,7 @@ public enum Command {
SolicitOffer(1L),
ProvideOffer(3L),
ProvideAnswer(5L),
ProvideICECandidate(6L),
ProvideICECandidates(6L),
EndSession(7L),;
private final long id;
Command(long id) {
Expand Down Expand Up @@ -17895,17 +17895,17 @@ public static ProvideAnswerCommandField value(int id) throws NoSuchFieldError {
}
throw new NoSuchFieldError();
}
}public enum ProvideICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),;
}public enum ProvideICECandidatesCommandField {WebRTCSessionID(0),ICECandidates(1),;
private final int id;
ProvideICECandidateCommandField(int id) {
ProvideICECandidatesCommandField(int id) {
this.id = id;
}

public int getID() {
return id;
}
public static ProvideICECandidateCommandField value(int id) throws NoSuchFieldError {
for (ProvideICECandidateCommandField field : ProvideICECandidateCommandField.values()) {
public static ProvideICECandidatesCommandField value(int id) throws NoSuchFieldError {
for (ProvideICECandidatesCommandField field : ProvideICECandidatesCommandField.values()) {
if (field.getID() == id) {
return field;
}
Expand Down
Loading
Loading