-
Notifications
You must be signed in to change notification settings - Fork 111
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
[RSDK-8982, RSDK-9167, RSDK-8979] - Add SetStreamOptions to stream server #4530
Conversation
t.Run("when in rtppassthrough mode and a resize occurs test downgrade path to gostream", func(t *testing.T) { | ||
var startCount atomic.Int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of your tests are time based and waiting for assertions, can you run with -race
and -failfast
in canon to verify that they're not flaky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go test -timeout 30s -race -failfast -run ^TestSetStreamOptions$ go.viam.com/rdk/robot/web/stream
ok go.viam.com/rdk/robot/web/stream 3.255s
go test -timeout 30s -race -failfast -run ^TestStreamState$/^when_in_rtppassthrough_mode_and_a_resize_occurs_test_downgrade_path_to_gostream$ go.viam.com/rdk/robot/web/stream/state
ok go.viam.com/rdk/robot/web/stream/state 3.056s
@@ -271,7 +302,7 @@ func (state *StreamState) tick() { | |||
case state.streamSource == streamSourcePassthrough: | |||
// no op if we are using passthrough & are healthy | |||
state.logger.Debug("still healthy and using h264 passthrough") | |||
case state.streamSource == streamSourceGoStream: | |||
case state.streamSource == streamSourceGoStream && !state.isResized: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does a user do to hit this state after they've selected a resolution in the UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented the Reset
path for this. Not exactly sure how to handle this from a UI perspective -- may need to update the wire-diagram in the scope doc to include a Reset button.
robot/web/stream/server.go
Outdated
|
||
// validateSetStreamOptionsRequest validates the request to set the stream options. | ||
func validateSetStreamOptionsRequest(req *streampb.SetStreamOptionsRequest) (int, error) { | ||
if req.Name == "" { | ||
return optionsCommandUnknown, errors.New("stream name is required in request") | ||
} | ||
if req.Resolution == nil { | ||
return optionsCommandReset, nil | ||
} | ||
if req.Resolution.Width <= 0 || req.Resolution.Height <= 0 { | ||
return optionsCommandUnknown, | ||
fmt.Errorf( | ||
"invalid resolution to resize stream %q: width (%d) and height (%d) must be greater than 0", | ||
req.Name, req.Resolution.Width, req.Resolution.Height, | ||
) | ||
} | ||
return optionsCommandResize, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: put this above where it's used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, moved.
Description
RSDK-8982, RSDK-9167 RSDK-8979
This PR adds the
SetStreamOptions
endpoint to the stream server.NewResizeVideoSource
.Resize
msg to thestreamState
handler.Increment
andDecrement
calls.Reset
msg to thestreamState
handler.Sequence Number
handling between GoStream and Passthrough paths we now override the Sequence Number header field in theWriteRTP
method.Tests
NewStreamServiceClient
script as seen below):Demos
Screen.Recording.2024-11-12.at.2.05.18.PM.mov
passthrough_gostream_handoff.mov
TODO:
Test Script