|
arduino-audio-tools
|
Wraps the encoded data into Config, Data, and Meta segments so that we can recover the audio configuration and orignial segments if this is relevant. We assume that a full segment is written with each call of write(); The segments are separated with a new line character. More...
#include <ContainerBinary.h>
Public Member Functions | |
| BinaryContainerEncoder ()=default | |
| BinaryContainerEncoder (AudioEncoder &encoder) | |
| BinaryContainerEncoder (AudioEncoder *encoder) | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () override |
| virtual bool | begin (AudioInfo info) |
| void | end () |
| virtual uint32_t | frameDurationUs () |
| Optional rtsp function: provide the frame duration in microseconds. | |
| virtual int | frameSize () |
| virtual const char * | mime () |
| Provides the mime type of the encoded result. | |
| operator bool () | |
| virtual uint16_t | samplesPerFrame () |
| Optional rtsp function: provide samples per the frame. | |
| void | setAudioInfo (AudioInfo info) override |
| Defines the sample rate, number of channels and bits per sample. | |
| void | setEncoder (AudioEncoder *encoder) |
| void | setOutput (Print &outStream) |
| Default output assignment (encoders may override to store Print reference) | |
| void | setVideoInfo (VideoInfo info) |
| VideoInfo | videoInfo () |
| size_t | write (const uint8_t *data, size_t len) |
| Add data segment. On first write we also add a AudioInfo header. | |
| size_t | writeMeta (const uint8_t *data, size_t len) |
| Adds meta data segment. | |
| size_t | writeVideo (const uint8_t *data, size_t len) |
Protected Member Functions | |
| size_t | output (const uint8_t *data, size_t len) |
| void | writeAudio (const uint8_t *data, size_t len) |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
| void | writeHeader () |
| void | writeVideoHeader () |
Protected Attributes | |
| SimpleContainerConfig | cfg |
| SimpleContainerDataHeader | dh |
| AudioInfo | info |
| bool | is_beginning = true |
| bool | is_video_beginning = true |
| SimpleContainerMetaDataHeader | meta |
| AudioEncoder * | p_codec = nullptr |
| Print * | p_out = nullptr |
| uint64_t | packet_count = 0 |
| int | repeat_header |
| SimpleContainerVideoConfig | video_cfg |
| SimpleContainerVideoDataHeader | video_dh |
Wraps the encoded data into Config, Data, and Meta segments so that we can recover the audio configuration and orignial segments if this is relevant. We assume that a full segment is written with each call of write(); The segments are separated with a new line character.
|
default |
|
inline |
|
inline |
|
inlineoverridevirtual |
provides the actual input AudioInfo
Reimplemented from AudioEncoder.
|
inlinevirtualinherited |
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
|
inlineoverridevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Reimplemented in OpusOggEncoder, OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFDK, AACEncoderVO, OggContainerDecoder, and MetaDataFilterEncoder.
|
inlinevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, MP3EncoderShine, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlinevirtualinherited |
Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).
Reimplemented in ADPCMEncoder, EncoderALAC, AMRNBEncoder, AMRWBEncoder, and MP3ParserEncoder.
|
inlinevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
|
inlinevirtual |
Implements AudioWriter.
|
inlineprotected |
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtual |
Defines the sample rate, number of channels and bits per sample.
Reimplemented from AudioEncoder.
|
inline |
|
inlinevirtual |
Default output assignment (encoders may override to store Print reference)
Reimplemented from AudioEncoder.
|
inline |
Defines the video track configuration (width/height/format/...) - the VideoHeader segment is (re-)sent before the next writeVideo() call.
|
inline |
|
inlinevirtual |
Add data segment. On first write we also add a AudioInfo header.
Implements AudioWriter.
|
inlineprotected |
|
inlineprotectedinherited |
|
inlineprotected |
|
inline |
Adds meta data segment.
|
inline |
Adds one already-encoded video/image frame (e.g. one H.264 access unit or one complete JPEG image) as a Video segment - a single call must provide the full frame. On the first call (or after setVideoInfo()) a VideoHeader segment is emitted first.
|
inlineprotected |
|
protected |
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |