mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-07-25 06:15:06 +00:00
fix(darwin,msmf): Block Read until next frame (reset haveFrame)
This commit is contained in:
@@ -170,6 +170,7 @@ func (c *Camera) Read() (img image.Image, err error) {
|
||||
}
|
||||
|
||||
bgraToRgba(c.frame, c.rgba)
|
||||
c.haveFrame = false
|
||||
|
||||
c.mu.Unlock()
|
||||
|
||||
|
||||
@@ -373,6 +373,7 @@ func (c *Camera) Read() (img image.Image, err error) {
|
||||
|
||||
nv12ToYCbCr420(c.frame, c.stride, c.width, c.height, c.ycbcr)
|
||||
img = c.ycbcr
|
||||
c.haveFrame = false
|
||||
|
||||
c.mu.Unlock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user