arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
OutputTinyGPU Class Reference

Bridges VideoDecoder's write() calls to a TinyGPU ILI9341Driver - VideoDecoder always hands over one complete frame per write() call (see its class comment), so this can push the whole frame in one go. Usually the data is in RGB565 format, but other formats are supported as well. More...

#include <OutputTinyGPU.h>

Inheritance diagram for OutputTinyGPU:
VideoOutput

Public Member Functions

 OutputTinyGPU (ILI9341Driver< RGB565 > &driver, int width, int height, int pinBacklight, int bandHeight=40)
 
bool begin ()
 
void clearScreen ()
 
virtual void flush ()
 
void setVideoInfo (VideoInfo info)
 Defines the video format and dimensions - call before begin() if you.
 
void setVideoInfoSource (VideoInfoSource &source)
 Defines the source of the video information (width, height, fps, format)
 
size_t write (const uint8_t *data, size_t len) override
 

Protected Attributes

int height = 240
 
VideoInfo info_
 
int kBandHeight
 
int kPinBacklight
 
VideoInfoSourcep_info = nullptr
 
ILI9341Driver< RGB565 > & tftDriver
 
int width = 320
 

Detailed Description

Bridges VideoDecoder's write() calls to a TinyGPU ILI9341Driver - VideoDecoder always hands over one complete frame per write() call (see its class comment), so this can push the whole frame in one go. Usually the data is in RGB565 format, but other formats are supported as well.

write() never allocates or copies a full-frame buffer of its own: it wraps the caller's already-decoded frame in a SurfaceWithExternalBuffer (a TinyGPU view over externally-owned memory) and hands that straight to the display driver, so RAM use stays independent of the frame size - only clearScreen()'s small band buffer (kBandHeight rows) is actually owned/allocated here.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ OutputTinyGPU()

OutputTinyGPU ( ILI9341Driver< RGB565 > &  driver,
int  width,
int  height,
int  pinBacklight,
int  bandHeight = 40 
)
inline
Parameters
bandHeightheight (in pixels) of the strip used to clear the screen in begin() - kept small (default 40) so the clear buffer stays a small, single allocation instead of a full-screen framebuffer; see TinyGPU's bouncing-ball example for the same technique.

Member Function Documentation

◆ begin()

bool begin ( )
inline

◆ clearScreen()

void clearScreen ( )
inline

◆ flush()

virtual void flush ( )
inlinevirtualinherited

Finalizes the frame most recently written via one or more write() calls - see class comment. Default no-op for implementations that display/decode synchronously in write() instead.

Reimplemented in Muxer, H264Decoder, H264DecoderESP32S3< Alloc >, MJPEGDecoder, MPGDecoder, and OutputOpenCV.

◆ setVideoInfo()

void setVideoInfo ( VideoInfo  info)
inline

Defines the video format and dimensions - call before begin() if you.

◆ setVideoInfoSource()

void setVideoInfoSource ( VideoInfoSource source)
inline

Defines the source of the video information (width, height, fps, format)

◆ write()

size_t write ( const uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

Implements VideoOutput.

Member Data Documentation

◆ height

int height = 240
protected

◆ info_

VideoInfo info_
protected

◆ kBandHeight

int kBandHeight
protected

◆ kPinBacklight

int kPinBacklight
protected

◆ p_info

VideoInfoSource* p_info = nullptr
protected

◆ tftDriver

ILI9341Driver<RGB565>& tftDriver
protected

◆ width

int width = 320
protected

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