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

Common interface for video decoders (e.g. H264Decoder, H264DecoderESP32S3 - CodecH264.h/CodecH264ESP32S3.h) - standardizes lifecycle (begin()/end()), the Print target decoded pictures are written to, and the pixel format they're written in (setVideoFormat()), on top of VideoOutput's write()/flush() (the encoded-bitstream input side, inherited unchanged). Concrete decoders may still expose their own additional config knobs beyond this shared surface. More...

#include <CodecVideo.h>

Inheritance diagram for VideoDecoder:
VideoOutput H264Decoder H264DecoderESP32S3< Alloc > MJPEGDecoder MPGDecoder

Public Member Functions

virtual ~VideoDecoder ()=default
 
virtual bool begin ()=0
 Initializes the decoder (allocates its picture buffers, etc).
 
virtual void end ()=0
 Releases the decoder's resources.
 
virtual void flush ()
 
virtual void setOutput (Print &out)=0
 Defines the target each decoded picture is written to.
 
virtual void setVideoFormat (VideoFormat format)=0
 
virtual VideoInfo videoInfo ()=0
 
virtual size_t write (const uint8_t *data, size_t len)=0
 

Detailed Description

Common interface for video decoders (e.g. H264Decoder, H264DecoderESP32S3 - CodecH264.h/CodecH264ESP32S3.h) - standardizes lifecycle (begin()/end()), the Print target decoded pictures are written to, and the pixel format they're written in (setVideoFormat()), on top of VideoOutput's write()/flush() (the encoded-bitstream input side, inherited unchanged). Concrete decoders may still expose their own additional config knobs beyond this shared surface.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ ~VideoDecoder()

virtual ~VideoDecoder ( )
virtualdefault

Member Function Documentation

◆ begin()

virtual bool begin ( )
pure virtual

Initializes the decoder (allocates its picture buffers, etc).

Implemented in H264Decoder, H264DecoderESP32S3< Alloc >, MJPEGDecoder, and MPGDecoder.

◆ end()

virtual void end ( )
pure virtual

Releases the decoder's resources.

Implemented in H264Decoder, H264DecoderESP32S3< Alloc >, MJPEGDecoder, and MPGDecoder.

◆ 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.

◆ setOutput()

virtual void setOutput ( Print out)
pure virtual

Defines the target each decoded picture is written to.

Implemented in H264Decoder, MJPEGDecoder, H264DecoderESP32S3< Alloc >, and MPGDecoder.

◆ setVideoFormat()

virtual void setVideoFormat ( VideoFormat  format)
pure virtual

Selects the pixel format written to setOutput()'s target - e.g. VideoFormat::RGB565 (the common TFT wire format), RGB666/RGB888 for higher color depth displays, or I420 to pass the decoded planes through unconverted. Not every decoder backend supports every value (e.g. RGB666/RGB888 are TinyH264-only, not available on the esp_h264 backend) - unsupported values are logged and ignored (the previously selected format stays in effect); see the concrete class for exactly which ones it supports. Call before begin().

Implemented in H264Decoder, H264DecoderESP32S3< Alloc >, MJPEGDecoder, and MPGDecoder.

◆ videoInfo()

virtual VideoInfo videoInfo ( )
pure virtual

Reports the format/dimensions of the picture written to setOutput()'s target - VideoInfo::format is always the format most recently selected via setVideoFormat() (RGB565 if never called), the reliable way to determine it (rather than assuming); width/ height reflect the most recently decoded picture, 0 before any picture has been decoded.

Implemented in H264Decoder, H264DecoderESP32S3< Alloc >, MJPEGDecoder, and MPGDecoder.

◆ write()

virtual size_t write ( const uint8_t *  data,
size_t  len 
)
pure virtualinherited

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