PacketStreamAdapter
#include <icy/packetstream.h>
class PacketStreamAdapterDefined in src/base/include/icy/packetstream.h:44
- Subclassed by
PacketProcessor,ThreadedStreamReader,ICapture,FormWriter,WebRtcTrackReceiver
This class is a wrapper for integrating external classes with the a PacketStream's data flow and state machine.
Public Methods
| Return | Name | Description |
|---|---|---|
PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. | |
~PacketStreamAdapter virtual inline | ||
void | emit virtual | Emit a mutable raw buffer as a packet. |
void | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
void | emit virtual | Emit a string as a packet (data is copied internally). |
void | emit virtual | Emit a flag-only packet carrying no payload data. |
void | emit virtual | Emit an existing packet directly onto the outgoing signal. |
PacketSignal & | getEmitter | Returns a reference to the outgoing packet signal. |
PacketRetention | retention virtual const | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
void | onStreamStateChange virtual inline | 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. |
PacketStreamAdapter
PacketStreamAdapter(PacketSignal & emitter)Defined in src/base/include/icy/packetstream.h:49
Construct the adapter, binding it to the given packet signal.
Parameters
| Parameter | Type | Description |
|---|---|---|
emitter | PacketSignal & | The outgoing packet signal owned by the subclass. |
~PacketStreamAdapter
virtual inline
virtual inline ~PacketStreamAdapter()Defined in src/base/include/icy/packetstream.h:50
emit
virtual
virtual void emit(char * data, size_t len, unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:56
Emit a mutable raw buffer as a packet.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | char * | Pointer to the buffer (not copied; caller retains ownership). |
len | size_t | Number of bytes in the buffer. |
flags | unsigned | Optional packet flags (see PacketFlags). |
emit
virtual
virtual void emit(const char * data, size_t len, unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:62
Emit a read-only raw buffer as a packet (data is copied internally).
Parameters
| Parameter | Type | Description |
|---|---|---|
data | const char * | Pointer to the buffer. |
len | size_t | Number of bytes in the buffer. |
flags | unsigned | Optional packet flags (see PacketFlags). |
emit
virtual
virtual void emit(const std::string & str, unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:67
Emit a string as a packet (data is copied internally).
Parameters
| Parameter | Type | Description |
|---|---|---|
str | const std::string & | String payload. |
flags | unsigned | Optional packet flags (see PacketFlags). |
emit
virtual
virtual void emit(unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:71
Emit a flag-only packet carrying no payload data.
Parameters
| Parameter | Type | Description |
|---|---|---|
flags | unsigned | Packet flags to embed in the emitted FlagPacket. |
emit
virtual
virtual void emit(IPacket & packet)Defined in src/base/include/icy/packetstream.h:75
Emit an existing packet directly onto the outgoing signal.
Reimplemented by
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | IPacket & | The packet to forward; must remain valid for the duration of the call. |
getEmitter
PacketSignal & getEmitter()Defined in src/base/include/icy/packetstream.h:78
Returns a reference to the outgoing packet signal.
retention
virtual const
virtual PacketRetention retention() constDefined in src/base/include/icy/packetstream.h:86
Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph.
Reimplemented by
SyncPacketQueue::retentionAsyncPacketQueue::retentionAsyncPacketQueue::retentionAsyncPacketQueue::retentionAsyncPacketQueue::retention
onStreamStateChange
virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Defined in src/base/include/icy/packetstream.h:93
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.
Reimplemented by
FPSLimiter::onStreamStateChangeSyncPacketQueue::onStreamStateChangeAsyncPacketQueue::onStreamStateChangeAsyncPacketQueue::onStreamStateChangeAsyncPacketQueue::onStreamStateChangeAsyncPacketQueue::onStreamStateChangeAudioPacketEncoder::onStreamStateChangeICapture::onStreamStateChangeMultiplexPacketEncoder::onStreamStateChangeRealtimePacketQueue::onStreamStateChangeVideoPacketEncoder::onStreamStateChangeStreamWriter::onStreamStateChangeWebRtcTrackSender::onStreamStateChange
Protected Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal & | _emitter |
_emitter
PacketSignal & _emitterType: PacketSignal &
Defined in src/base/include/icy/packetstream.h:102
Protected Methods
| Return | Name | Description |
|---|---|---|
PacketStreamAdapter | NonCopyable and NonMovable. | |
PacketStreamAdapter & | operator= | Deleted assignment operator. |
PacketStreamAdapter | Deleted constructor. | |
PacketStreamAdapter & | operator= | Deleted assignment operator. |
PacketStreamAdapter
PacketStreamAdapter(const PacketStreamAdapter &) = deleteDefined in src/base/include/icy/packetstream.h:97
NonCopyable and NonMovable.
operator=
PacketStreamAdapter & operator=(const PacketStreamAdapter &) = deleteDefined in src/base/include/icy/packetstream.h:98
Deleted assignment operator.
PacketStreamAdapter
PacketStreamAdapter(PacketStreamAdapter &&) = deleteDefined in src/base/include/icy/packetstream.h:99
Deleted constructor.
operator=
PacketStreamAdapter & operator=(PacketStreamAdapter &&) = deleteDefined in src/base/include/icy/packetstream.h:100
Deleted assignment operator.
