mirror of
https://github.com/pion/mediadevices.git
synced 2025-12-24 13:18:11 +08:00
Prioritize /dev/video0 on Linux camera
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
const (
|
||||
maxEmptyFrameCount = 5
|
||||
prioritizedDevice = "video0"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -94,9 +95,14 @@ func init() {
|
||||
|
||||
discovered[reallink] = struct{}{}
|
||||
cam := newCamera(device)
|
||||
priority := driver.PriorityNormal
|
||||
if label == prioritizedDevice {
|
||||
priority = driver.PriorityHigh
|
||||
}
|
||||
driver.GetManager().Register(cam, driver.Info{
|
||||
Label: label,
|
||||
DeviceType: driver.Camera,
|
||||
Priority: priority,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user