MultiplexPacketEncoder
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
| Return | Name | Description |
|---|---|---|
MultiplexPacketEncoder | Construct the encoder with the given options. | |
MultiplexPacketEncoder | Deleted constructor. | |
MultiplexPacketEncoder | Deleted constructor. | |
void | encode virtual | Encode a VideoPacket, dispatching to the planar or interleaved encode path as appropriate. |
void | encode virtual | Encode an AudioPacket, dispatching to the planar or interleaved encode path as appropriate. |
bool | accepts virtual | #### Returns |
void | process virtual | Dispatch 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
optionsThe encoder configuration (input/output formats and file paths).
MultiplexPacketEncoder
MultiplexPacketEncoder(const MultiplexPacketEncoder &) = deleteDeleted constructor.
MultiplexPacketEncoder
MultiplexPacketEncoder(MultiplexPacketEncoder &&) = deleteDeleted constructor.
encode
virtual
virtual void encode(VideoPacket & packet)Encode a VideoPacket, dispatching to the planar or interleaved encode path as appropriate.
Parameters
packetThe 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
packetThe 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
packetThe incoming media packet.
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::mutex | _mutex |
_mutex
std::mutex _mutexProtected Methods
| Return | Name | Description |
|---|---|---|
void | onStreamStateChange virtual | 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. |
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.
