-
Notifications
You must be signed in to change notification settings - Fork 110
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
Move more of the videosource code to the videosourcewrappers file #4366
Conversation
Warning your change may break code samples. If your change modifies any of the following functions please contact @viamrobotics/fleet-management. Thanks!
|
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.
No weird build flag interference here?
Not according to my tests, but we'll see what CI says. |
logging.Logger | ||
} | ||
|
||
func (vs *sourceBasedCamera) SubscribeRTP( |
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.
[q] Trying to figure out why we define SubscribeRTP
and Unsubscribe
for both sourceBasedCamera
and videoSource
.
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.
They're both implementing a VideoSource go interface interface/class, which can optionally have a SubscribeRTP
method. There are other implementations of the VideoSource
interface, for example filesource
which is used in image_file
. All of these structs implement the Camera/VideoSource methods, and can optionally implement Subscribe/UnsubscribeRTP
to allow the RTP packet pass-through that @nicksanford wrote to be used by a camera's implementation.
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 also why in the constructors for different go cameras, we use the helper functions in this file to make one of the video sources that implements all of these methods. It's an example of trying ot use single point of truth/dry.
This pr simply moves code around so that the structs implementing videosources are all in one file.