mirror of
https://github.com/datarhei/core.git
synced 2025-10-14 20:15:45 +08:00
Add v16.7.2
This commit is contained in:
43
ffmpeg/skills/v4l2_test.go
Normal file
43
ffmpeg/skills/v4l2_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package skills
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNoV4LDevices(t *testing.T) {
|
||||
data := bytes.NewBufferString(``)
|
||||
|
||||
devices := parseV4LDevices(data)
|
||||
|
||||
require.Equal(t, []HWDevice{}, devices)
|
||||
}
|
||||
|
||||
func TestV4LDevices(t *testing.T) {
|
||||
data := bytes.NewBufferString(`mmal service 16.1 (platform:bcm2835-v4l2):
|
||||
/dev/video0
|
||||
|
||||
Webcam C170: Webcam C170 (usb-3f980000.usb-1.3):
|
||||
/dev/video1
|
||||
|
||||
`)
|
||||
|
||||
devices := parseV4LDevices(data)
|
||||
|
||||
require.Equal(t, []HWDevice{
|
||||
{
|
||||
Id: "/dev/video0",
|
||||
Name: "mmal service 16.1",
|
||||
Extra: "platform:bcm2835-v4l2",
|
||||
Media: "video",
|
||||
},
|
||||
{
|
||||
Id: "/dev/video1",
|
||||
Name: "Webcam C170: Webcam C170",
|
||||
Extra: "usb-3f980000.usb-1.3",
|
||||
Media: "video",
|
||||
},
|
||||
}, devices)
|
||||
}
|
Reference in New Issue
Block a user