mirror of
https://github.com/gen2brain/cam2ip.git
synced 2025-12-16 12:28:35 +00:00
Add support for native V4L implementation on Linux/RPi
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// +build !cv3
|
||||
// +build !cv3,!native
|
||||
|
||||
// Package video.
|
||||
package video
|
||||
@@ -42,7 +42,7 @@ func (v *Video) Read() (img image.Image, err error) {
|
||||
if v.video.GrabFrame() {
|
||||
v.frame = v.video.RetrieveFrame(1)
|
||||
if v.frame == nil {
|
||||
err = fmt.Errorf("video: can not grab frame")
|
||||
err = fmt.Errorf("video: can not retrieve frame")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build cv3
|
||||
// +build cv3,!native
|
||||
|
||||
// Package video.
|
||||
package video
|
||||
@@ -49,7 +49,7 @@ func (v *Video) Read() (img image.Image, err error) {
|
||||
}
|
||||
|
||||
if v.frame == nil {
|
||||
err = fmt.Errorf("video: can not grab frame")
|
||||
err = fmt.Errorf("video: can not retrieve frame")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestVideo(t *testing.T) {
|
||||
video, err := New("test.mp4")
|
||||
video, err := New(video.Options{"test.mp4", 0})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user