|
arduino-audio-tools
|
Common base for RTP video payloaders (JPEGRtpEncoder, H264RtpEncoder, ...): an AudioEncoder that accepts complete video frames via write() and, as a packetized IMediaSource, hands the resulting RTP fragments back out through packetSize()/readBytes(). More...
#include <RTSPVideoEncoder.h>
Public Member Functions | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| virtual bool | begin ()=0 |
| virtual bool | begin (AudioInfo info) |
| virtual void | end ()=0 |
| virtual uint32_t | frameDurationUs () |
| Optional rtsp function: provide the frame duration in microseconds. | |
| virtual int | frameSize () |
| virtual RTSPFormat & | getFormat ()=0 |
| Get the media format configuration. | |
| virtual const char * | mime ()=0 |
| Provides the mime type of the encoded result. | |
| virtual | operator bool ()=0 |
| virtual int | packetSize () |
| Size of the next queued, ready-to-send fragment, for sources that provide already RTP-payload-ready, self-delimited fragments (e.g. RFC 2435 JPEG) instead of a continuous byte stream. For these sources, readBytes() must always be called with exactly packetSize() as maxBytes, so each call retrieves exactly one complete fragment instead of the transport having to guess where one RTP payload ends and the next begins. | |
| virtual int | readBytes (void *dest, int maxSamples)=0 |
| Read media data into provided buffer. | |
| virtual uint16_t | samplesPerFrame () |
| Optional rtsp function: provide samples per the frame. | |
| void | setAudioInfo (AudioInfo from) override |
| Defines the sample rate, number of channels and bits per sample. | |
| virtual void | setFormat (RTSPFormat &format)=0 |
| virtual void | setOutput (Print &out_stream) override |
| Default output assignment (encoders may override to store Print reference) | |
| virtual void | start () |
| Initialize media source for streaming. | |
| virtual void | stop () |
| Cleanup media source after streaming. | |
| virtual size_t | write (const uint8_t *data, size_t len)=0 |
Protected Member Functions | |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
| AudioInfo | info |
Common base for RTP video payloaders (JPEGRtpEncoder, H264RtpEncoder, ...): an AudioEncoder that accepts complete video frames via write() and, as a packetized IMediaSource, hands the resulting RTP fragments back out through packetSize()/readBytes().
Letting RTSPOutput hold a single RTSPVideoEncoder* - and take a single RTSPVideoEncoder& constructor parameter - instead of one pointer/overload per codec keeps it from growing a new member/constructor pair for every additional video format. Any codec-specific data a format needs from its encoder (e.g. H.264's sprop-parameter-sets) goes through virtual methods on RTSPFormat itself (see setSpropParameterSets()/setProfileLevelId()), so encoders only ever need to hold a generic RTSPFormat*.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in CodecNOP, MP3EncoderShine, BinaryContainerEncoder, and MP3ParserEncoder.
|
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.
|
pure virtualinherited |
Implemented in CodecNOP, AACDecoderFAAD, AMRNBDecoder, AMRNBEncoder, AMRWBDecoder, AMRWBEncoder, APTXEncoder, CodecChain, Codec2Decoder, Codec2Encoder, CopyDecoder, CopyEncoder, DSFDecoder, FLACDecoderFoxen, G722Decoder, G722Encoder, GSMDecoder, GSMEncoder, ILBCDecoder, ILBCEncoder, LC3Decoder, LC3Encoder, MP3EncoderLAME, MP3DecoderMini, DecoderNetworkFormat, EncoderNetworkFormat, SBCDecoder, SBCEncoder, WavIMADecoder, BinaryContainerDecoder, OSCContainerDecoder, AudioDecoder, AACDecoderFDK, AACEncoderFDK, AACDecoderHelix, AACEncoderVO, AC3AudioDecoder, ADPCMDecoder, ADPCMEncoder, ADPCMDecoderXQ, ADPCMEncoderXQ, ADTSDecoder, EncoderALAC, APTXDecoder, DecoderBase64, EncoderBase64, DecoderBasic, EncoderBasic, DSFEncoder, FLACEncoder, EncoderFloat, G729Decoder, G729Encoder, G7xxDecoder, G7xxEncoder, EncoderL16, EncoderL8, MP2Decoder, MP3DecoderHelix, MP3DecoderMAD, MP3EncoderShine, MTSDecoder, OpusAudioDecoder, OpusAudioEncoder, OpusMultiStreamAudioDecoder, OpusMultiStreamAudioEncoder, OpusOggDecoder, OpusOggEncoder, MTSDecoderTSDemux, VorbisDecoder, WAVDecoder, WAVEncoder, DemuxerAVI, BinaryContainerEncoder, ContainerM4A, DemuxerMP4, DemuxerMPG, DemuxerMTS, OggContainerDecoder, OggContainerEncoder, OSCContainerEncoder, MP3ParserEncoder, MultiDecoder, DecoderAdapter, VorbisDecoder, H264RtpEncoder, JPEGRtpEncoder, MetaDataFilterDecoder, MetaDataFilterEncoder, and MultiVideoDemuxer.
|
inlinevirtualinherited |
Reimplemented in OpusOggEncoder, OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFDK, AACEncoderVO, OggContainerDecoder, and MetaDataFilterEncoder.
|
pure virtualinherited |
Implemented in CodecNOP, AACDecoderFAAD, APTXEncoder, Codec2Decoder, Codec2Encoder, CopyDecoder, CopyEncoder, FLACDecoderFoxen, G722Decoder, G722Encoder, GSMDecoder, GSMEncoder, ILBCDecoder, ILBCEncoder, LC3Decoder, LC3Encoder, MP3EncoderLAME, MP3DecoderMini, DecoderNetworkFormat, EncoderNetworkFormat, SBCDecoder, SBCEncoder, WavIMADecoder, BinaryContainerEncoder, BinaryContainerDecoder, OSCContainerEncoder, OSCContainerDecoder, AudioDecoder, AACDecoderFDK, AACEncoderFDK, AACDecoderHelix, AACEncoderVO, AC3AudioDecoder, ADPCMDecoder, ADPCMEncoder, ADPCMDecoderXQ, ADPCMEncoderXQ, ADTSDecoder, EncoderALAC, APTXDecoder, DecoderBase64, EncoderBase64, DecoderBasic, EncoderBasic, CodecChain, DSFDecoder, DSFEncoder, FLACEncoder, EncoderFloat, G729Decoder, G729Encoder, G7xxDecoder, G7xxEncoder, EncoderL16, EncoderL8, MP2Decoder, MP3DecoderHelix, MP3DecoderMAD, MP3EncoderShine, MTSDecoder, OpusAudioDecoder, OpusAudioEncoder, OpusMultiStreamAudioDecoder, OpusMultiStreamAudioEncoder, OpusOggDecoder, OpusOggEncoder, MTSDecoderTSDemux, VorbisDecoder, WAVDecoder, WAVEncoder, DemuxerAVI, ContainerM4A, DemuxerMP4, DemuxerMPG, DemuxerMTS, OggContainerDecoder, OggContainerEncoder, MP3ParserEncoder, MultiDecoder, DecoderAdapter, VorbisDecoder, H264RtpEncoder, JPEGRtpEncoder, MetaDataFilterDecoder, MetaDataFilterEncoder, and MultiVideoDemuxer.
|
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.
|
pure virtualinherited |
Get the media format configuration.
Returns the RTSPFormat object that describes the media data characteristics including sample rate, bit depth, number of channels, and RTP packaging parameters. If no format has been explicitly set, creates a default 16-bit PCM format at 16kHz mono.
Implemented in H264RtpEncoder, JPEGRtpEncoder, RTSPMediaCallbackSource, and RTSPMediaSource.
|
pure virtualinherited |
Provides the mime type of the encoded result.
Implements MimeSource.
Implemented in CodecNOP, AMRNBEncoder, AMRWBEncoder, APTXEncoder, CodecChain, Codec2Encoder, CopyEncoder, G722Encoder, GSMEncoder, ILBCEncoder, LC3Encoder, MP3EncoderLAME, EncoderNetworkFormat, SBCEncoder, BinaryContainerEncoder, OSCContainerEncoder, AACEncoderFDK, AACEncoderVO, ADPCMEncoder, ADPCMEncoderXQ, EncoderALAC, EncoderBase64, EncoderBasic, DSFEncoder, FLACEncoder, EncoderFloat, G729Encoder, G7xxEncoder, EncoderL16, EncoderL8, MP3EncoderShine, OpusAudioEncoder, OpusMultiStreamAudioEncoder, OpusOggEncoder, WAVEncoder, OggContainerEncoder, MP3ParserEncoder, H264RtpEncoder, JPEGRtpEncoder, and MetaDataFilterEncoder.
|
pure virtualinherited |
Implemented in CodecNOP, AACDecoderFAAD, DecoderALAC, EncoderALAC, APTXDecoder, APTXEncoder, CodecChain, Codec2Decoder, Codec2Encoder, CopyDecoder, CopyEncoder, DSFDecoder, G722Decoder, G722Encoder, G7xxDecoder, G7xxEncoder, GSMDecoder, GSMEncoder, ILBCDecoder, ILBCEncoder, LC3Decoder, LC3Encoder, MP3EncoderLAME, MP3DecoderMini, DecoderNetworkFormat, EncoderNetworkFormat, SBCDecoder, SBCEncoder, WavIMADecoder, BinaryContainerEncoder, BinaryContainerDecoder, OSCContainerEncoder, OSCContainerDecoder, AACDecoderFDK, AACEncoderFDK, AACDecoderHelix, AACEncoderVO, AC3AudioDecoder, ADPCMDecoder, ADPCMEncoder, ADPCMDecoderXQ, ADPCMEncoderXQ, ADTSDecoder, AMRNBDecoder, AMRWBDecoder, DecoderBase64, EncoderBase64, DecoderBasic, EncoderBasic, DSFEncoder, FLACEncoder, FLACDecoderFoxen, DecoderFloat, EncoderFloat, G729Decoder, G729Encoder, DecoderL16, EncoderL16, DecoderL8, EncoderL8, MP2Decoder, MP3DecoderHelix, MP3DecoderMAD, MP3EncoderShine, MTSDecoder, OpusAudioDecoder, OpusAudioEncoder, OpusMultiStreamAudioDecoder, OpusMultiStreamAudioEncoder, MTSDecoderTSDemux, VorbisDecoder, WAVDecoder, WAVEncoder, DemuxerAVI, ContainerM4A, DemuxerMP4, DemuxerMPG, DemuxerMTS, OggContainerDecoder, OggContainerEncoder, MP3ParserEncoder, MultiDecoder, DecoderAdapter, VorbisDecoder, H264RtpEncoder, JPEGRtpEncoder, MetaDataFilterDecoder, MetaDataFilterEncoder, and MultiVideoDemuxer.
|
inlinevirtualinherited |
Size of the next queued, ready-to-send fragment, for sources that provide already RTP-payload-ready, self-delimited fragments (e.g. RFC 2435 JPEG) instead of a continuous byte stream. For these sources, readBytes() must always be called with exactly packetSize() as maxBytes, so each call retrieves exactly one complete fragment instead of the transport having to guess where one RTP payload ends and the next begins.
Call it once before each readBytes() to size that call, and again right after to tell whether the fragment just read was the last one currently available - a 0 result means the caller should set the RTP marker bit on the fragment it just sent (and may advance the timestamp for the next frame).
Reimplemented in H264RtpEncoder, JPEGRtpEncoder, and RTSPMediaCallbackSource.
|
pure virtualinherited |
Read media data into provided buffer.
This is the core method that provides media data to the streaming system. Implementation should fill the destination buffer with media samples in the format specified by getFormat(). The method should be non-blocking and return available data immediately.
| dest | Pointer to buffer where media data should be written |
| maxBytes | Maximum number of bytes that can be written to dest buffer |
Implemented in RTSPMediaSource, H264RtpEncoder, JPEGRtpEncoder, and RTSPMediaCallbackSource.
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlineoverridevirtualinherited |
Defines the sample rate, number of channels and bits per sample.
Implements AudioWriter.
Reimplemented in MP3EncoderLAME, EncoderBasic, CodecChain, DSFEncoder, FLACEncoder, MP3EncoderShine, OpusAudioEncoder, OpusMultiStreamAudioEncoder, WAVEncoder, CodecNOP, G7xxEncoder, G729Encoder, BinaryContainerEncoder, OggContainerEncoder, OSCContainerEncoder, H264RtpEncoder, JPEGRtpEncoder, and MetaDataFilterEncoder.
|
pure virtual |
Associates the RTSPFormat that supplies width/height/framerate/etc. and, for some codecs, receives codec-specific SDP data back.
Implemented in H264RtpEncoder, and JPEGRtpEncoder.
|
inlineoverridevirtualinherited |
Default output assignment (encoders may override to store Print reference)
Implements AudioWriter.
Reimplemented in EncoderBasic, DSFEncoder, WAVEncoder, EncoderBase64, CodecNOP, APTXEncoder, Codec2Encoder, CopyEncoder, G722Encoder, GSMEncoder, ILBCEncoder, LC3Encoder, MP3EncoderLAME, EncoderNetworkFormat, SBCEncoder, AACEncoderFDK, AACEncoderVO, ADPCMEncoder, ADPCMEncoderXQ, EncoderALAC, AMRNBEncoder, AMRWBEncoder, CodecChain, FLACEncoder, EncoderFloat, G729Encoder, G7xxEncoder, EncoderL16, EncoderL8, MP3EncoderShine, OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3ParserEncoder, MetaDataFilterEncoder, BinaryContainerEncoder, OSCContainerEncoder, and OggContainerEncoder.
|
inlinevirtualinherited |
Initialize media source for streaming.
Called when streaming is about to begin. Implementations should use this to initialize hardware, allocate buffers, start media capture, or perform any other setup required for media data generation.
Reimplemented in H264RtpEncoder, JPEGRtpEncoder, RTSPMediaCallbackSource, and RTSPMediaSource.
|
inlinevirtualinherited |
Cleanup media source after streaming.
Called when streaming has ended. Implementations should use this to release hardware resources, deallocate buffers, stop media capture, or perform cleanup operations.
Reimplemented in H264RtpEncoder, JPEGRtpEncoder, RTSPMediaCallbackSource, and RTSPMediaSource.
|
pure virtualinherited |
Implemented in CodecNOP, AACDecoderFAAD, ADPCMDecoderXQ, APTXDecoder, APTXEncoder, CopyDecoder, CopyEncoder, DSFDecoder, G722Decoder, G722Encoder, GSMDecoder, GSMEncoder, ILBCDecoder, ILBCEncoder, LC3Decoder, LC3Encoder, MP3EncoderLAME, MP3DecoderMini, DecoderNetworkFormat, EncoderNetworkFormat, SBCDecoder, SBCEncoder, WavIMADecoder, BinaryContainerEncoder, BinaryContainerDecoder, OSCContainerEncoder, OSCContainerDecoder, AACDecoderFDK, AACEncoderFDK, AACDecoderHelix, AACEncoderVO, AC3AudioDecoder, ADPCMDecoder, ADPCMEncoder, ADPCMEncoderXQ, ADTSDecoder, EncoderALAC, AMRNBDecoder, AMRNBEncoder, AMRWBDecoder, AMRWBEncoder, DecoderBase64, EncoderBase64, DecoderBasic, CodecChain, Codec2Decoder, DSFEncoder, FLACEncoder, FLACDecoderFoxen, DecoderFloat, EncoderFloat, G729Decoder, G729Encoder, G7xxDecoder, G7xxEncoder, G711Encoder, G711Decoder, DecoderL16, EncoderL16, DecoderL8, EncoderL8, MP2Decoder, MP3DecoderHelix, MP3DecoderMAD, MP3EncoderShine, MTSDecoder, OpusAudioDecoder, OpusAudioEncoder, OpusMultiStreamAudioDecoder, OpusMultiStreamAudioEncoder, MTSDecoderTSDemux, WAVDecoder, WAVEncoder, DemuxerAVI, ContainerM4A, DemuxerMP4, DemuxerMPG, DemuxerMTS, OggContainerDecoder, OggContainerEncoder, MP3ParserEncoder, MultiDecoder, DecoderAdapter, VorbisDecoder, H264RtpEncoder, JPEGRtpEncoder, MetaDataFilterDecoder, MetaDataFilterEncoder, MultiVideoDemuxer, DecoderALAC, EncoderBasic, and Codec2Encoder.
|
inlineprotectedinherited |
|
protectedinherited |