Added SetFrameBuffer for Video and Camera

This commit is contained in:
Alex Eidt 2022-04-18 17:38:21 -07:00
parent 3f4ae6eb23
commit 2d72a27288
3 changed files with 47 additions and 39 deletions

View file

@ -73,6 +73,12 @@ func (video *Video) FrameBuffer() []byte {
return video.framebuffer
}
// Sets the framebuffer to the given byte array. Note that "buffer" must be large enough
// to store one frame of video data which is width*height*3.
func (video *Video) SetFrameBuffer(buffer []byte) {
video.framebuffer = buffer
}
// Creates a new Video struct.
// Uses ffprobe to get video information and fills in the Video struct with this data.
func NewVideo(filename string) (*Video, error) {