class VideoFrame
Defined at line 23 of file ../../src/camera/drivers/usb_video/video_frame.h
VideoFrame represents one frame of a video stream. Instances of this class
are created when a new frame is detected, and destroyed when the frame is fully
received into the buffer.
Public Methods
zx::result<fuchsia::camera::FrameAvailableEvent> Release ()
Releases the write lock on the buffer, and returns information
for transmitting that a frame is available for consumption.
This should only be called when ProcessPayload indicates
the frame is complete.
The returned FrameAvailableEvent accounts for frame errors, or if we didn't have a buffer.
Release will only return an error if there was a logical issue with the frame,
in which case the frame should not be sent to the stream client.
Defined at line 23 of file ../../src/camera/drivers/usb_video/video_frame.cc
void VideoFrame (fzl::VmoPool::Bufferbuffer,const UsbState &usb_state,uint32_tframe_number)
Both the UsbState and the VmoPool which produced the buffer passed to VideoFrame
must be valid for the lifetime of the frame.
Defined at line 27 of file ../../src/camera/drivers/usb_video/video_frame.h
uint32_t FrameNumber ()
Defined at line 58 of file ../../src/camera/drivers/usb_video/video_frame.h
zx_status_t ProcessPayload (usb_request_t * req)
Extracts the payload data from the usb request response,
and stores it in the video buffer.
Returns:
ZX_ERR_STOP - If the video frame has been completed by
this request. Release() can now be called.
ZX_ERR_NEXT - If the video frame has already been completed.
A new video frame should be created, and the
usb_request given should be passed to the new
frame.
ZX_OK - The data in the request was added to the frame.
Other Errors- There is an error with the request or the frame.
No action needs to be taken. Although this frame
will have errors, it is still necessary to wait until
a new frame is started. The error flag will be set
for this frame when Release is called.
Defined at line 83 of file ../../src/camera/drivers/usb_video/video_frame.cc