AV module

MultiplexPacketEncoder

Encodes and multiplexes a realtime video stream form audio / video capture sources.

MultiplexPacketEncoder

#include <icy/av/multiplexpacketencoder.h>

Inherits: MultiplexEncoder, PacketProcessor

Encodes and multiplexes a realtime video stream form audio / video capture sources. FFmpeg is used for encoding.

Public Methods

ReturnNameDescription
MultiplexPacketEncoderConstruct the encoder with the given options.
MultiplexPacketEncoderDeleted constructor.
MultiplexPacketEncoderDeleted constructor.
voidencode virtualEncode a VideoPacket, dispatching to the planar or interleaved encode path as appropriate.
voidencode virtualEncode an AudioPacket, dispatching to the planar or interleaved encode path as appropriate.
boolaccepts virtual#### Returns
voidprocess virtualDispatch the incoming packet to encode(VideoPacket&) or encode(AudioPacket&). Throws std::invalid_argument if the packet type is unrecognised.

MultiplexPacketEncoder

MultiplexPacketEncoder(const EncoderOptions & options)

Construct the encoder with the given options.

Parameters

  • options The encoder configuration (input/output formats and file paths).

MultiplexPacketEncoder

MultiplexPacketEncoder(const MultiplexPacketEncoder &) = delete

Deleted constructor.


MultiplexPacketEncoder

MultiplexPacketEncoder(MultiplexPacketEncoder &&) = delete

Deleted constructor.


encode

virtual

virtual void encode(VideoPacket & packet)

Encode a VideoPacket, dispatching to the planar or interleaved encode path as appropriate.

Parameters

  • packet The video packet to encode.

encode

virtual

virtual void encode(AudioPacket & packet)

Encode an AudioPacket, dispatching to the planar or interleaved encode path as appropriate.

Parameters

  • packet The audio packet to encode.

accepts

virtual

virtual bool accepts(IPacket * packet)

Returns

True if the packet is an av::MediaPacket (audio or video).


process

virtual

virtual void process(IPacket & packet)

Dispatch the incoming packet to encode(VideoPacket&) or encode(AudioPacket&). Throws std::invalid_argument if the packet type is unrecognised.

Parameters

  • packet The incoming media packet.

Protected Attributes

ReturnNameDescription
std::mutex_mutex

_mutex

std::mutex _mutex

Protected Methods

ReturnNameDescription
voidonStreamStateChange virtualCalled by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios.

onStreamStateChange

virtual

virtual void onStreamStateChange(const PacketStreamState &)

Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios.