-
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-9458] Remove Stream
from Go camera interface
#4580
base: main
Are you sure you want to change the base?
Conversation
…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
…urcewrappers Image func
Co-authored-by: nicksanford <[email protected]>
if err != nil { | ||
return nil, ImageMetadata{}, err | ||
} | ||
defer release() | ||
if mimeType == "" { | ||
mimeType = utils.MimeTypePNG // default to lossless mimetype such as PNG |
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.
Does it make more sense to default to jpeg?
Stream
from Go camera interface
|
||
// 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. |
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.
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. |
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.
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" |
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.
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.
We can wait til Rand (OOO) takes a look before merging |
Tests