Clean up old ToDos in the code the stream IDs are already set appropriately. (#41373)
* Clean up old ToDos in the code the stream IDs are already set appropriately.
* Address gemini comments
diff --git a/examples/camera-app/linux/src/clusters/webrtc-provider/webrtc-provider-manager.cpp b/examples/camera-app/linux/src/clusters/webrtc-provider/webrtc-provider-manager.cpp
index e82072f..e060af8 100644
--- a/examples/camera-app/linux/src/clusters/webrtc-provider/webrtc-provider-manager.cpp
+++ b/examples/camera-app/linux/src/clusters/webrtc-provider/webrtc-provider-manager.cpp
@@ -81,15 +81,13 @@
// Resolve or allocate a VIDEO stream
if (args.videoStreamId.HasValue())
{
- if (args.videoStreamId.Value().IsNull())
+ // Stream has been validated and potentially selected by ValidateStreamUsage()
+ // in the cluster server before invoking this delegate method
+ const auto & videoStreamIdNullable = args.videoStreamId.Value();
+ outSession.videoStreamID = videoStreamIdNullable;
+ if (!videoStreamIdNullable.IsNull())
{
- // TODO: Automatically select the closest matching video stream for the StreamUsage requested by looking at the and the
- // server MAY allocate a new video stream if there are available resources.
- }
- else
- {
- outSession.videoStreamID = args.videoStreamId.Value();
- videoStreamID = args.videoStreamId.Value().Value();
+ videoStreamID = videoStreamIdNullable.Value();
}
}
else
@@ -100,15 +98,13 @@
// Resolve or allocate an AUDIO stream
if (args.audioStreamId.HasValue())
{
- if (args.audioStreamId.Value().IsNull())
+ // Stream has been validated and potentially selected by ValidateStreamUsage()
+ // in the cluster server before invoking this delegate method
+ const auto & audioStreamIdNullable = args.audioStreamId.Value();
+ outSession.audioStreamID = audioStreamIdNullable;
+ if (!audioStreamIdNullable.IsNull())
{
- // TODO: Automatically select the closest matching audio stream for the StreamUsage requested and the server MAY
- // allocate a new audio stream if there are available resources.
- }
- else
- {
- outSession.audioStreamID = args.audioStreamId.Value();
- audioStreamID = args.audioStreamId.Value().Value();
+ audioStreamID = audioStreamIdNullable.Value();
}
}
else
@@ -250,14 +246,13 @@
// Resolve or allocate a VIDEO stream
if (args.videoStreamId.HasValue())
{
- if (args.videoStreamId.Value().IsNull())
+ // Stream has been validated and potentially selected by ValidateStreamUsage()
+ // in the cluster server before invoking this delegate method
+ const auto & videoStreamIdNullable = args.videoStreamId.Value();
+ outSession.videoStreamID = videoStreamIdNullable;
+ if (!videoStreamIdNullable.IsNull())
{
- // TODO: Automatically select the closest matching video stream for the StreamUsage requested.
- }
- else
- {
- outSession.videoStreamID = args.videoStreamId.Value();
- videoStreamID = args.videoStreamId.Value().Value();
+ videoStreamID = videoStreamIdNullable.Value();
}
}
else
@@ -268,14 +263,13 @@
// Resolve or allocate an AUDIO stream
if (args.audioStreamId.HasValue())
{
- if (args.audioStreamId.Value().IsNull())
+ // Stream has been validated and potentially selected by ValidateStreamUsage()
+ // in the cluster server before invoking this delegate method
+ const auto & audioStreamIdNullable = args.audioStreamId.Value();
+ outSession.audioStreamID = audioStreamIdNullable;
+ if (!audioStreamIdNullable.IsNull())
{
- // TODO: Automatically select the closest matching audio stream for the StreamUsage requested
- }
- else
- {
- outSession.audioStreamID = args.audioStreamId.Value();
- audioStreamID = args.audioStreamId.Value().Value();
+ audioStreamID = audioStreamIdNullable.Value();
}
}
else