PacketStreamAdapter
PacketStreamAdapter
#include <icy/packetstream.h>class PacketStreamAdapterDefined in src/base/include/icy/packetstream.h:42
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.
List of all members
| Name | Kind | Owner |
|---|---|---|
PacketStreamAdapter | function | Declared here |
~PacketStreamAdapter | function | Declared here |
emit | function | Declared here |
emit | function | Declared here |
emit | function | Declared here |
emit | function | Declared here |
emit | function | Declared here |
getEmitter | function | Declared here |
retention | function | Declared here |
onStreamStateChange | function | Declared here |
_emitter | variable | Declared here |
PacketStreamAdapter | function | Declared here |
operator= | function | Declared here |
PacketStreamAdapter | function | Declared here |
operator= | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. | |
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:47
Construct the adapter, binding it to the given packet signal.
Parameters
emitterThe outgoing packet signal owned by the subclass.
emit
virtual
virtual void emit(char * data, size_t len, unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:54
Emit a mutable raw buffer as a packet.
Parameters
dataPointer to the buffer (not copied; caller retains ownership).lenNumber of bytes in the buffer.flagsOptional 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:60
Emit a read-only raw buffer as a packet (data is copied internally).
Parameters
dataPointer to the buffer.lenNumber of bytes in the buffer.flagsOptional packet flags (see PacketFlags).
emit
virtual
virtual void emit(const std::string & str, unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:65
Emit a string as a packet (data is copied internally).
Parameters
strString payload.flagsOptional packet flags (see PacketFlags).
emit
virtual
virtual void emit(unsigned flags = 0)Defined in src/base/include/icy/packetstream.h:69
Emit a flag-only packet carrying no payload data.
Parameters
flagsPacket flags to embed in the emitted FlagPacket.
emit
virtual
virtual void emit(IPacket & packet)Defined in src/base/include/icy/packetstream.h:73
Emit an existing packet directly onto the outgoing signal.
Parameters
packetThe packet to forward; must remain valid for the duration of the call.
Reimplemented by
getEmitter
PacketSignal & getEmitter()Defined in src/base/include/icy/packetstream.h:76
Returns a reference to the outgoing packet signal.
retention
virtual const
virtual PacketRetention retention() constDefined in src/base/include/icy/packetstream.h:84
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
onStreamStateChange
virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Defined in src/base/include/icy/packetstream.h:91
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
onStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChangeonStreamStateChange
Protected Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal & | _emitter |
_emitter
PacketSignal & _emitterDefined in src/base/include/icy/packetstream.h:100
Protected Methods
| Return | Name | Description |
|---|---|---|
PacketStreamAdapter | NonCopyable and NonMovable. | |
PacketStreamAdapter | Deleted constructor. |
PacketStreamAdapter
PacketStreamAdapter(const PacketStreamAdapter &) = deleteDefined in src/base/include/icy/packetstream.h:95
NonCopyable and NonMovable.
PacketStreamAdapter
PacketStreamAdapter(PacketStreamAdapter &&) = deleteDefined in src/base/include/icy/packetstream.h:97
Deleted constructor.
