arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | List of all members
VideoFrameSource Class Referenceabstract

Pull-based provider of one already-encoded video/image frame at a time - e.g. wraps a camera capture + H264Encoder/MJPEG capture pipeline. Used by VideoMuxerWithTasks's video task, which calls nextFrame() once per iteration, at the rate given by videoInfo().fps. Implementations should produce/capture the frame here directly (not defer it): a slow nextFrame() only delays whatever is pulling from it. More...

#include <Video.h>

Inheritance diagram for VideoFrameSource:
CameraFrameSource CameraFrameSourceOpenCV

Public Member Functions

virtual ~VideoFrameSource ()=default
 
virtual const uint8_t * nextFrame (size_t &len)=0
 
virtual VideoInfo videoInfo ()=0
 
bool writeTo (Print &out)
 Write the frame to the indicated destination.
 

Detailed Description

Pull-based provider of one already-encoded video/image frame at a time - e.g. wraps a camera capture + H264Encoder/MJPEG capture pipeline. Used by VideoMuxerWithTasks's video task, which calls nextFrame() once per iteration, at the rate given by videoInfo().fps. Implementations should produce/capture the frame here directly (not defer it): a slow nextFrame() only delays whatever is pulling from it.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ ~VideoFrameSource()

virtual ~VideoFrameSource ( )
virtualdefault

Member Function Documentation

◆ nextFrame()

virtual const uint8_t * nextFrame ( size_t &  len)
pure virtual

Provides the next encoded frame: return a pointer to the frame's bytes (only required to stay valid until the next nextFrame() call) and set len to its size - or return nullptr if no frame is available yet, in which case the caller skips this iteration.

Implemented in CameraFrameSource, and CameraFrameSourceOpenCV.

◆ videoInfo()

virtual VideoInfo videoInfo ( )
pure virtual

Provides the width/height/fps/format (and, if known, frame_size/ total_file_size) of the frames returned by nextFrame() - width, height, fps and format must be set, since VideoMuxerWithTasks uses them directly to configure the Muxer it writes to instead of requiring the caller to duplicate the same values there.

Implemented in CameraFrameSource, and CameraFrameSourceOpenCV.

◆ writeTo()

bool writeTo ( Print out)
inline

Write the frame to the indicated destination.


The documentation for this class was generated from the following file: