-
Notifications
You must be signed in to change notification settings - Fork 117
remove-gostream-dep-on-mediadevices #4983
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
base: main
Are you sure you want to change the base?
remove-gostream-dep-on-mediadevices #4983
Conversation
for _, label := range labels { | ||
if label == target { | ||
return true | ||
} | ||
} | ||
return false |
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.
unrelated cleanup
labels := strings.Split(d.Info().Label, camera.LabelSeparator) | ||
for _, label := range labels { | ||
if labelPattern.MatchString(label) { | ||
return true | ||
} | ||
} | ||
return false |
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.
unrelated cleanup
constraint.Width = prop.IntRanged{640, 4096, 1920} | ||
constraint.Height = prop.IntRanged{400, 2160, 1080} | ||
constraint.FrameRate = prop.FloatRanged{0, 200, 60} |
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.
unrelated cleanup
@nicksanford Have we verified that using camera package from RDK no longer includes mediadevices as a dependency? |
Mediadevices's camera driver's init function, defined in camera_PLATFORM.go, runs C code within it's init() function that tries to discover webcams but doesn't always work on all platforms, sometimes causing the OS process to crash:
https://github.com/pion/mediadevices/blob/v0.6.4/pkg/driver/camera/camera_linux.go
https://github.com/pion/mediadevices/blob/v0.6.4/pkg/driver/camera/camera_darwin.go
https://github.com/pion/mediadevices/blob/v0.6.4/pkg/driver/camera/camera_windows.go
Currently, any module that has a transitive dependency on the RDK camera interface also depends on gostream, and as a consequence, will execute the media devices camera driver's init function on os process startup.
This is completely unnecessary as the only reason why gostream depended on mediadevices is to import a constant.
This code change removes the gostream -> mediadevices dependency, reducing the times when module implementers will unexpectedly.
Long term, we should consider removing the dependency on mediadevices altogether by moving the builtin webcam camera to a module.