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

[RSDK-9458] Remove Stream from Go camera interface #4580

Open
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

hexbabe
Copy link
Member

@hexbabe hexbabe commented Nov 22, 2024

Tests

  • Test webcam Darwin
  • Test webcam switch inputs Darwin
  • Test RTSP with passthrough and without
  • Test webcam Linux
  • Test webcam switch inputs Linux
  • Test transforms (especially test crop + new features) caught a bug RSDK 9552: Transforms shouldn't have to close anything #4635
  • Test ffmpeg with mediamtx
  • Test fake
  • Test image_file
  • Test OAK-D

hexbabe and others added 30 commits October 24, 2024 14:59
…here we convert to go image; Change default mimetypes for classifier
…ng default mimetypes for vision since we are failing unit tests with 'do not know how to encode' errors
@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Dec 16, 2024
@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 16, 2024
if err != nil {
return nil, ImageMetadata{}, err
}
defer release()
if mimeType == "" {
mimeType = utils.MimeTypePNG // default to lossless mimetype such as PNG
Copy link
Member Author

Choose a reason for hiding this comment

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

Does it make more sense to default to jpeg?

@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, 2024
@hexbabe hexbabe changed the title Delete Stream [RSDK-9458] Remove Stream from Go camera interface Dec 17, 2024
@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, 2024
@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, 2024
@hexbabe hexbabe marked this pull request as ready for review December 17, 2024 18:46
@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, 2024

// Close shuts down the resource and prevents further use.
Close(ctx context.Context) error
// StreamCamera is a camera that has `Stream` embedded to directly integrate with gostream.
Copy link
Member Author

@hexbabe hexbabe Dec 18, 2024

Choose a reason for hiding this comment

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

I want to delete this asap, but it's necessary for preserving some of the builtins e.g. transform

Could make follow-up tickets to refactor all the builtins to use Image and yeet transform pipeline and modularize all the nodes.

// streamCameraFromCamera is a hack to allow us to use Stream to pipe frames through the pipeline
// and still implement a camera resource.
// We prefer this methodology over passing Image bytes because each transform desires a image.Image over
// a raw byte slice. To use Image would be to wastefully encode and decode the frame multiple times.
Copy link
Member Author

Choose a reason for hiding this comment

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

It would also make this PR so hard because every transform would be need to be re-written with Image

"go.viam.com/rdk/logging"
"go.viam.com/rdk/pointcloud"
"go.viam.com/rdk/resource"
"go.viam.com/rdk/rimage"
"go.viam.com/rdk/rimage/transform"
"go.viam.com/rdk/robot"
camerautils "go.viam.com/rdk/robot/web/stream/camera"
Copy link
Member Author

@hexbabe hexbabe Dec 18, 2024

Choose a reason for hiding this comment

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

This is terrible and why I think we should clean up transform after this

But in its defense... we are already muxing the stream and camera stuff. This import is just more honest about 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 18, 2024
@hexbabe hexbabe requested a review from seanavery December 18, 2024 16:35
@hexbabe
Copy link
Member Author

hexbabe commented Dec 18, 2024

We can wait til Rand (OOO) takes a look before merging

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.