Skip to content

Conversation

@hexbabe
Copy link
Member

@hexbabe hexbabe commented Dec 17, 2025

https://viam.atlassian.net/browse/RSDK-11732

This PR removes GetImage as the source of frames for image-based live streams. It makes the previously gated by feature flag GetImages path the main and only path.

This is the PR that added the feature flag and GetImages path originally: #5258

Manual Tests

  • Fake camera (rtp passthrough and images path)
  • Webcam
  • RTSP camera (rtp passthrough and images path)
  • Realsense color only stream
  • Realsense depth only stream
  • Realsense color + depth both returned stream, then remove the active source and see how the stream handles it

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 17, 2025
Comment on lines 87 to 98
imgBytes, err := namedImage.Bytes(ctx)
if err != nil {
continue
}

_, format, err := image.DecodeConfig(bytes.NewReader(imgBytes))
if err != nil {
continue
}
if _, ok := StreamableImageMIMETypes[FormatStringToMimeType(format)]; ok {
return namedImage, nil
Copy link
Member Author

@hexbabe hexbabe Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost all code except the highlighted is directly copy and pasted from camera2/camera.go (now deleted since it used to be gated behind a feature flag). The FormatStringToMimeType helper is also new along with the corresponding test.

I added this new code because I want the stream server to be more robust i.e. if a mimeType is missing/wrong somehow, we still want to be able to stream if the underlying bytes are healthy. DecodeConfig is a lightweight function that checks the header bytes of the actual image bytes and tells us what the format is for a stronger source of truth vs. mime type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 18, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 18, 2025
Copy link
Member

@seanavery seanavery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice DecodeConfig use!

Let me know if you need a hand with manual tests

Copy link
Contributor

@SebastianMunozP SebastianMunozP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Dec 31, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 2, 2026
@hexbabe hexbabe merged commit ae7b4df into viamrobotics:main Jan 5, 2026
19 checks passed
@hexbabe hexbabe deleted the RSDK-11732 branch January 5, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test This pull request is marked safe to test from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants