av

May 15, 2026 ยท View on GitHub

{#avmodule}

av

Audio/video encoding, decoding, device capture, and media formats.

Namespaces

NameDescription
v4l2Linux V4L2 device enumeration helpers.
coreaudioApple CoreAudio device enumeration helpers.
legacyLegacy timing helpers kept for compatibility with older media pipelines.
avfoundationApple AVFoundation device enumeration helpers.
mediafoundationWindows Media Foundation device enumeration helpers.
wasapiWindows WASAPI device enumeration helpers.

Classes

NameDescription
LinuxDeviceWatcherMonitors device add/remove events via libudev.
ICaptureAbstract interface for audio and video capture devices.
IEncoderThis is the abstract class for all encoders.
AppleDeviceWatcherMonitors device add/remove events via AVFoundation notifications and CoreAudio property listeners.
FPSCounterFPS counter based on the simple moving average (SMA) algorithm.
FPSLimiterPacketStream processor that caps packet throughput to a maximum FPS.
AudioCaptureCross-platform audio capture device backed by FFmpeg input devices.
MediaCaptureUnified capture and decode source for files and live media devices.
VideoCaptureCross-platform video device capturer backed by FFmpeg avdevice.
DeviceWatcherBase class for platform-specific device change monitors.
DeviceManagerEnumerates and manages system audio and video devices.
FormatRegistrySingleton registry of available media container formats for encoding and decoding.
WindowsDeviceWatcherMonitors device add/remove events via IMMNotificationClient (audio) and RegisterDeviceNotification (video).
MultiplexEncoderMultiplexing encoder that writes synchronized audio and video streams.
AudioPacketEncoderPacketProcessor that encodes raw audio samples (PlanarAudioPacket or AudioPacket) into compressed packets via AudioEncoder.
VideoPacketEncoderPacketProcessor that encodes raw video frames (PlanarVideoPacket or VideoPacket) into compressed packets via VideoEncoder.
RealtimePacketQueueQueue that emits media packets in presentation-timestamp order relative to a realtime clock.
MultiplexPacketEncoderEncodes and multiplexes a realtime video stream form audio / video capture sources. FFmpeg is used for encoding.
CodecCodec for encoding/decoding media.
AudioCodecAudio codec parameters including channels, sample rate, and sample format.
VideoCodecVideo codec parameters including resolution, frame rate, and pixel format.
DeleterRAII helpers for owning FFmpeg allocation types.
DeleterpDeleter adaptor for functions like av_freep that take a pointer to a pointer.
FormatDefines a media container format which is available through the FormatRegistry for encoding or decoding.
EncoderStateState machine states for the encoder pipeline.
EncoderOptionsConfiguration options for audio and video encoders.
AudioBufferFIFO buffer for queuing audio samples between encoding stages.
AudioContextBase context for audio encoding and decoding via FFmpeg.
AudioDecoderDecodes compressed audio packets into raw sample frames.
AudioEncoderEncodes raw audio samples into a compressed format.
VideoContextBase video context from which all video encoders and decoders derive.
VideoDecoderDecodes compressed video packets into raw frames.
VideoEncoderEncodes raw video frames into a compressed format.
DeviceRepresents a system audio, video or render device.
AudioResamplerConverts audio samples between different formats, sample rates, and channel layouts.
VideoConverterConverts video frames between pixel formats and resolutions.
MediaPacketTimestamped media packet carrying raw audio or video data.
VideoPacketVideo packet for interleaved formats.
PlanarVideoPacketVideo packet for planar formats.
AudioPacketAudio packet for interleaved formats.
PlanarAudioPacketAudio packet for planar formats.

Macros

NameDescription
MAX_AUDIO_PACKET_SIZE1 second of 48khz 32bit audio
MAX_ENCODE_DURATION3 hours

{#max_audio_packet_size}

MAX_AUDIO_PACKET_SIZE

MAX_AUDIO_PACKET_SIZE()

1 second of 48khz 32bit audio


{#max_encode_duration}

MAX_ENCODE_DURATION

MAX_ENCODE_DURATION()

3 hours

Enumerations

NameDescription
MediaCapabilitiesBitmask of media capabilities detected on this system.

{#mediacapabilities}

MediaCapabilities

enum MediaCapabilities

Bitmask of media capabilities detected on this system.

ValueDescription
AUDIO_RECVAudio capture or decode is available.
AUDIO_SENDAudio playback or encode is available.
VIDEO_RECVVideo capture or decode is available.
VIDEO_SENDVideo render or encode is available.

Typedefs

ReturnNameDescription
std::list< Codec >CodecListList of codec value objects.
std::list< Codec * >CodecPListList of codec pointers.
std::unique_ptr< AVFrame, Deleterp< AVFrame, void, av_frame_free > >AVFrameHolderOwning AVFrame pointer released with av_frame_free().
std::unique_ptr< AVFormatContext, Deleter< AVFormatContext, void, avformat_free_context > >AVFormatContextHolderOwning AVFormatContext pointer released with avformat_free_context().
std::unique_ptr< AVCodecContext, Deleterp< AVCodecContext, void, avcodec_free_context > >AVCodecContextHolderOwning AVCodecContext pointer released with avcodec_free_context().
std::unique_ptr< AVDictionary *, Deleter< AVDictionary *, void, av_dict_free > >AVDictionaryCleanupCleanup wrapper for AVDictionary* values freed with av_dict_free().
std::unique_ptr< AVPacket, Deleterp< AVPacket, void, av_packet_free > >AVPacketHolderOwning AVPacket pointer released with av_packet_free().
std::vector< Format >FormatListList of container format value objects.
std::vector< Format * >FormatPListList of container format pointers.
IEncoderIPacketEncoderLegacy alias for IEncoder kept for 0.8.x compatibility.

{#codeclist}

CodecList

using CodecList = std::list< Codec >

List of codec value objects.


{#codecplist}

CodecPList

using CodecPList = std::list< Codec * >

List of codec pointers.


{#avframeholder}

AVFrameHolder

using AVFrameHolder = std::unique_ptr< AVFrame, Deleterp< AVFrame, void, av_frame_free > >

Owning AVFrame pointer released with av_frame_free().


{#avformatcontextholder}

AVFormatContextHolder

using AVFormatContextHolder = std::unique_ptr< AVFormatContext, Deleter< AVFormatContext, void, avformat_free_context > >

Owning AVFormatContext pointer released with avformat_free_context().


{#avcodeccontextholder}

AVCodecContextHolder

using AVCodecContextHolder = std::unique_ptr< AVCodecContext, Deleterp< AVCodecContext, void, avcodec_free_context > >

Owning AVCodecContext pointer released with avcodec_free_context().


{#avdictionarycleanup}

AVDictionaryCleanup

using AVDictionaryCleanup = std::unique_ptr< AVDictionary *, Deleter< AVDictionary *, void, av_dict_free > >

Cleanup wrapper for AVDictionary* values freed with av_dict_free().


{#avpacketholder}

AVPacketHolder

using AVPacketHolder = std::unique_ptr< AVPacket, Deleterp< AVPacket, void, av_packet_free > >

Owning AVPacket pointer released with av_packet_free().


{#formatlist}

FormatList

using FormatList = std::vector< Format >

List of container format value objects.


{#formatplist}

FormatPList

using FormatPList = std::vector< Format * >

List of container format pointers.


{#ipacketencoder}

IPacketEncoder

using IPacketEncoder = IEncoder

Legacy alias for IEncoder kept for 0.8.x compatibility.

Functions

ReturnNameDescription
int64_tfpsToInterval inlineConvert a frame rate to a nanosecond frame interval.
intintervalToFps inlineConvert a nanosecond frame interval to a frame rate.
floatintervalToFpsFloat inlineConvert a nanosecond frame interval to a floating-point frame rate.
voidinitializeFFmpegInitialize the FFmpeg library.
voiduninitializeFFmpegUninitializes the FFmpeg library.
std::stringaverrorGet an error string for the given error code.
voidprintInputFormatsPrint all available FFmpeg demuxer (input) format names to the given stream.
voidprintOutputFormatsPrint all available FFmpeg muxer (output) format names to the given stream.
voidprintEncodersPrint all available FFmpeg encoder names to the given stream.
AVPacketHoldermakeOwnedPacketAllocate an owning AVPacket with FFmpeg-required padding and timestamp metadata. The packet payload is copied into FFmpeg-managed storage, which is required by decoders such as H.264 that may overread AV_INPUT_BUFFER_PADDING_SIZE bytes.
voidinitAudioCodecFromContextPopulate an AudioCodec from an open AVCodecContext.
AVSampleFormatselectSampleFormatSelect the best supported sample format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same planarity.
boolisSampleFormatSupportedCheck whether a specific sample format is in the codec's supported list.
boolformatIsPlanarReturn true if the named sample format is planar (e.g. "fltp", "s16p").
boolformatIsPlanarReturn true if the given AVSampleFormat is planar.
AVFrame *createVideoFrameAllocate a new AVFrame with the given pixel format and dimensions. Uses av_frame_get_buffer for reference-counted allocation with 16-byte alignment.
AVFrame *cloneVideoFramePerform a deep copy of an AVFrame including its buffer data and properties.
voidinitVideoCodecFromContextPopulate a VideoCodec from an open AVStream and AVCodecContext.
AVPixelFormatselectPixelFormatSelect the best supported pixel format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same plane count.
std::optional< std::pair< const AVInputFormat *, std::string > >parseDeviceUrlParse a libavdevice URL scheme.

{#fpstointerval}

fpsToInterval

inline

inline int64_t fpsToInterval(int fps)

Convert a frame rate to a nanosecond frame interval.

Parameters

  • fps The frame rate in frames per second.

Returns

The interval in nanoseconds between frames, or the minimum interval if fps is zero.


{#intervaltofps}

intervalToFps

inline

inline int intervalToFps(int64_t interval)

Convert a nanosecond frame interval to a frame rate.

Parameters

  • interval The nanosecond interval between frames.

Returns

The frame rate in frames per second, or zero if interval is zero.


{#intervaltofpsfloat}

intervalToFpsFloat

inline

inline float intervalToFpsFloat(int64_t interval)

Convert a nanosecond frame interval to a floating-point frame rate.

Parameters

  • interval The nanosecond interval between frames.

Returns

The frame rate in frames per second as a float, or 0.0f if interval is zero.


{#initializeffmpeg}

initializeFFmpeg

void initializeFFmpeg()

Initialize the FFmpeg library.


{#uninitializeffmpeg}

uninitializeFFmpeg

void uninitializeFFmpeg()

Uninitializes the FFmpeg library.


{#averror}

averror

std::string averror(const int error)

Get an error string for the given error code.


{#printinputformats}

printInputFormats

void printInputFormats(std::ostream & ost, const char * delim = " ")

Print all available FFmpeg demuxer (input) format names to the given stream.

Parameters

  • ost The output stream to write to.

  • delim Delimiter inserted between each name.


{#printoutputformats}

printOutputFormats

void printOutputFormats(std::ostream & ost, const char * delim = " ")

Print all available FFmpeg muxer (output) format names to the given stream.

Parameters

  • ost The output stream to write to.

  • delim Delimiter inserted between each name.


{#printencoders}

printEncoders

void printEncoders(std::ostream & ost, const char * delim = " ")

Print all available FFmpeg encoder names to the given stream.

Parameters

  • ost The output stream to write to.

  • delim Delimiter inserted between each name.


{#makeownedpacket}

makeOwnedPacket

AVPacketHolder makeOwnedPacket(const MediaPacket & packet, int streamIndex, AVRational timeBase)

Allocate an owning AVPacket with FFmpeg-required padding and timestamp metadata. The packet payload is copied into FFmpeg-managed storage, which is required by decoders such as H.264 that may overread AV_INPUT_BUFFER_PADDING_SIZE bytes.


{#initaudiocodecfromcontext}

initAudioCodecFromContext

void initAudioCodecFromContext(const AVCodecContext * ctx, AudioCodec & params)

Populate an AudioCodec from an open AVCodecContext.

Parameters

  • ctx The FFmpeg codec context to read from.

  • params The AudioCodec struct to fill with codec, channel, sample rate, and format info.


{#selectsampleformat}

selectSampleFormat

AVSampleFormat selectSampleFormat(const AVCodec * codec, av::AudioCodec & params)

Select the best supported sample format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same planarity.

Parameters

  • codec The FFmpeg codec whose supported formats are queried.

  • params The audio codec parameters specifying the desired sample format.

Returns

The chosen AVSampleFormat, or AV_SAMPLE_FMT_NONE if none is compatible.


{#issampleformatsupported}

isSampleFormatSupported

bool isSampleFormatSupported(const AVCodec * codec, enum AVSampleFormat sampleFormat)

Check whether a specific sample format is in the codec's supported list.

Parameters

  • codec The FFmpeg codec to query.

  • sampleFormat The AVSampleFormat to look up.

Returns

True if the format is supported.


{#formatisplanar}

formatIsPlanar

bool formatIsPlanar(const std::string & pixfmt)

Return true if the named sample format is planar (e.g. "fltp", "s16p").

Parameters

  • pixfmt The sample format name string.

{#formatisplanar-1}

formatIsPlanar

bool formatIsPlanar(AVSampleFormat format)

Return true if the given AVSampleFormat is planar.

Parameters

  • format The AVSampleFormat to check.

{#createvideoframe}

createVideoFrame

AVFrame * createVideoFrame(AVPixelFormat pixelFmt, int width, int height)

Allocate a new AVFrame with the given pixel format and dimensions. Uses av_frame_get_buffer for reference-counted allocation with 16-byte alignment.

Parameters

  • pixelFmt The pixel format for the frame.

  • width The frame width in pixels.

  • height The frame height in pixels.

Returns

A newly allocated AVFrame, or nullptr on failure.


{#clonevideoframe}

cloneVideoFrame

AVFrame * cloneVideoFrame(AVFrame * source)

Perform a deep copy of an AVFrame including its buffer data and properties.

Parameters

  • source The source frame to copy.

Returns

A newly allocated AVFrame with copied data. Caller owns the result.


{#initvideocodecfromcontext}

initVideoCodecFromContext

void initVideoCodecFromContext(const AVStream * stream, const AVCodecContext * ctx, VideoCodec & params)

Populate a VideoCodec from an open AVStream and AVCodecContext.

Parameters

  • stream The AVStream for frame rate information (may be null).

  • ctx The FFmpeg codec context to read from.

  • params The VideoCodec struct to fill with codec, dimension, and format info.


{#selectpixelformat}

selectPixelFormat

AVPixelFormat selectPixelFormat(const AVCodec * codec, VideoCodec & params)

Select the best supported pixel format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same plane count.

Parameters

  • codec The FFmpeg codec whose supported formats are queried.

  • params The video codec parameters specifying the desired pixel format.

Returns

The chosen AVPixelFormat.


{#parsedeviceurl}

parseDeviceUrl

std::optional< std::pair< const AVInputFormat *, std::string > > parseDeviceUrl(std::string_view source)

Parse a libavdevice URL scheme.

Recognises: avfoundation: (macOS, e.g. "0:0", "0:none") v4l2: (Linux, e.g. "/dev/video0") dshow: (Windows, e.g. "video=Logitech HD WebCam")

On match returns the libavformat input format (looked up via av_find_input_format) and the portion of source after the scheme prefix. Returns std::nullopt for non-device sources (file paths, rtsp://, rtmp://, etc.), leaving the caller to use FFmpeg's auto-detection.

Throws std::runtime_error if a recognised scheme has no matching input format on this build (libavdevice not linked, or the backend is not compiled in on this platform).

{#v4l2}

v4l2

Linux V4L2 device enumeration helpers.

Functions

ReturnNameDescription
boolgetDeviceListEnumerate video input devices using V4L2. Populates device capabilities (resolutions, frame rates, pixel formats).

{#getdevicelist}

getDeviceList

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices)

Enumerate video input devices using V4L2. Populates device capabilities (resolutions, frame rates, pixel formats).

Parameters

Returns

True if enumeration succeeded.

{#coreaudio}

coreaudio

Apple CoreAudio device enumeration helpers.

Functions

ReturnNameDescription
boolgetDeviceListEnumerate audio input and output devices using CoreAudio. Populates audio capabilities (sample rates, channels).

{#getdevicelist-1}

getDeviceList

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices)

Enumerate audio input and output devices using CoreAudio. Populates audio capabilities (sample rates, channels).

Parameters

  • type The device type to enumerate (AudioInput or AudioOutput).

  • devices Output vector to fill with discovered devices.

Returns

True if enumeration succeeded.

{#legacy}

legacy

Legacy timing helpers kept for compatibility with older media pipelines.

Classes

NameDescription
FPSCounterLegacy frames-per-second counter.

{#fpscounter}

FPSCounter

#include <icy/av/fpscounter.h>
struct FPSCounter

Defined in src/av/include/icy/av/fpscounter.h:86

Legacy frames-per-second counter.

List of all members

NameKindOwner
startvariableDeclared here
endvariableDeclared here
framesvariableDeclared here
totalvariableDeclared here
fpsvariableDeclared here
FPSCounterfunctionDeclared here
tickfunctionDeclared here
resetfunctionDeclared here
startedfunctionDeclared here
startFramefunctionDeclared here
endFramefunctionDeclared here

Public Attributes

ReturnNameDescription
clock_tstart
clock_tend
int64_tframes
doubletotal
doublefps

{#start-3}

start

clock_t start

Defined in src/av/include/icy/av/fpscounter.h:88


{#end}

end

clock_t end

Defined in src/av/include/icy/av/fpscounter.h:89


{#frames}

frames

int64_t frames

Defined in src/av/include/icy/av/fpscounter.h:90


{#total}

total

double total

Defined in src/av/include/icy/av/fpscounter.h:91


{#fps-1}

fps

double fps

Defined in src/av/include/icy/av/fpscounter.h:92

Public Methods

ReturnNameDescription
FPSCounter inline
voidtick inlineBegin a new timing cycle (calls endFrame() first if already started).
voidreset inlineReset all counters to zero.
boolstarted inline
voidstartFrame inlineRecord the frame start time.
doubleendFrame inlineRecord the frame end time and update the cumulative FPS average.

{#fpscounter-1}

FPSCounter

inline

inline FPSCounter()

Defined in src/av/include/icy/av/fpscounter.h:94


{#tick}

tick

inline

inline void tick()

Defined in src/av/include/icy/av/fpscounter.h:100

Begin a new timing cycle (calls endFrame() first if already started).


{#reset}

reset

inline

inline void reset()

Defined in src/av/include/icy/av/fpscounter.h:108

Reset all counters to zero.


{#started}

started

inline

inline bool started()

Defined in src/av/include/icy/av/fpscounter.h:118

Returns

True if startFrame() has been called and the timer is running.


{#startframe}

startFrame

inline

inline void startFrame()

Defined in src/av/include/icy/av/fpscounter.h:124

Record the frame start time.


{#endframe}

endFrame

inline

inline double endFrame()

Defined in src/av/include/icy/av/fpscounter.h:131

Record the frame end time and update the cumulative FPS average.

Returns

The updated FPS value.

{#avfoundation}

avfoundation

Apple AVFoundation device enumeration helpers.

Functions

ReturnNameDescription
boolgetDeviceListEnumerate video input devices using AVFoundation. Populates device capabilities (resolutions, frame rates, pixel formats).

{#getdevicelist-2}

getDeviceList

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices)

Enumerate video input devices using AVFoundation. Populates device capabilities (resolutions, frame rates, pixel formats).

Parameters

Returns

True if enumeration succeeded.

{#mediafoundation}

mediafoundation

Windows Media Foundation device enumeration helpers.

Functions

ReturnNameDescription
boolgetDeviceListEnumerate video and audio input devices using Media Foundation. Populates device capabilities (resolutions, frame rates, pixel formats).

{#getdevicelist-4}

getDeviceList

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices)

Enumerate video and audio input devices using Media Foundation. Populates device capabilities (resolutions, frame rates, pixel formats).

Parameters

  • type The device type to enumerate (VideoInput or AudioInput).

  • devices Output vector to fill with discovered devices.

Returns

True if enumeration succeeded.

{#wasapi}

wasapi

Windows WASAPI device enumeration helpers.

Functions

ReturnNameDescription
boolgetDeviceListEnumerate audio input and output devices using WASAPI. Populates audio capabilities (sample rates, channels, formats).

{#getdevicelist-5}

getDeviceList

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices)

Enumerate audio input and output devices using WASAPI. Populates audio capabilities (sample rates, channels, formats).

Parameters

  • type The device type to enumerate (AudioInput or AudioOutput).

  • devices Output vector to fill with discovered devices.

Returns

True if enumeration succeeded.

{#linuxdevicewatcher}

LinuxDeviceWatcher

#include <icy/av/linux/v4l2.h>
class LinuxDeviceWatcher

Defined in src/av/include/icy/av/linux/v4l2.h:45

Inherits: DeviceWatcher

Monitors device add/remove events via libudev.

List of all members

NameKindOwner
LinuxDeviceWatcherfunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here
_implvariableDeclared here
_managervariableDeclared here
DeviceWatcherfunctionInherited from DeviceWatcher
startfunctionInherited from DeviceWatcher
stopfunctionInherited from DeviceWatcher

Inherited from DeviceWatcher

KindNameDescription
functionDeviceWatcher inline explicit
functionstart virtual inline
functionstop virtual inline

Public Methods

ReturnNameDescription
LinuxDeviceWatcher explicit
boolstart virtual overrideBegin monitoring via libudev inotify events.
voidstop virtual overrideStop monitoring and close the udev monitor.

{#linuxdevicewatcher-1}

LinuxDeviceWatcher

explicit

explicit LinuxDeviceWatcher(DeviceManager * manager)

Defined in src/av/include/icy/av/linux/v4l2.h:49

Parameters

  • manager The DeviceManager whose DevicesChanged signal will be emitted on changes.

{#start}

start

virtual override

virtual bool start() override

Defined in src/av/include/icy/av/linux/v4l2.h:54

Begin monitoring via libudev inotify events.

Returns

True if the udev monitor was successfully started.

Reimplements

{#stop}

stop

virtual override

virtual void stop() override

Defined in src/av/include/icy/av/linux/v4l2.h:57

Stop monitoring and close the udev monitor.

Reimplements

Private Attributes

ReturnNameDescription
std::unique_ptr< Impl >_impl
DeviceManager *_manager

{#_impl}

_impl

std::unique_ptr< Impl > _impl

Defined in src/av/include/icy/av/linux/v4l2.h:62


{#_manager}

_manager

DeviceManager * _manager

Defined in src/av/include/icy/av/linux/v4l2.h:63

{#icapture}

ICapture

#include <icy/av/icapture.h>
class ICapture

Defined in src/av/include/icy/av/icapture.h:31

Inherits: PacketStreamAdapter, Startable Subclassed by: MediaCapture

Abstract interface for audio and video capture devices.

List of all members

NameKindOwner
emittervariableDeclared here
ICapturefunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here
openFilefunctionDeclared here
closefunctionDeclared here
getEncoderFormatfunctionDeclared here
getEncoderAudioCodecfunctionDeclared here
getEncoderVideoCodecfunctionDeclared here
openAudiofunctionDeclared here
openVideofunctionDeclared here
onStreamStateChangefunctionDeclared here
openStreamfunctionDeclared here
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
startfunctionInherited from Startable
stopfunctionInherited from Startable

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Inherited from Startable

KindNameDescription
functionstart virtualStarts the object (e.g. begins processing or listening).
functionstop virtualStops the object (e.g. halts processing or closes resources).

Public Attributes

ReturnNameDescription
PacketSignalemitter

{#emitter}

emitter

PacketSignal emitter

Defined in src/av/include/icy/av/icapture.h:89

Public Methods

ReturnNameDescription
ICapture inline
voidstart virtual overrideStart capturing and emitting packets.
voidstop virtual overrideStop capturing and release device resources.
voidopenFile virtual inlineOpen a media file as the capture source.
voidclose virtual inlineRelease the capture source and any associated resources.
voidgetEncoderFormat virtualPopulate iformat with the encoder-ready format derived from this capture source.
voidgetEncoderAudioCodec virtual inlinePopulate params with the encoder-ready audio codec parameters.
voidgetEncoderVideoCodec virtual inlinePopulate params with the encoder-ready video codec parameters.
voidopenAudio virtual inlineOpen an audio capture device with the given parameters.
voidopenVideo virtual inlineOpen a video capture device with the given parameters.
voidonStreamStateChange virtual inline overrideReact to PacketStream state transitions by starting or stopping capture.

{#icapture-1}

ICapture

inline

inline ICapture()

Defined in src/av/include/icy/av/icapture.h:35


{#start-1}

start

virtual override

virtual void start() override

Defined in src/av/include/icy/av/icapture.h:42

Start capturing and emitting packets.

Reimplements
Reimplemented by

{#stop-1}

stop

virtual override

virtual void stop() override

Defined in src/av/include/icy/av/icapture.h:45

Stop capturing and release device resources.

Reimplements
Reimplemented by

{#openfile}

openFile

virtual inline

virtual inline void openFile(const std::string & file)

Defined in src/av/include/icy/av/icapture.h:49

Open a media file as the capture source.

Parameters

  • file Path to the media file.
Reimplemented by

{#close}

close

virtual inline

virtual inline void close()

Defined in src/av/include/icy/av/icapture.h:52

Release the capture source and any associated resources.

Reimplemented by

{#getencoderformat}

getEncoderFormat

virtual

virtual void getEncoderFormat(Format & iformat)

Defined in src/av/include/icy/av/icapture.h:56

Populate iformat with the encoder-ready format derived from this capture source.

Parameters

  • iformat Output Format struct to fill.
Reimplemented by

{#getencoderaudiocodec}

getEncoderAudioCodec

virtual inline

virtual inline void getEncoderAudioCodec(AudioCodec & params)

Defined in src/av/include/icy/av/icapture.h:60

Populate params with the encoder-ready audio codec parameters.

Parameters

Reimplemented by

{#getencodervideocodec}

getEncoderVideoCodec

virtual inline

virtual inline void getEncoderVideoCodec(VideoCodec & params)

Defined in src/av/include/icy/av/icapture.h:64

Populate params with the encoder-ready video codec parameters.

Parameters

Reimplemented by

{#openaudio}

openAudio

virtual inline

virtual inline void openAudio(const std::string & device, const AudioCodec & params)

Defined in src/av/include/icy/av/icapture.h:69

Open an audio capture device with the given parameters.

Parameters

  • device The platform audio device identifier.

  • params The desired capture parameters.

Reimplemented by

{#openvideo}

openVideo

virtual inline

virtual inline void openVideo(const std::string & device, const VideoCodec & params)

Defined in src/av/include/icy/av/icapture.h:74

Open a video capture device with the given parameters.

Parameters

  • device The platform video device identifier.

  • params The desired capture parameters.

Reimplemented by

{#onstreamstatechange}

onStreamStateChange

virtual inline override

virtual inline void onStreamStateChange(const PacketStreamState & state) override

Defined in src/av/include/icy/av/icapture.h:77

React to PacketStream state transitions by starting or stopping capture.

Reimplements

Protected Methods

ReturnNameDescription
voidopenStream virtual inline

{#openstream}

openStream

virtual inline

virtual inline void openStream(const std::string & filename, const AVInputFormat * inputFormat, AVDictionary ** formatParams)

Defined in src/av/include/icy/av/icapture.h:92

Reimplemented by

{#iencoder}

IEncoder

#include <icy/av/iencoder.h>
class IEncoder

Defined in src/av/include/icy/av/iencoder.h:81

Inherits: Stateful< EncoderState > Subclassed by: MultiplexEncoder

This is the abstract class for all encoders.

List of all members

NameKindOwner
initfunctionDeclared here
uninitfunctionDeclared here
cleanupfunctionDeclared here
optionsfunctionDeclared here
createVideofunctionDeclared here
freeVideofunctionDeclared here
encodeVideofunctionDeclared here
createAudiofunctionDeclared here
freeAudiofunctionDeclared here
flushfunctionDeclared here
isNonefunctionDeclared here
isReadyfunctionDeclared here
isEncodingfunctionDeclared here
isActivefunctionDeclared here
isStoppedfunctionDeclared here
isErrorfunctionDeclared here
TypeenumDeclared here
StateChangevariableInherited from Stateful
_statevariableInherited from Stateful
StatefulfunctionInherited from Stateful
~StatefulfunctionInherited from Stateful
stateEqualsfunctionInherited from Stateful
stateBetweenfunctionInherited from Stateful
statefunctionInherited from Stateful
statefunctionInherited from Stateful
beforeStateChangefunctionInherited from Stateful
onStateChangefunctionInherited from Stateful
setStatefunctionInherited from Stateful
setStatefunctionInherited from Stateful

Inherited from Stateful

KindNameDescription
variableStateChangeSignals when the state changes.
variable_state
functionStateful inline
function~Stateful virtual inline
functionstateEquals virtual const inlineReturns true if the current state ID equals the given ID.
functionstateBetween virtual const inlineReturns true if the current state ID is in the inclusive range [lid, rid].
functionstate virtual inlineReturns a mutable reference to the current state.
functionstate virtual const inlineReturns a copy of the current state.
functionbeforeStateChange virtual inlineOverride to handle pre state change logic. Return false to prevent state change.
functiononStateChange virtual inlineOverride to handle post state change logic.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.

Public Methods

ReturnNameDescription
voidinit virtualInitialise the encoder, open codec contexts, and transition to Ready or Encoding state.
voiduninit virtualFlush remaining packets, close codec contexts, and release all encoder resources.
voidcleanup virtual inlinePerform any additional cleanup after uninit(). Default is a no-op.
const EncoderOptions &options virtual const nodiscard
voidcreateVideo virtual inlineInitialise the video codec context and stream.
voidfreeVideo virtual inlineFree the video codec context and stream.
boolencodeVideo virtual inline nodiscardEncode a single AVFrame of video.
voidcreateAudio virtual inlineInitialise the audio codec context and stream.
voidfreeAudio virtual inlineFree the audio codec context and stream.
voidflush virtual inlineFlush any internally buffered packets to the output.
boolisNone const inline
boolisReady const inline
boolisEncoding virtual const inline
boolisActive virtual const inline
boolisStopped virtual const inline
boolisError virtual const inline

{#init}

init

virtual

virtual void init()

Defined in src/av/include/icy/av/iencoder.h:93

Initialise the encoder, open codec contexts, and transition to Ready or Encoding state.

Reimplemented by

{#uninit}

uninit

virtual

virtual void uninit()

Defined in src/av/include/icy/av/iencoder.h:96

Flush remaining packets, close codec contexts, and release all encoder resources.

Reimplemented by

{#cleanup}

cleanup

virtual inline

virtual inline void cleanup()

Defined in src/av/include/icy/av/iencoder.h:99

Perform any additional cleanup after uninit(). Default is a no-op.

Reimplemented by

{#options-1}

options

virtual const nodiscard

[[nodiscard]] virtual const EncoderOptions & options() const

Defined in src/av/include/icy/av/iencoder.h:102

Returns

A read-only view of the encoder's configuration options.

Reimplemented by

{#createvideo}

createVideo

virtual inline

virtual inline void createVideo()

Defined in src/av/include/icy/av/iencoder.h:105

Initialise the video codec context and stream.

Reimplemented by

{#freevideo}

freeVideo

virtual inline

virtual inline void freeVideo()

Defined in src/av/include/icy/av/iencoder.h:108

Free the video codec context and stream.

Reimplemented by

{#encodevideo}

encodeVideo

virtual inline nodiscard

[[nodiscard]] virtual inline bool encodeVideo(AVFrame * frame)

Defined in src/av/include/icy/av/iencoder.h:113

Encode a single AVFrame of video.

Parameters

  • frame The source video frame; all fields (format, width, height, pts) must be set.

Returns

True if a packet was successfully encoded and written.

Reimplemented by

{#createaudio}

createAudio

virtual inline

virtual inline void createAudio()

Defined in src/av/include/icy/av/iencoder.h:116

Initialise the audio codec context and stream.

Reimplemented by

{#freeaudio}

freeAudio

virtual inline

virtual inline void freeAudio()

Defined in src/av/include/icy/av/iencoder.h:119

Free the audio codec context and stream.

Reimplemented by

{#flush}

flush

virtual inline

virtual inline void flush()

Defined in src/av/include/icy/av/iencoder.h:122

Flush any internally buffered packets to the output.

Reimplemented by

{#isnone}

isNone

const inline

inline bool isNone() const

Defined in src/av/include/icy/av/iencoder.h:125

Returns

True if the encoder is in the None state.


{#isready}

isReady

const inline

inline bool isReady() const

Defined in src/av/include/icy/av/iencoder.h:128

Returns

True if the encoder is ready but not yet encoding.


{#isencoding}

isEncoding

virtual const inline

virtual inline bool isEncoding() const

Defined in src/av/include/icy/av/iencoder.h:131

Returns

True if the encoder is actively encoding.


{#isactive}

isActive

virtual const inline

virtual inline bool isActive() const

Defined in src/av/include/icy/av/iencoder.h:134

Returns

True if the encoder is in the Ready or Encoding state.


{#isstopped}

isStopped

virtual const inline

virtual inline bool isStopped() const

Defined in src/av/include/icy/av/iencoder.h:137

Returns

True if the encoder has stopped.


{#iserror}

isError

virtual const inline

virtual inline bool isError() const

Defined in src/av/include/icy/av/iencoder.h:140

Returns

True if the encoder is in an error state.

Public Types

NameDescription
Type

{#type-3}

Type

enum Type

Defined in src/av/include/icy/av/iencoder.h:84

ValueDescription
Nonehuh?
Videovideo only
Audioaudio only
Multiplexboth video & audio

{#appledevicewatcher}

AppleDeviceWatcher

#include <icy/av/apple/coreaudio.h>
class AppleDeviceWatcher

Defined in src/av/include/icy/av/apple/coreaudio.h:46

Inherits: DeviceWatcher

Monitors device add/remove events via AVFoundation notifications and CoreAudio property listeners.

List of all members

NameKindOwner
AppleDeviceWatcherfunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here
_implvariableDeclared here
_managervariableDeclared here
DeviceWatcherfunctionInherited from DeviceWatcher
startfunctionInherited from DeviceWatcher
stopfunctionInherited from DeviceWatcher

Inherited from DeviceWatcher

KindNameDescription
functionDeviceWatcher inline explicit
functionstart virtual inline
functionstop virtual inline

Public Methods

ReturnNameDescription
AppleDeviceWatcher explicit
boolstart virtual overrideBegin monitoring for device connect/disconnect events.
voidstop virtual overrideStop monitoring and release all notification observers.

{#appledevicewatcher-1}

AppleDeviceWatcher

explicit

explicit AppleDeviceWatcher(DeviceManager * manager)

Defined in src/av/include/icy/av/apple/coreaudio.h:50

Parameters

  • manager The DeviceManager whose DevicesChanged signal will be emitted on changes.

{#start-2}

start

virtual override

virtual bool start() override

Defined in src/av/include/icy/av/apple/coreaudio.h:55

Begin monitoring for device connect/disconnect events.

Returns

True if monitoring was successfully started.

Reimplements

{#stop-2}

stop

virtual override

virtual void stop() override

Defined in src/av/include/icy/av/apple/coreaudio.h:58

Stop monitoring and release all notification observers.

Reimplements

Private Attributes

ReturnNameDescription
std::unique_ptr< Impl >_impl
DeviceManager *_manager

{#_impl-1}

_impl

std::unique_ptr< Impl > _impl

Defined in src/av/include/icy/av/apple/coreaudio.h:63


{#_manager-1}

_manager

DeviceManager * _manager

Defined in src/av/include/icy/av/apple/coreaudio.h:64

{#fpscounter-2}

FPSCounter

#include <icy/av/fpscounter.h>
class FPSCounter

Defined in src/av/include/icy/av/fpscounter.h:27

FPS counter based on the simple moving average (SMA) algorithm.

List of all members

NameKindOwner
fpsvariableDeclared here
framesvariableDeclared here
FPSCounterfunctionDeclared here
resetfunctionDeclared here
tickfunctionDeclared here
tickIndexvariableDeclared here
prevTickvariableDeclared here
tickSumvariableDeclared here
tickListvariableDeclared here
updateAvgfunctionDeclared here
MAXvariableDeclared here

Public Attributes

ReturnNameDescription
doublefps
int64_tframes

{#fps-2}

fps

double fps

Defined in src/av/include/icy/av/fpscounter.h:48


{#frames-1}

frames

int64_t frames

Defined in src/av/include/icy/av/fpscounter.h:49

Public Methods

ReturnNameDescription
FPSCounter inlineInitialise the counter with all zeroes.
voidreset inlineReset all counters and the SMA window to zero.
voidtick inlineRecord a new frame and update the FPS estimate. Must be called once per frame. Updates [fps](#fps-2) and increments [frames](#frames-1).

{#fpscounter-3}

FPSCounter

inline

inline FPSCounter()

Defined in src/av/include/icy/av/fpscounter.h:52

Initialise the counter with all zeroes.


{#reset-1}

reset

inline

inline void reset()

Defined in src/av/include/icy/av/fpscounter.h:55

Reset all counters and the SMA window to zero.


{#tick-1}

tick

inline

inline void tick()

Defined in src/av/include/icy/av/fpscounter.h:68

Record a new frame and update the FPS estimate. Must be called once per frame. Updates [fps](#fps-2) and increments [frames](#frames-1).

Private Attributes

ReturnNameDescription
inttickIndex
clock_tprevTick
clock_ttickSum
clock_ttickList

{#tickindex}

tickIndex

int tickIndex

Defined in src/av/include/icy/av/fpscounter.h:32


{#prevtick}

prevTick

clock_t prevTick

Defined in src/av/include/icy/av/fpscounter.h:33


{#ticksum}

tickSum

clock_t tickSum

Defined in src/av/include/icy/av/fpscounter.h:34


{#ticklist}

tickList

clock_t tickList

Defined in src/av/include/icy/av/fpscounter.h:35

Private Methods

ReturnNameDescription
doubleupdateAvg inline

{#updateavg}

updateAvg

inline

inline double updateAvg(clock_t newTick)

Defined in src/av/include/icy/av/fpscounter.h:37

Private Static Attributes

ReturnNameDescription
const intMAX static

{#max}

MAX

static

const int MAX = 100

Defined in src/av/include/icy/av/fpscounter.h:30

{#fpslimiter}

FPSLimiter

#include <icy/av/fpscounter.h>
class FPSLimiter

Defined in src/av/include/icy/av/fpscounter.h:152

Inherits: PacketProcessor

PacketStream processor that caps packet throughput to a maximum FPS.

If the observed frame rate exceeds the configured FPS budget, packets are dropped until the rate falls back under the limit.

Note that previous processors must not fragment packets, otherwise this class will not be accurate, and the packet drop rate will be too high.

List of all members

NameKindOwner
emittervariableDeclared here
FPSLimiterfunctionDeclared here
processfunctionDeclared here
onStreamStateChangefunctionDeclared here
_maxvariableDeclared here
_videoOnlyvariableDeclared here
_countervariableDeclared here
PacketProcessorfunctionInherited from PacketProcessor
processfunctionInherited from PacketProcessor
acceptsfunctionInherited from PacketProcessor
operator<<functionInherited from PacketProcessor
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter

Inherited from PacketProcessor

KindNameDescription
functionPacketProcessor inline
functionprocess virtualThis method performs processing on the given packet and emits the result.
functionaccepts virtual inlineThis method ensures compatibility with the given packet type. Return false to reject the packet.
functionoperator<< virtual inlineStream operator alias for process().

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Public Attributes

ReturnNameDescription
PacketSignalemitter

{#emitter-1}

emitter

PacketSignal emitter

Defined in src/av/include/icy/av/fpscounter.h:192

Public Methods

ReturnNameDescription
FPSLimiter inlineConstruct the limiter.
voidprocess virtual inlineProcess a packet: forward it if within the rate limit, drop it otherwise.
voidonStreamStateChange virtual inlineReset the FPS counter when the stream state changes.

{#fpslimiter-1}

FPSLimiter

inline

inline FPSLimiter(int max, bool videoOnly = false)

Defined in src/av/include/icy/av/fpscounter.h:158

Construct the limiter.

Parameters

  • max The maximum allowed frame rate in frames per second.

  • videoOnly If true, non-VideoPacket packets are always forwarded regardless of rate.


{#process-1}

process

virtual inline

virtual inline void process(IPacket & packet)

Defined in src/av/include/icy/av/fpscounter.h:167

Process a packet: forward it if within the rate limit, drop it otherwise.

Parameters

  • packet The incoming packet to evaluate.
Reimplements

{#onstreamstatechange-1}

onStreamStateChange

virtual inline

virtual inline void onStreamStateChange(const PacketStreamState &)

Defined in src/av/include/icy/av/fpscounter.h:187

Reset the FPS counter when the stream state changes.

Reimplements

Protected Attributes

ReturnNameDescription
int_max
bool_videoOnly
legacy::FPSCounter_counter

{#_max}

_max

int _max

Defined in src/av/include/icy/av/fpscounter.h:195


{#_videoonly}

_videoOnly

bool _videoOnly

Defined in src/av/include/icy/av/fpscounter.h:196


{#_counter}

_counter

legacy::FPSCounter _counter

Defined in src/av/include/icy/av/fpscounter.h:197

{#audiocapture}

AudioCapture

#include <icy/av/audiocapture.h>
class AudioCapture

Defined in src/av/include/icy/av/audiocapture.h:26

Inherits: MediaCapture

Cross-platform audio capture device backed by FFmpeg input devices.

List of all members

NameKindOwner
AudioCapturefunctionDeclared here
AudioCapturefunctionDeclared here
AudioCapturefunctionDeclared here
openAudiofunctionDeclared here
openAudiofunctionDeclared here
PtrtypedefDeclared here
ClosingvariableInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
openFilefunctionInherited from MediaCapture
closefunctionInherited from MediaCapture
startfunctionInherited from MediaCapture
stopfunctionInherited from MediaCapture
runfunctionInherited from MediaCapture
getEncoderFormatfunctionInherited from MediaCapture
getEncoderAudioCodecfunctionInherited from MediaCapture
getEncoderVideoCodecfunctionInherited from MediaCapture
setLoopInputfunctionInherited from MediaCapture
setLimitFrameratefunctionInherited from MediaCapture
setRealtimePTSfunctionInherited from MediaCapture
setOpenOptionsfunctionInherited from MediaCapture
setPassthroughVideofunctionInherited from MediaCapture
formatCtxfunctionInherited from MediaCapture
videofunctionInherited from MediaCapture
audiofunctionInherited from MediaCapture
stoppingfunctionInherited from MediaCapture
errorfunctionInherited from MediaCapture
_mutexvariableInherited from MediaCapture
_threadvariableInherited from MediaCapture
_formatCtxvariableInherited from MediaCapture
_videovariableInherited from MediaCapture
_audiovariableInherited from MediaCapture
_errorvariableInherited from MediaCapture
_stoppingvariableInherited from MediaCapture
_loopingvariableInherited from MediaCapture
_realtimevariableInherited from MediaCapture
_ratelimitvariableInherited from MediaCapture
_passthroughVideovariableInherited from MediaCapture
_openOptionsvariableInherited from MediaCapture
_videoStreamvariableInherited from MediaCapture
openStreamfunctionInherited from MediaCapture
emitfunctionInherited from MediaCapture
PtrtypedefInherited from MediaCapture
emittervariableInherited from ICapture
ICapturefunctionInherited from ICapture
startfunctionInherited from ICapture
stopfunctionInherited from ICapture
openFilefunctionInherited from ICapture
closefunctionInherited from ICapture
getEncoderFormatfunctionInherited from ICapture
getEncoderAudioCodecfunctionInherited from ICapture
getEncoderVideoCodecfunctionInherited from ICapture
openAudiofunctionInherited from ICapture
openVideofunctionInherited from ICapture
onStreamStateChangefunctionInherited from ICapture
openStreamfunctionInherited from ICapture
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
startfunctionInherited from Startable
stopfunctionInherited from Startable
RunnablefunctionInherited from Runnable
runfunctionInherited from Runnable
cancelfunctionInherited from Runnable
cancelledfunctionInherited from Runnable
exitvariableInherited from Runnable

Inherited from MediaCapture

KindNameDescription
variableClosingSignals that the capture thread is closing. This signal is emitted from the capture thread context.
functionMediaCapture
functionMediaCaptureDeleted constructor.
functionMediaCaptureDeleted constructor.
functionopenFile virtual overrideOpen a media file for decoding. Automatically detects video and audio streams.
functionclose virtual overrideStop the capture thread and close the media stream and all decoders.
functionstart virtual overrideStart the background capture and decode thread. Throws std::runtime_error if no media streams have been opened.
functionstop virtual overrideSignal the capture thread to stop and join it before returning.
functionrun virtual overrideEntry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called.
functiongetEncoderFormat virtual overrideFill format with the combined encoder-ready video and audio codec parameters.
functiongetEncoderAudioCodec virtual overrideFill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised.
functiongetEncoderVideoCodec virtual overrideFill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised.
functionsetLoopInputContinuously loop the input file when set.
functionsetLimitFramerateLimit playback to video FPS.
functionsetRealtimePTSSet to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable.
functionsetOpenOptionsSet demuxer options applied at the next openFile() call. Keys map to libavformat AVOption entries (e.g. "rtsp_transport", "fflags", "analyzeduration", "probesize"). Useful for live network sources that need low-latency hints. Pass an empty map to clear.
functionsetPassthroughVideoSkip the video decoder. Encoded video AVPackets from the input stream are emitted directly as [av::VideoPacket](#videopacket) without decoding. The emitted packets carry the source's encoded payload and a time in microseconds rescaled from the stream's timebase. The iframe flag is set from AV_PKT_FLAG_KEY.
functionformatCtx const
functionvideo const
functionaudio const
functionstopping const
functionerror const
variable_mutex
variable_thread
variable_formatCtx
variable_video
variable_audio
variable_error
variable_stopping
variable_looping
variable_realtime
variable_ratelimit
variable_passthroughVideo
variable_openOptions
variable_videoStream
functionopenStream virtual overrideOpen the underlying media stream.
functionemit virtual overrideEmit an existing packet directly onto the outgoing signal.
typedefPtr

Inherited from ICapture

KindNameDescription
variableemitter
functionICapture inline
functionstart virtual overrideStart capturing and emitting packets.
functionstop virtual overrideStop capturing and release device resources.
functionopenFile virtual inlineOpen a media file as the capture source.
functionclose virtual inlineRelease the capture source and any associated resources.
functiongetEncoderFormat virtualPopulate iformat with the encoder-ready format derived from this capture source.
functiongetEncoderAudioCodec virtual inlinePopulate params with the encoder-ready audio codec parameters.
functiongetEncoderVideoCodec virtual inlinePopulate params with the encoder-ready video codec parameters.
functionopenAudio virtual inlineOpen an audio capture device with the given parameters.
functionopenVideo virtual inlineOpen a video capture device with the given parameters.
functiononStreamStateChange virtual inline overrideReact to PacketStream state transitions by starting or stopping capture.
functionopenStream virtual inline

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Inherited from Startable

KindNameDescription
functionstart virtualStarts the object (e.g. begins processing or listening).
functionstop virtualStops the object (e.g. halts processing or closes resources).

Inherited from Runnable

KindNameDescription
functionRunnable inline
functionrun virtualThe run method will be called by the asynchronous context.
functioncancel virtual inlineCancel the current task. The run() method should return ASAP.
functioncancelled virtual const inlineReturns true when the task has been cancelled.
variableexit

Public Methods

ReturnNameDescription
AudioCaptureConstruct without opening a device. Call openAudio() before start().
AudioCaptureConstruct and immediately open the given audio device using an AudioCodec params struct.
AudioCaptureConstruct and immediately open the given audio device with individual parameters.
voidopenAudio virtual overrideOpen the given audio device using an AudioCodec params struct.
voidopenAudio virtualOpen the given audio device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, resampling will be applied.

{#audiocapture-1}

AudioCapture

AudioCapture()

Defined in src/av/include/icy/av/audiocapture.h:32

Construct without opening a device. Call openAudio() before start().


{#audiocapture-2}

AudioCapture

AudioCapture(const std::string & device, const av::AudioCodec & params)

Defined in src/av/include/icy/av/audiocapture.h:37

Construct and immediately open the given audio device using an AudioCodec params struct.

Parameters

  • device The platform audio device identifier.

  • params The desired capture parameters (channels, sample rate, format).


{#audiocapture-3}

AudioCapture

AudioCapture(const std::string & device, int channels = -1, int sampleRate = -1, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/audiocapture.h:44

Construct and immediately open the given audio device with individual parameters.

Parameters

  • device The platform audio device identifier.

  • channels The desired number of channels, or -1 for device default.

  • sampleRate The desired sample rate in Hz, or -1 for device default.

  • sampleFmt The desired sample format string, or "" for device default.


{#openaudio-1}

openAudio

virtual override

virtual void openAudio(const std::string & device, const av::AudioCodec & params) override

Defined in src/av/include/icy/av/audiocapture.h:51

Open the given audio device using an AudioCodec params struct.

Parameters

  • device The platform audio device identifier.

  • params The desired capture parameters.

Reimplements

{#openaudio-2}

openAudio

virtual

virtual void openAudio(const std::string & device, int channels = -1, int sampleRate = -1, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/audiocapture.h:60

Open the given audio device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, resampling will be applied.

Parameters

  • device The platform audio device identifier.

  • channels The desired number of channels, or -1 for device default.

  • sampleRate The desired sample rate in Hz, or -1 for device default.

  • sampleFmt The desired sample format string, or "" for device default.

Public Types

NameDescription
Ptr

{#ptr}

Ptr

using Ptr = std::shared_ptr< AudioCapture >

Defined in src/av/include/icy/av/audiocapture.h:29

{#mediacapture}

MediaCapture

#include <icy/av/mediacapture.h>
class MediaCapture

Defined in src/av/include/icy/av/mediacapture.h:37

Inherits: ICapture, Runnable Subclassed by: AudioCapture, VideoCapture

Unified capture and decode source for files and live media devices.

List of all members

NameKindOwner
ClosingvariableDeclared here
MediaCapturefunctionDeclared here
MediaCapturefunctionDeclared here
MediaCapturefunctionDeclared here
openFilefunctionDeclared here
closefunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here
runfunctionDeclared here
getEncoderFormatfunctionDeclared here
getEncoderAudioCodecfunctionDeclared here
getEncoderVideoCodecfunctionDeclared here
setLoopInputfunctionDeclared here
setLimitFrameratefunctionDeclared here
setRealtimePTSfunctionDeclared here
setOpenOptionsfunctionDeclared here
setPassthroughVideofunctionDeclared here
formatCtxfunctionDeclared here
videofunctionDeclared here
audiofunctionDeclared here
stoppingfunctionDeclared here
errorfunctionDeclared here
_mutexvariableDeclared here
_threadvariableDeclared here
_formatCtxvariableDeclared here
_videovariableDeclared here
_audiovariableDeclared here
_errorvariableDeclared here
_stoppingvariableDeclared here
_loopingvariableDeclared here
_realtimevariableDeclared here
_ratelimitvariableDeclared here
_passthroughVideovariableDeclared here
_openOptionsvariableDeclared here
_videoStreamvariableDeclared here
openStreamfunctionDeclared here
emitfunctionDeclared here
PtrtypedefDeclared here
emittervariableInherited from ICapture
ICapturefunctionInherited from ICapture
startfunctionInherited from ICapture
stopfunctionInherited from ICapture
openFilefunctionInherited from ICapture
closefunctionInherited from ICapture
getEncoderFormatfunctionInherited from ICapture
getEncoderAudioCodecfunctionInherited from ICapture
getEncoderVideoCodecfunctionInherited from ICapture
openAudiofunctionInherited from ICapture
openVideofunctionInherited from ICapture
onStreamStateChangefunctionInherited from ICapture
openStreamfunctionInherited from ICapture
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
startfunctionInherited from Startable
stopfunctionInherited from Startable
RunnablefunctionInherited from Runnable
runfunctionInherited from Runnable
cancelfunctionInherited from Runnable
cancelledfunctionInherited from Runnable
exitvariableInherited from Runnable

Inherited from ICapture

KindNameDescription
variableemitter
functionICapture inline
functionstart virtual overrideStart capturing and emitting packets.
functionstop virtual overrideStop capturing and release device resources.
functionopenFile virtual inlineOpen a media file as the capture source.
functionclose virtual inlineRelease the capture source and any associated resources.
functiongetEncoderFormat virtualPopulate iformat with the encoder-ready format derived from this capture source.
functiongetEncoderAudioCodec virtual inlinePopulate params with the encoder-ready audio codec parameters.
functiongetEncoderVideoCodec virtual inlinePopulate params with the encoder-ready video codec parameters.
functionopenAudio virtual inlineOpen an audio capture device with the given parameters.
functionopenVideo virtual inlineOpen a video capture device with the given parameters.
functiononStreamStateChange virtual inline overrideReact to PacketStream state transitions by starting or stopping capture.
functionopenStream virtual inline

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Inherited from Startable

KindNameDescription
functionstart virtualStarts the object (e.g. begins processing or listening).
functionstop virtualStops the object (e.g. halts processing or closes resources).

Inherited from Runnable

KindNameDescription
functionRunnable inline
functionrun virtualThe run method will be called by the asynchronous context.
functioncancel virtual inlineCancel the current task. The run() method should return ASAP.
functioncancelled virtual const inlineReturns true when the task has been cancelled.
variableexit

Public Attributes

ReturnNameDescription
NullSignalClosingSignals that the capture thread is closing. This signal is emitted from the capture thread context.

{#closing}

Closing

NullSignal Closing

Defined in src/av/include/icy/av/mediacapture.h:133

Signals that the capture thread is closing. This signal is emitted from the capture thread context.

Public Methods

ReturnNameDescription
MediaCapture
MediaCaptureDeleted constructor.
MediaCaptureDeleted constructor.
voidopenFile virtual overrideOpen a media file for decoding. Automatically detects video and audio streams.
voidclose virtual overrideStop the capture thread and close the media stream and all decoders.
voidstart virtual overrideStart the background capture and decode thread. Throws std::runtime_error if no media streams have been opened.
voidstop virtual overrideSignal the capture thread to stop and join it before returning.
voidrun virtual overrideEntry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called.
voidgetEncoderFormat virtual overrideFill format with the combined encoder-ready video and audio codec parameters.
voidgetEncoderAudioCodec virtual overrideFill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised.
voidgetEncoderVideoCodec virtual overrideFill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised.
voidsetLoopInputContinuously loop the input file when set.
voidsetLimitFramerateLimit playback to video FPS.
voidsetRealtimePTSSet to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable.
voidsetOpenOptionsSet demuxer options applied at the next openFile() call. Keys map to libavformat AVOption entries (e.g. "rtsp_transport", "fflags", "analyzeduration", "probesize"). Useful for live network sources that need low-latency hints. Pass an empty map to clear.
voidsetPassthroughVideoSkip the video decoder. Encoded video AVPackets from the input stream are emitted directly as [av::VideoPacket](#videopacket) without decoding. The emitted packets carry the source's encoded payload and a time in microseconds rescaled from the stream's timebase. The iframe flag is set from AV_PKT_FLAG_KEY.
AVFormatContext *formatCtx const
VideoDecoder *video const
AudioDecoder *audio const
boolstopping const
std::stringerror const

{#mediacapture-1}

MediaCapture

MediaCapture()

Defined in src/av/include/icy/av/mediacapture.h:43


{#mediacapture-2}

MediaCapture

MediaCapture(const MediaCapture &) = delete

Defined in src/av/include/icy/av/mediacapture.h:46

Deleted constructor.


{#mediacapture-3}

MediaCapture

MediaCapture(MediaCapture &&) = delete

Defined in src/av/include/icy/av/mediacapture.h:48

Deleted constructor.


{#openfile-1}

openFile

virtual override

virtual void openFile(const std::string & file) override

Defined in src/av/include/icy/av/mediacapture.h:53

Open a media file for decoding. Automatically detects video and audio streams.

Parameters

  • file Path to the media file.
Reimplements

{#close-5}

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/mediacapture.h:60

Stop the capture thread and close the media stream and all decoders.

Reimplements

{#start-4}

start

virtual override

virtual void start() override

Defined in src/av/include/icy/av/mediacapture.h:64

Start the background capture and decode thread. Throws std::runtime_error if no media streams have been opened.

Reimplements

{#stop-3}

stop

virtual override

virtual void stop() override

Defined in src/av/include/icy/av/mediacapture.h:67

Signal the capture thread to stop and join it before returning.

Reimplements

{#run}

run

virtual override

virtual void run() override

Defined in src/av/include/icy/av/mediacapture.h:71

Entry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called.

Reimplements

{#getencoderformat-1}

getEncoderFormat

virtual override

virtual void getEncoderFormat(Format & format) override

Defined in src/av/include/icy/av/mediacapture.h:75

Fill format with the combined encoder-ready video and audio codec parameters.

Parameters

  • format Output Format struct to populate.
Reimplements

{#getencoderaudiocodec-1}

getEncoderAudioCodec

virtual override

virtual void getEncoderAudioCodec(AudioCodec & params) override

Defined in src/av/include/icy/av/mediacapture.h:80

Fill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised.

Parameters

Reimplements

{#getencodervideocodec-1}

getEncoderVideoCodec

virtual override

virtual void getEncoderVideoCodec(VideoCodec & params) override

Defined in src/av/include/icy/av/mediacapture.h:85

Fill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised.

Parameters

Reimplements

{#setloopinput}

setLoopInput

void setLoopInput(bool flag)

Defined in src/av/include/icy/av/mediacapture.h:88

Continuously loop the input file when set.


{#setlimitframerate}

setLimitFramerate

void setLimitFramerate(bool flag)

Defined in src/av/include/icy/av/mediacapture.h:91

Limit playback to video FPS.


{#setrealtimepts}

setRealtimePTS

void setRealtimePTS(bool flag)

Defined in src/av/include/icy/av/mediacapture.h:96

Set to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable.


{#setopenoptions}

setOpenOptions

void setOpenOptions(const std::map< std::string, std::string > & options)

Defined in src/av/include/icy/av/mediacapture.h:102

Set demuxer options applied at the next openFile() call. Keys map to libavformat AVOption entries (e.g. "rtsp_transport", "fflags", "analyzeduration", "probesize"). Useful for live network sources that need low-latency hints. Pass an empty map to clear.


{#setpassthroughvideo}

setPassthroughVideo

void setPassthroughVideo(bool flag)

Defined in src/av/include/icy/av/mediacapture.h:114

Skip the video decoder. Encoded video AVPackets from the input stream are emitted directly as [av::VideoPacket](#videopacket) without decoding. The emitted packets carry the source's encoded payload and a time in microseconds rescaled from the stream's timebase. The iframe flag is set from AV_PKT_FLAG_KEY.

Use case: forwarding already-browser-compatible H.264 to a WebRTC sender without the cost of decode plus re-encode. Must be called before openFile(); changing the mode after the stream is open is not supported.


{#formatctx}

formatCtx

const

AVFormatContext * formatCtx() const

Defined in src/av/include/icy/av/mediacapture.h:117

Returns

The underlying AVFormatContext (thread-safe, mutex-protected).


{#video-1}

video

const

VideoDecoder * video() const

Defined in src/av/include/icy/av/mediacapture.h:120

Returns

The active VideoDecoder, or nullptr if no video stream was opened.


{#audio-1}

audio

const

AudioDecoder * audio() const

Defined in src/av/include/icy/av/mediacapture.h:123

Returns

The active AudioDecoder, or nullptr if no audio stream was opened.


{#stopping}

stopping

const

bool stopping() const

Defined in src/av/include/icy/av/mediacapture.h:126

Returns

True if the capture thread has been asked to stop.


{#error-2}

error

const

std::string error() const

Defined in src/av/include/icy/av/mediacapture.h:129

Returns

The last error message, or an empty string if no error has occurred.

Protected Attributes

ReturnNameDescription
std::mutex_mutex
Thread_thread
AVFormatContext *_formatCtx
std::unique_ptr< VideoDecoder >_video
std::unique_ptr< AudioDecoder >_audio
std::string_error
std::atomic< bool >_stopping
std::atomic< bool >_looping
std::atomic< bool >_realtime
std::atomic< bool >_ratelimit
std::atomic< bool >_passthroughVideo
std::map< std::string, std::string >_openOptions
AVStream *_videoStream

{#_mutex}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/mediacapture.h:146


{#_thread}

_thread

Thread _thread

Defined in src/av/include/icy/av/mediacapture.h:147


{#_formatctx}

_formatCtx

AVFormatContext * _formatCtx

Defined in src/av/include/icy/av/mediacapture.h:148


{#_video}

_video

std::unique_ptr< VideoDecoder > _video

Defined in src/av/include/icy/av/mediacapture.h:149


{#_audio}

_audio

std::unique_ptr< AudioDecoder > _audio

Defined in src/av/include/icy/av/mediacapture.h:150


{#_error}

_error

std::string _error

Defined in src/av/include/icy/av/mediacapture.h:151


{#_stopping}

_stopping

std::atomic< bool > _stopping

Defined in src/av/include/icy/av/mediacapture.h:152


{#_looping}

_looping

std::atomic< bool > _looping

Defined in src/av/include/icy/av/mediacapture.h:153


{#_realtime}

_realtime

std::atomic< bool > _realtime

Defined in src/av/include/icy/av/mediacapture.h:154


{#_ratelimit}

_ratelimit

std::atomic< bool > _ratelimit

Defined in src/av/include/icy/av/mediacapture.h:155


{#_passthroughvideo}

_passthroughVideo

std::atomic< bool > _passthroughVideo {false}

Defined in src/av/include/icy/av/mediacapture.h:156


{#_openoptions}

_openOptions

std::map< std::string, std::string > _openOptions

Defined in src/av/include/icy/av/mediacapture.h:157


{#_videostream}

_videoStream

AVStream * _videoStream = nullptr

Defined in src/av/include/icy/av/mediacapture.h:161

Protected Methods

ReturnNameDescription
voidopenStream virtual overrideOpen the underlying media stream.
voidemit virtual overrideEmit an existing packet directly onto the outgoing signal.

{#openstream-1}

openStream

virtual override

virtual void openStream(const std::string & filename, const AVInputFormat * inputFormat, AVDictionary ** formatParams) override

Defined in src/av/include/icy/av/mediacapture.h:141

Open the underlying media stream.

Parameters

  • filename The file path or device name to open.

  • inputFormat The forced input format, or nullptr for auto-detect.

  • formatParams Optional format parameters; may be updated by FFmpeg on return.

Reimplements

{#emit}

emit

virtual override

virtual void emit(IPacket & packet) override

Defined in src/av/include/icy/av/mediacapture.h:143

Emit an existing packet directly onto the outgoing signal.

Parameters

  • packet The packet to forward; must remain valid for the duration of the call.
Reimplements

Public Types

NameDescription
Ptr

{#ptr-1}

Ptr

using Ptr = std::shared_ptr< MediaCapture >

Defined in src/av/include/icy/av/mediacapture.h:41

{#videocapture}

VideoCapture

#include <icy/av/videocapture.h>
class VideoCapture

Defined in src/av/include/icy/av/videocapture.h:26

Inherits: MediaCapture

Cross-platform video device capturer backed by FFmpeg avdevice.

List of all members

NameKindOwner
VideoCapturefunctionDeclared here
VideoCapturefunctionDeclared here
VideoCapturefunctionDeclared here
openVideofunctionDeclared here
openVideofunctionDeclared here
PtrtypedefDeclared here
ClosingvariableInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
MediaCapturefunctionInherited from MediaCapture
openFilefunctionInherited from MediaCapture
closefunctionInherited from MediaCapture
startfunctionInherited from MediaCapture
stopfunctionInherited from MediaCapture
runfunctionInherited from MediaCapture
getEncoderFormatfunctionInherited from MediaCapture
getEncoderAudioCodecfunctionInherited from MediaCapture
getEncoderVideoCodecfunctionInherited from MediaCapture
setLoopInputfunctionInherited from MediaCapture
setLimitFrameratefunctionInherited from MediaCapture
setRealtimePTSfunctionInherited from MediaCapture
setOpenOptionsfunctionInherited from MediaCapture
setPassthroughVideofunctionInherited from MediaCapture
formatCtxfunctionInherited from MediaCapture
videofunctionInherited from MediaCapture
audiofunctionInherited from MediaCapture
stoppingfunctionInherited from MediaCapture
errorfunctionInherited from MediaCapture
_mutexvariableInherited from MediaCapture
_threadvariableInherited from MediaCapture
_formatCtxvariableInherited from MediaCapture
_videovariableInherited from MediaCapture
_audiovariableInherited from MediaCapture
_errorvariableInherited from MediaCapture
_stoppingvariableInherited from MediaCapture
_loopingvariableInherited from MediaCapture
_realtimevariableInherited from MediaCapture
_ratelimitvariableInherited from MediaCapture
_passthroughVideovariableInherited from MediaCapture
_openOptionsvariableInherited from MediaCapture
_videoStreamvariableInherited from MediaCapture
openStreamfunctionInherited from MediaCapture
emitfunctionInherited from MediaCapture
PtrtypedefInherited from MediaCapture
emittervariableInherited from ICapture
ICapturefunctionInherited from ICapture
startfunctionInherited from ICapture
stopfunctionInherited from ICapture
openFilefunctionInherited from ICapture
closefunctionInherited from ICapture
getEncoderFormatfunctionInherited from ICapture
getEncoderAudioCodecfunctionInherited from ICapture
getEncoderVideoCodecfunctionInherited from ICapture
openAudiofunctionInherited from ICapture
openVideofunctionInherited from ICapture
onStreamStateChangefunctionInherited from ICapture
openStreamfunctionInherited from ICapture
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
startfunctionInherited from Startable
stopfunctionInherited from Startable
RunnablefunctionInherited from Runnable
runfunctionInherited from Runnable
cancelfunctionInherited from Runnable
cancelledfunctionInherited from Runnable
exitvariableInherited from Runnable

Inherited from MediaCapture

KindNameDescription
variableClosingSignals that the capture thread is closing. This signal is emitted from the capture thread context.
functionMediaCapture
functionMediaCaptureDeleted constructor.
functionMediaCaptureDeleted constructor.
functionopenFile virtual overrideOpen a media file for decoding. Automatically detects video and audio streams.
functionclose virtual overrideStop the capture thread and close the media stream and all decoders.
functionstart virtual overrideStart the background capture and decode thread. Throws std::runtime_error if no media streams have been opened.
functionstop virtual overrideSignal the capture thread to stop and join it before returning.
functionrun virtual overrideEntry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called.
functiongetEncoderFormat virtual overrideFill format with the combined encoder-ready video and audio codec parameters.
functiongetEncoderAudioCodec virtual overrideFill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised.
functiongetEncoderVideoCodec virtual overrideFill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised.
functionsetLoopInputContinuously loop the input file when set.
functionsetLimitFramerateLimit playback to video FPS.
functionsetRealtimePTSSet to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable.
functionsetOpenOptionsSet demuxer options applied at the next openFile() call. Keys map to libavformat AVOption entries (e.g. "rtsp_transport", "fflags", "analyzeduration", "probesize"). Useful for live network sources that need low-latency hints. Pass an empty map to clear.
functionsetPassthroughVideoSkip the video decoder. Encoded video AVPackets from the input stream are emitted directly as [av::VideoPacket](#videopacket) without decoding. The emitted packets carry the source's encoded payload and a time in microseconds rescaled from the stream's timebase. The iframe flag is set from AV_PKT_FLAG_KEY.
functionformatCtx const
functionvideo const
functionaudio const
functionstopping const
functionerror const
variable_mutex
variable_thread
variable_formatCtx
variable_video
variable_audio
variable_error
variable_stopping
variable_looping
variable_realtime
variable_ratelimit
variable_passthroughVideo
variable_openOptions
variable_videoStream
functionopenStream virtual overrideOpen the underlying media stream.
functionemit virtual overrideEmit an existing packet directly onto the outgoing signal.
typedefPtr

Inherited from ICapture

KindNameDescription
variableemitter
functionICapture inline
functionstart virtual overrideStart capturing and emitting packets.
functionstop virtual overrideStop capturing and release device resources.
functionopenFile virtual inlineOpen a media file as the capture source.
functionclose virtual inlineRelease the capture source and any associated resources.
functiongetEncoderFormat virtualPopulate iformat with the encoder-ready format derived from this capture source.
functiongetEncoderAudioCodec virtual inlinePopulate params with the encoder-ready audio codec parameters.
functiongetEncoderVideoCodec virtual inlinePopulate params with the encoder-ready video codec parameters.
functionopenAudio virtual inlineOpen an audio capture device with the given parameters.
functionopenVideo virtual inlineOpen a video capture device with the given parameters.
functiononStreamStateChange virtual inline overrideReact to PacketStream state transitions by starting or stopping capture.
functionopenStream virtual inline

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Inherited from Startable

KindNameDescription
functionstart virtualStarts the object (e.g. begins processing or listening).
functionstop virtualStops the object (e.g. halts processing or closes resources).

Inherited from Runnable

KindNameDescription
functionRunnable inline
functionrun virtualThe run method will be called by the asynchronous context.
functioncancel virtual inlineCancel the current task. The run() method should return ASAP.
functioncancelled virtual const inlineReturns true when the task has been cancelled.
variableexit

Public Methods

ReturnNameDescription
VideoCaptureConstruct without opening a device. Call openVideo() before start().
VideoCaptureConstruct and immediately open the given video device using a VideoCodec params struct.
VideoCaptureConstruct and immediately open the given video device with individual parameters.
voidopenVideo virtual overrideOpen the given video device using a VideoCodec params struct.
voidopenVideo virtualOpen the given video device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, pixel format conversion and scaling will be applied by the decoder.

{#videocapture-1}

VideoCapture

VideoCapture()

Defined in src/av/include/icy/av/videocapture.h:32

Construct without opening a device. Call openVideo() before start().


{#videocapture-2}

VideoCapture

VideoCapture(const std::string & device, const av::VideoCodec & params)

Defined in src/av/include/icy/av/videocapture.h:37

Construct and immediately open the given video device using a VideoCodec params struct.

Parameters

  • device The platform video device identifier (e.g. "/dev/video0" or "0" on Windows).

  • params The desired capture parameters (width, height, fps, pixel format).


{#videocapture-3}

VideoCapture

VideoCapture(const std::string & device, int width = 0, int height = 0, double framerate = 0, const std::string & pixelFmt = "")

Defined in src/av/include/icy/av/videocapture.h:45

Construct and immediately open the given video device with individual parameters.

Parameters

  • device The platform video device identifier.

  • width The desired frame width in pixels, or 0 for device default.

  • height The desired frame height in pixels, or 0 for device default.

  • framerate The desired frame rate, or 0 for device default.

  • pixelFmt The desired pixel format string, or "" for "yuv420p".


{#openvideo-1}

openVideo

virtual override

virtual void openVideo(const std::string & device, const av::VideoCodec & params) override

Defined in src/av/include/icy/av/videocapture.h:52

Open the given video device using a VideoCodec params struct.

Parameters

  • device The platform video device identifier.

  • params The desired capture parameters.

Reimplements

{#openvideo-2}

openVideo

virtual

virtual void openVideo(const std::string & device, int width = 0, int height = 0, double framerate = 0, const std::string & pixelFmt = "")

Defined in src/av/include/icy/av/videocapture.h:63

Open the given video device with individual parameters. Configures the FFmpeg input format and passes device options via AVDictionary. If the device cannot satisfy the requested parameters, pixel format conversion and scaling will be applied by the decoder.

Parameters

  • device The platform video device identifier.

  • width The desired frame width in pixels, or 0 for device default.

  • height The desired frame height in pixels, or 0 for device default.

  • framerate The desired frame rate, or 0 for device default.

  • pixelFmt The desired pixel format string, or "" for "yuv420p".

Public Types

NameDescription
Ptr

{#ptr-2}

Ptr

using Ptr = std::shared_ptr< VideoCapture >

Defined in src/av/include/icy/av/videocapture.h:29

{#devicewatcher}

DeviceWatcher

#include <icy/av/devicemanager.h>
class DeviceWatcher

Defined in src/av/include/icy/av/devicemanager.h:194

Subclassed by: AppleDeviceWatcher, LinuxDeviceWatcher, WindowsDeviceWatcher

Base class for platform-specific device change monitors.

Call start() to begin monitoring and stop() to end. The watcher is NOT auto-started; callers must explicitly start it.

List of all members

NameKindOwner
DeviceWatcherfunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here

Public Methods

ReturnNameDescription
DeviceWatcher inline explicit
boolstart virtual inline
voidstop virtual inline

{#devicewatcher-1}

DeviceWatcher

inline explicit

inline explicit DeviceWatcher(DeviceManager *)

Defined in src/av/include/icy/av/devicemanager.h:197


{#start-5}

start

virtual inline

virtual inline bool start()

Defined in src/av/include/icy/av/devicemanager.h:199

Reimplemented by

{#stop-4}

stop

virtual inline

virtual inline void stop()

Defined in src/av/include/icy/av/devicemanager.h:200

Reimplemented by

{#devicemanager}

DeviceManager

#include <icy/av/devicemanager.h>
class DeviceManager

Defined in src/av/include/icy/av/devicemanager.h:210

Enumerates and manages system audio and video devices.

List of all members

NameKindOwner
DevicesChangedvariableDeclared here
DeviceManagerfunctionDeclared here
getCamerasfunctionDeclared here
getMicrophonesfunctionDeclared here
getSpeakersfunctionDeclared here
getDefaultCamerafunctionDeclared here
getDefaultMicrophonefunctionDeclared here
getDefaultSpeakerfunctionDeclared here
findCamerafunctionDeclared here
findMicrophonefunctionDeclared here
findSpeakerfunctionDeclared here
getDeviceListfunctionDeclared here
getCapabilitiesfunctionDeclared here
setWatcherfunctionDeclared here
watcherfunctionDeclared here
printfunctionDeclared here
getHardwareCodecsfunctionDeclared here
negotiateVideoCapturefunctionDeclared here
negotiateAudioCapturefunctionDeclared here
findVideoInputFormatfunctionDeclared here
findAudioInputFormatfunctionDeclared here
instancefunctionDeclared here
shutdownfunctionDeclared here
_watchervariableDeclared here

Public Attributes

ReturnNameDescription
NullSignalDevicesChangedSignals when a system device is connected or removed. Emitted by the platform-specific [DeviceWatcher](#devicewatcher).

{#deviceschanged}

DevicesChanged

NullSignal DevicesChanged

Defined in src/av/include/icy/av/devicemanager.h:297

Signals when a system device is connected or removed. Emitted by the platform-specific [DeviceWatcher](#devicewatcher).

NOTE: This signal may be emitted from a background thread (e.g. inotify thread on Linux, COM callback on Windows, CoreAudio listener on macOS). Handlers must be thread-safe and should NOT call back into DeviceManager to enumerate. Instead, post to the main thread or set a flag.

Public Methods

ReturnNameDescription
DeviceManager
boolgetCameras constPopulate devices with all connected video input (camera) devices.
boolgetMicrophones constPopulate devices with all connected audio input (microphone) devices.
boolgetSpeakers constPopulate devices with all connected audio output (speaker) devices.
boolgetDefaultCamera constReturn the default (or first available) camera.
boolgetDefaultMicrophone constReturn the default (or first available) microphone.
boolgetDefaultSpeaker constReturn the default (or first available) speaker.
boolfindCamera constFind a camera by display name or device id.
boolfindMicrophone constFind a microphone by display name or device id.
boolfindSpeaker constFind a speaker by display name or device id.
boolgetDeviceList constPopulate devices from the platform-specific backend for the given type.
intgetCapabilities const
voidsetWatcherReplace the active device watcher. Takes ownership.
DeviceWatcher *watcher const
voidprint constPrint all devices to the output stream.
std::vector< HardwareCodec >getHardwareCodecs constDetect available hardware-accelerated codecs via FFmpeg.
std::optional< std::pair< Device, Device::VideoCapability > >negotiateVideoCapture constResolve the best video capture parameters for a device.
std::optional< std::pair< Device, Device::AudioCapability > >negotiateAudioCapture constResolve the best audio capture parameters for a device. Returns std::nullopt if no microphone is available.
const AVInputFormat *findVideoInputFormat constFind base FFmpeg formats.
const AVInputFormat *findAudioInputFormat const

{#devicemanager-1}

DeviceManager

DeviceManager()

Defined in src/av/include/icy/av/devicemanager.h:213


{#getcameras}

getCameras

const

bool getCameras(std::vector< Device > & devices) const

Defined in src/av/include/icy/av/devicemanager.h:219

Populate devices with all connected video input (camera) devices.

Parameters

  • devices Output vector to fill.

Returns

True if enumeration succeeded (even if the list is empty).


{#getmicrophones}

getMicrophones

const

bool getMicrophones(std::vector< Device > & devices) const

Defined in src/av/include/icy/av/devicemanager.h:224

Populate devices with all connected audio input (microphone) devices.

Parameters

  • devices Output vector to fill.

Returns

True if enumeration succeeded.


{#getspeakers}

getSpeakers

const

bool getSpeakers(std::vector< Device > & devices) const

Defined in src/av/include/icy/av/devicemanager.h:229

Populate devices with all connected audio output (speaker) devices.

Parameters

  • devices Output vector to fill.

Returns

True if enumeration succeeded.


{#getdefaultcamera}

getDefaultCamera

const

bool getDefaultCamera(Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:234

Return the default (or first available) camera.

Parameters

  • device Output Device to fill.

Returns

True if a camera was found.


{#getdefaultmicrophone}

getDefaultMicrophone

const

bool getDefaultMicrophone(Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:239

Return the default (or first available) microphone.

Parameters

  • device Output Device to fill.

Returns

True if a microphone was found.


{#getdefaultspeaker}

getDefaultSpeaker

const

bool getDefaultSpeaker(Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:244

Return the default (or first available) speaker.

Parameters

  • device Output Device to fill.

Returns

True if a speaker was found.


{#findcamera}

findCamera

const

bool findCamera(std::string_view name, Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:250

Find a camera by display name or device id.

Parameters

  • name The name or id to search for.

  • device Output Device to fill if found.

Returns

True if a matching device was found.


{#findmicrophone}

findMicrophone

const

bool findMicrophone(std::string_view name, Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:256

Find a microphone by display name or device id.

Parameters

  • name The name or id to search for.

  • device Output Device to fill if found.

Returns

True if a matching device was found.


{#findspeaker}

findSpeaker

const

bool findSpeaker(std::string_view name, Device & device) const

Defined in src/av/include/icy/av/devicemanager.h:262

Find a speaker by display name or device id.

Parameters

  • name The name or id to search for.

  • device Output Device to fill if found.

Returns

True if a matching device was found.


{#getdevicelist-3}

getDeviceList

const

bool getDeviceList(Device::Type type, std::vector< av::Device > & devices) const

Defined in src/av/include/icy/av/devicemanager.h:268

Populate devices from the platform-specific backend for the given type.

Parameters

  • type The device type to enumerate.

  • devices Output vector to fill.

Returns

True if enumeration succeeded.


{#getcapabilities}

getCapabilities

const

int getCapabilities() const

Defined in src/av/include/icy/av/devicemanager.h:271

Returns

A bitmask of MediaCapabilities flags indicating which capture/render types are available.


{#setwatcher}

setWatcher

void setWatcher(DeviceWatcher * watcher)

Defined in src/av/include/icy/av/devicemanager.h:275

Replace the active device watcher. Takes ownership.

Parameters


{#watcher}

watcher

const

DeviceWatcher * watcher() const

Defined in src/av/include/icy/av/devicemanager.h:278

Returns

The currently active DeviceWatcher, or nullptr if none has been set.


{#print-5}

print

const

void print(std::ostream & ost) const

Defined in src/av/include/icy/av/devicemanager.h:281

Print all devices to the output stream.


{#gethardwarecodecs}

getHardwareCodecs

const

std::vector< HardwareCodec > getHardwareCodecs() const

Defined in src/av/include/icy/av/devicemanager.h:307

Detect available hardware-accelerated codecs via FFmpeg.


{#negotiatevideocapture}

negotiateVideoCapture

const

std::optional< std::pair< Device, Device::VideoCapability > > negotiateVideoCapture(std::string_view deviceName, int width, int height, double fps) const

Defined in src/av/include/icy/av/devicemanager.h:321

Resolve the best video capture parameters for a device.

Looks up the device by name/id (or default camera if empty), queries its capabilities, and returns the closest match. Returns std::nullopt if no camera is available.

Usage: if (auto result = devman.negotiateVideoCapture("", 1280, 720, 30)) { auto& [dev, cap] = *result; capture.openVideo(dev.id, cap.width, cap.height, cap.maxFps, cap.pixelFormat); }


{#negotiateaudiocapture}

negotiateAudioCapture

const

std::optional< std::pair< Device, Device::AudioCapability > > negotiateAudioCapture(std::string_view deviceName, int sampleRate, int channels) const

Defined in src/av/include/icy/av/devicemanager.h:326

Resolve the best audio capture parameters for a device. Returns std::nullopt if no microphone is available.


{#findvideoinputformat}

findVideoInputFormat

const

const AVInputFormat * findVideoInputFormat() const

Defined in src/av/include/icy/av/devicemanager.h:330

Find base FFmpeg formats.


{#findaudioinputformat}

findAudioInputFormat

const

const AVInputFormat * findAudioInputFormat() const

Defined in src/av/include/icy/av/devicemanager.h:331

Public Static Methods

ReturnNameDescription
DeviceManager &instance staticReturns the default [DeviceManager](#devicemanager) singleton.
voidshutdown staticShuts down the MediaFactory and deletes the singleton instance.

{#instance}

instance

static

static DeviceManager & instance()

Defined in src/av/include/icy/av/devicemanager.h:284

Returns the default [DeviceManager](#devicemanager) singleton.


{#shutdown}

shutdown

static

static void shutdown()

Defined in src/av/include/icy/av/devicemanager.h:287

Shuts down the MediaFactory and deletes the singleton instance.

Protected Attributes

ReturnNameDescription
std::unique_ptr< DeviceWatcher >_watcher

{#_watcher}

_watcher

std::unique_ptr< DeviceWatcher > _watcher

Defined in src/av/include/icy/av/devicemanager.h:335

{#hardwarecodec}

HardwareCodec

#include <icy/av/devicemanager.h>
struct HardwareCodec

Defined in src/av/include/icy/av/devicemanager.h:300

Hardware codec descriptor.

List of all members

NameKindOwner
namevariableDeclared here
typevariableDeclared here

Public Attributes

ReturnNameDescription
std::stringname
std::stringtype

{#name-3}

name

std::string name

Defined in src/av/include/icy/av/devicemanager.h:302


{#type-6}

type

std::string type

Defined in src/av/include/icy/av/devicemanager.h:303

{#formatregistry}

FormatRegistry

#include <icy/av/formatregistry.h>
class FormatRegistry

Defined in src/av/include/icy/av/formatregistry.h:26

Singleton registry of available media container formats for encoding and decoding.

List of all members

NameKindOwner
FormatRegistryfunctionDeclared here
getfunctionDeclared here
getByIDfunctionDeclared here
getOrDefaultfunctionDeclared here
getDefaultfunctionDeclared here
registerFormatfunctionDeclared here
unregisterFormatfunctionDeclared here
setDefaultfunctionDeclared here
existsfunctionDeclared here
clearfunctionDeclared here
formatsfunctionDeclared here
instancefunctionDeclared here
_formatsvariableDeclared here
_defaultvariableDeclared here
_mutexvariableDeclared here
FormatRegistryfunctionDeclared here
FormatRegistryfunctionDeclared here
findByNamefunctionDeclared here
defaultLockedfunctionDeclared here

Public Methods

ReturnNameDescription
FormatRegistry
Format &get virtualReturn the format with the given display name. Throws std::runtime_error if no format with that name is registered.
Format &getByID virtualReturn the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered.
Format &getOrDefault virtualReturn the format with the given name, or the default format if not found.
Format &getDefault virtualIf a default has been specified it will be returned, other the format with the highest priority will take precedence.
voidregisterFormat virtualRegisters the given media format overriding existing media formats of the same name.
boolunregisterFormat virtualUnregisters the media format matching the given name.
voidsetDefault virtualSets the default fallback media format.
boolexists virtual
voidclear virtualRemove all registered formats and clear the default.
FormatListformats virtual const

{#formatregistry-1}

FormatRegistry

FormatRegistry()

Defined in src/av/include/icy/av/formatregistry.h:32


{#get}

get

virtual

virtual Format & get(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:38

Return the format with the given display name. Throws std::runtime_error if no format with that name is registered.

Parameters

  • name The display name to look up.

{#getbyid}

getByID

virtual

virtual Format & getByID(std::string_view id)

Defined in src/av/include/icy/av/formatregistry.h:43

Return the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered.

Parameters

  • id The short format ID to look up.

{#getordefault}

getOrDefault

virtual

virtual Format & getOrDefault(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:47

Return the format with the given name, or the default format if not found.

Parameters

  • name The display name to look up.

{#getdefault}

getDefault

virtual

virtual Format & getDefault()

Defined in src/av/include/icy/av/formatregistry.h:52

If a default has been specified it will be returned, other the format with the highest priority will take precedence.


{#registerformat}

registerFormat

virtual

virtual void registerFormat(const Format & format)

Defined in src/av/include/icy/av/formatregistry.h:56

Registers the given media format overriding existing media formats of the same name.


{#unregisterformat}

unregisterFormat

virtual

virtual bool unregisterFormat(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:60

Unregisters the media format matching the given name.


{#setdefault}

setDefault

virtual

virtual void setDefault(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:63

Sets the default fallback media format.


{#exists}

exists

virtual

virtual bool exists(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:67

Returns

True if a format with the given display name is registered.

Parameters

  • name The display name to check.

{#clear}

clear

virtual

virtual void clear()

Defined in src/av/include/icy/av/formatregistry.h:70

Remove all registered formats and clear the default.


{#formats}

formats

virtual const

virtual FormatList formats() const

Defined in src/av/include/icy/av/formatregistry.h:73

Returns

A snapshot copy of all registered formats.

Public Static Methods

ReturnNameDescription
FormatRegistry &instance staticReturn the singleton FormatRegistry instance.

{#instance-1}

instance

static

static FormatRegistry & instance()

Defined in src/av/include/icy/av/formatregistry.h:30

Return the singleton FormatRegistry instance.

Private Attributes

ReturnNameDescription
FormatList_formats
std::string_default
std::mutex_mutex

{#_formats}

_formats

FormatList _formats

Defined in src/av/include/icy/av/formatregistry.h:84


{#_default}

_default

std::string _default

Defined in src/av/include/icy/av/formatregistry.h:85


{#_mutex-1}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/formatregistry.h:86

Private Methods

ReturnNameDescription
FormatRegistryDeleted constructor.
FormatRegistryDeleted constructor.
Format &findByName
Format &defaultLocked

{#formatregistry-2}

FormatRegistry

FormatRegistry(const FormatRegistry &) = delete

Defined in src/av/include/icy/av/formatregistry.h:76

Deleted constructor.


{#formatregistry-3}

FormatRegistry

FormatRegistry(FormatRegistry &&) = delete

Defined in src/av/include/icy/av/formatregistry.h:78

Deleted constructor.


{#findbyname}

findByName

Format & findByName(std::string_view name)

Defined in src/av/include/icy/av/formatregistry.h:81


{#defaultlocked}

defaultLocked

Format & defaultLocked()

Defined in src/av/include/icy/av/formatregistry.h:82

{#windowsdevicewatcher}

WindowsDeviceWatcher

#include <icy/av/win32/mediafoundation.h>
class WindowsDeviceWatcher

Defined in src/av/include/icy/av/win32/mediafoundation.h:61

Inherits: DeviceWatcher

Monitors device add/remove events via IMMNotificationClient (audio) and RegisterDeviceNotification (video).

List of all members

NameKindOwner
WindowsDeviceWatcherfunctionDeclared here
startfunctionDeclared here
stopfunctionDeclared here
_implvariableDeclared here
_managervariableDeclared here
DeviceWatcherfunctionInherited from DeviceWatcher
startfunctionInherited from DeviceWatcher
stopfunctionInherited from DeviceWatcher

Inherited from DeviceWatcher

KindNameDescription
functionDeviceWatcher inline explicit
functionstart virtual inline
functionstop virtual inline

Public Methods

ReturnNameDescription
WindowsDeviceWatcher explicit
boolstart virtual overrideBegin monitoring via IMMNotificationClient and RegisterDeviceNotification.
voidstop virtual overrideStop monitoring and unregister all device notifications.

{#windowsdevicewatcher-1}

WindowsDeviceWatcher

explicit

explicit WindowsDeviceWatcher(DeviceManager * manager)

Defined in src/av/include/icy/av/win32/mediafoundation.h:65

Parameters

  • manager The DeviceManager whose DevicesChanged signal will be emitted on changes.

{#start-6}

start

virtual override

virtual bool start() override

Defined in src/av/include/icy/av/win32/mediafoundation.h:70

Begin monitoring via IMMNotificationClient and RegisterDeviceNotification.

Returns

True if monitoring was successfully started.

Reimplements

{#stop-5}

stop

virtual override

virtual void stop() override

Defined in src/av/include/icy/av/win32/mediafoundation.h:73

Stop monitoring and unregister all device notifications.

Reimplements

Private Attributes

ReturnNameDescription
std::unique_ptr< Impl >_impl
DeviceManager *_manager

{#_impl-2}

_impl

std::unique_ptr< Impl > _impl

Defined in src/av/include/icy/av/win32/mediafoundation.h:78


{#_manager-2}

_manager

DeviceManager * _manager

Defined in src/av/include/icy/av/win32/mediafoundation.h:79

{#multiplexencoder}

MultiplexEncoder

#include <icy/av/multiplexencoder.h>
class MultiplexEncoder

Defined in src/av/include/icy/av/multiplexencoder.h:41

Inherits: IEncoder Subclassed by: MultiplexPacketEncoder

Multiplexing encoder that writes synchronized audio and video streams.

List of all members

NameKindOwner
emittervariableDeclared here
MultiplexEncoderfunctionDeclared here
MultiplexEncoderfunctionDeclared here
MultiplexEncoderfunctionDeclared here
initfunctionDeclared here
uninitfunctionDeclared here
cleanupfunctionDeclared here
createVideofunctionDeclared here
freeVideofunctionDeclared here
encodeVideofunctionDeclared here
encodeVideofunctionDeclared here
encodeVideofunctionDeclared here
createAudiofunctionDeclared here
freeAudiofunctionDeclared here
encodeAudiofunctionDeclared here
encodeAudiofunctionDeclared here
flushfunctionDeclared here
optionsfunctionDeclared here
videofunctionDeclared here
audiofunctionDeclared here
_optionsvariableDeclared here
_formatCtxvariableDeclared here
_videovariableDeclared here
_audiovariableDeclared here
_ioCtxvariableDeclared here
_ioBuffervariableDeclared here
_ptsvariableDeclared here
_mutexvariableDeclared here
writeOutputPacketfunctionDeclared here
updateStreamPtsfunctionDeclared here
onVideoEncodedfunctionDeclared here
onAudioEncodedfunctionDeclared here
initfunctionInherited from IEncoder
uninitfunctionInherited from IEncoder
cleanupfunctionInherited from IEncoder
optionsfunctionInherited from IEncoder
createVideofunctionInherited from IEncoder
freeVideofunctionInherited from IEncoder
encodeVideofunctionInherited from IEncoder
createAudiofunctionInherited from IEncoder
freeAudiofunctionInherited from IEncoder
flushfunctionInherited from IEncoder
isNonefunctionInherited from IEncoder
isReadyfunctionInherited from IEncoder
isEncodingfunctionInherited from IEncoder
isActivefunctionInherited from IEncoder
isStoppedfunctionInherited from IEncoder
isErrorfunctionInherited from IEncoder
TypeenumInherited from IEncoder
StateChangevariableInherited from Stateful
_statevariableInherited from Stateful
StatefulfunctionInherited from Stateful
~StatefulfunctionInherited from Stateful
stateEqualsfunctionInherited from Stateful
stateBetweenfunctionInherited from Stateful
statefunctionInherited from Stateful
statefunctionInherited from Stateful
beforeStateChangefunctionInherited from Stateful
onStateChangefunctionInherited from Stateful
setStatefunctionInherited from Stateful
setStatefunctionInherited from Stateful

Inherited from IEncoder

KindNameDescription
functioninit virtualInitialise the encoder, open codec contexts, and transition to Ready or Encoding state.
functionuninit virtualFlush remaining packets, close codec contexts, and release all encoder resources.
functioncleanup virtual inlinePerform any additional cleanup after uninit(). Default is a no-op.
functionoptions virtual const nodiscard
functioncreateVideo virtual inlineInitialise the video codec context and stream.
functionfreeVideo virtual inlineFree the video codec context and stream.
functionencodeVideo virtual inline nodiscardEncode a single AVFrame of video.
functioncreateAudio virtual inlineInitialise the audio codec context and stream.
functionfreeAudio virtual inlineFree the audio codec context and stream.
functionflush virtual inlineFlush any internally buffered packets to the output.
functionisNone const inline
functionisReady const inline
functionisEncoding virtual const inline
functionisActive virtual const inline
functionisStopped virtual const inline
functionisError virtual const inline
enumType

Inherited from Stateful

KindNameDescription
variableStateChangeSignals when the state changes.
variable_state
functionStateful inline
function~Stateful virtual inline
functionstateEquals virtual const inlineReturns true if the current state ID equals the given ID.
functionstateBetween virtual const inlineReturns true if the current state ID is in the inclusive range [lid, rid].
functionstate virtual inlineReturns a mutable reference to the current state.
functionstate virtual const inlineReturns a copy of the current state.
functionbeforeStateChange virtual inlineOverride to handle pre state change logic. Return false to prevent state change.
functiononStateChange virtual inlineOverride to handle post state change logic.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.

Public Attributes

ReturnNameDescription
PacketSignalemitter

{#emitter-4}

emitter

PacketSignal emitter

Defined in src/av/include/icy/av/multiplexencoder.h:130

Public Methods

ReturnNameDescription
MultiplexEncoderConstruct the encoder with the given options.
MultiplexEncoderDeleted constructor.
MultiplexEncoderDeleted constructor.
voidinit virtual overrideOpen the output container, create codec streams, and write the format header.
voiduninit virtual overrideFlush encoded packets, write the format trailer, and close the output container.
voidcleanup virtual overrideRelease all resources allocated by init() without writing a trailer.
voidcreateVideo virtual overrideCreate the video encoder and add the stream to the output container.
voidfreeVideo virtual overrideFlush and free the video encoder and its stream.
boolencodeVideo virtual nodiscard overrideEncode a single video frame. All frame values must be set, such as size, pixel format, and PTS.
boolencodeVideo virtual nodiscardEncode a single interleaved video frame. If the frame time is specified it should be the microseconds offset since the start of the input stream. If no time is specified a real-time value will be assigned to the frame.
boolencodeVideo virtual nodiscardEncode a single planar video frame.
voidcreateAudio virtual overrideCreate the audio encoder and add the stream to the output container.
voidfreeAudio virtual overrideFlush and free the audio encoder and its stream.
boolencodeAudio virtual nodiscardEncode a single interleaved audio frame.
boolencodeAudio virtual nodiscardEncode a single planar audio frame.
voidflush virtual overrideFlush any buffered or queued packets to the output container.
const EncoderOptions &options virtual const nodiscard override
VideoEncoder *video
AudioEncoder *audio

{#multiplexencoder-1}

MultiplexEncoder

MultiplexEncoder(const EncoderOptions & options = EncoderOptions())

Defined in src/av/include/icy/av/multiplexencoder.h:46

Construct the encoder with the given options.

Parameters

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

{#multiplexencoder-2}

MultiplexEncoder

MultiplexEncoder(const MultiplexEncoder &) = delete

Defined in src/av/include/icy/av/multiplexencoder.h:49

Deleted constructor.


{#multiplexencoder-3}

MultiplexEncoder

MultiplexEncoder(MultiplexEncoder &&) = delete

Defined in src/av/include/icy/av/multiplexencoder.h:51

Deleted constructor.


{#init-1}

init

virtual override

virtual void init() override

Defined in src/av/include/icy/av/multiplexencoder.h:55

Open the output container, create codec streams, and write the format header.

Reimplements

{#uninit-1}

uninit

virtual override

virtual void uninit() override

Defined in src/av/include/icy/av/multiplexencoder.h:58

Flush encoded packets, write the format trailer, and close the output container.

Reimplements

{#cleanup-1}

cleanup

virtual override

virtual void cleanup() override

Defined in src/av/include/icy/av/multiplexencoder.h:61

Release all resources allocated by init() without writing a trailer.

Reimplements

{#createvideo-1}

createVideo

virtual override

virtual void createVideo() override

Defined in src/av/include/icy/av/multiplexencoder.h:64

Create the video encoder and add the stream to the output container.

Reimplements

{#freevideo-1}

freeVideo

virtual override

virtual void freeVideo() override

Defined in src/av/include/icy/av/multiplexencoder.h:67

Flush and free the video encoder and its stream.

Reimplements

{#encodevideo-1}

encodeVideo

virtual nodiscard override

[[nodiscard]] virtual bool encodeVideo(AVFrame * frame) override

Defined in src/av/include/icy/av/multiplexencoder.h:71

Encode a single video frame. All frame values must be set, such as size, pixel format, and PTS.

Reimplements

{#encodevideo-2}

encodeVideo

virtual nodiscard

[[nodiscard]] virtual bool encodeVideo(uint8_t * buffer, int bufferSize, int width, int height, int64_t time = AV_NOPTS_VALUE)

Defined in src/av/include/icy/av/multiplexencoder.h:83

Encode a single interleaved video frame. If the frame time is specified it should be the microseconds offset since the start of the input stream. If no time is specified a real-time value will be assigned to the frame.

Parameters

  • buffer The raw video frame buffer.

  • bufferSize The buffer size in bytes.

  • width The frame width in pixels.

  • height The frame height in pixels.

  • time The timestamp in microseconds, or AV_NOPTS_VALUE for realtime.


{#encodevideo-3}

encodeVideo

virtual nodiscard

[[nodiscard]] virtual bool encodeVideo(uint8_t * data, int linesize, int width, int height, int64_t time = AV_NOPTS_VALUE)

Defined in src/av/include/icy/av/multiplexencoder.h:93

Encode a single planar video frame.

Parameters

  • data Array of per-plane data pointers (up to 4 planes).

  • linesize Array of per-plane byte strides.

  • width The frame width in pixels.

  • height The frame height in pixels.

  • time The timestamp in microseconds, or AV_NOPTS_VALUE for realtime.


{#createaudio-1}

createAudio

virtual override

virtual void createAudio() override

Defined in src/av/include/icy/av/multiplexencoder.h:97

Create the audio encoder and add the stream to the output container.

Reimplements

{#freeaudio-1}

freeAudio

virtual override

virtual void freeAudio() override

Defined in src/av/include/icy/av/multiplexencoder.h:100

Flush and free the audio encoder and its stream.

Reimplements

{#encodeaudio}

encodeAudio

virtual nodiscard

[[nodiscard]] virtual bool encodeAudio(uint8_t * buffer, int numSamples, int64_t time = AV_NOPTS_VALUE)

Defined in src/av/include/icy/av/multiplexencoder.h:107

Encode a single interleaved audio frame.

Parameters

  • buffer The interleaved audio sample buffer.

  • numSamples The number of samples per channel.

  • time The timestamp in microseconds, or AV_NOPTS_VALUE for realtime.


{#encodeaudio-1}

encodeAudio

virtual nodiscard

[[nodiscard]] virtual bool encodeAudio(uint8_t * data, int numSamples, int64_t time = AV_NOPTS_VALUE)

Defined in src/av/include/icy/av/multiplexencoder.h:115

Encode a single planar audio frame.

Parameters

  • data Array of per-plane sample buffers (one per channel).

  • numSamples The number of samples per channel.

  • time The timestamp in microseconds, or AV_NOPTS_VALUE for realtime.


{#flush-7}

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/multiplexencoder.h:119

Flush any buffered or queued packets to the output container.

Reimplements

{#options-2}

options

virtual const nodiscard override

[[nodiscard]] virtual const EncoderOptions & options() const override

Defined in src/av/include/icy/av/multiplexencoder.h:122

Returns

A read-only view of the encoder's configuration options.

Reimplements

{#video-2}

video

VideoEncoder * video()

Defined in src/av/include/icy/av/multiplexencoder.h:125

Returns

The active VideoEncoder, or nullptr if video has not been created.


{#audio-2}

audio

AudioEncoder * audio()

Defined in src/av/include/icy/av/multiplexencoder.h:128

Returns

The active AudioEncoder, or nullptr if audio has not been created.

Protected Attributes

ReturnNameDescription
EncoderOptions_options
AVFormatContext *_formatCtx
std::unique_ptr< VideoEncoder >_video
std::unique_ptr< AudioEncoder >_audio
AVIOContext *_ioCtx
std::unique_ptr< uint8_t[]>_ioBuffer
int64_t_pts
std::mutex_mutex

{#_options}

_options

EncoderOptions _options

Defined in src/av/include/icy/av/multiplexencoder.h:144


{#_formatctx-1}

_formatCtx

AVFormatContext * _formatCtx

Defined in src/av/include/icy/av/multiplexencoder.h:145


{#_video-1}

_video

std::unique_ptr< VideoEncoder > _video

Defined in src/av/include/icy/av/multiplexencoder.h:146


{#_audio-1}

_audio

std::unique_ptr< AudioEncoder > _audio

Defined in src/av/include/icy/av/multiplexencoder.h:147


{#_ioctx}

_ioCtx

AVIOContext * _ioCtx

Defined in src/av/include/icy/av/multiplexencoder.h:148


{#_iobuffer}

_ioBuffer

std::unique_ptr< uint8_t[]> _ioBuffer

Defined in src/av/include/icy/av/multiplexencoder.h:149


{#_pts}

_pts

int64_t _pts

Defined in src/av/include/icy/av/multiplexencoder.h:150


{#_mutex-2}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/multiplexencoder.h:151

Protected Methods

ReturnNameDescription
boolwriteOutputPacket
boolupdateStreamPtsConvert input microseconds to the stream time base.
voidonVideoEncoded
voidonAudioEncoded

{#writeoutputpacket}

writeOutputPacket

bool writeOutputPacket(AVPacket & packet)

Defined in src/av/include/icy/av/multiplexencoder.h:133


{#updatestreampts}

updateStreamPts

bool updateStreamPts(AVStream * stream, int64_t * pts)

Defined in src/av/include/icy/av/multiplexencoder.h:139

Convert input microseconds to the stream time base.

Parameters

  • stream The target stream for time base conversion.

  • pts Pointer to the timestamp; converted in place.


{#onvideoencoded}

onVideoEncoded

void onVideoEncoded(av::VideoPacket & packet)

Defined in src/av/include/icy/av/multiplexencoder.h:141


{#onaudioencoded}

onAudioEncoded

void onAudioEncoded(av::AudioPacket & packet)

Defined in src/av/include/icy/av/multiplexencoder.h:142

{#audiopacketencoder}

AudioPacketEncoder

#include <icy/av/audiopacketencoder.h>
class AudioPacketEncoder

Defined in src/av/include/icy/av/audiopacketencoder.h:44

Inherits: AudioEncoder, PacketProcessor

PacketProcessor that encodes raw audio samples (PlanarAudioPacket or AudioPacket) into compressed packets via AudioEncoder.

Drop this into a PacketStream between a source that emits raw audio (e.g. MediaCapture) and a sink that expects encoded data (e.g. WebRtcTrackSender or MultiplexPacketEncoder).

Example:

auto encoder = std::make_sharedav::AudioPacketEncoder(); encoder->oparams = av::AudioCodec("opus", "libopus", 2, 48000);

PacketStream stream; stream.attachSource(capture); stream.attach(encoder, 1, true); stream.attach(&webrtcSender, 5, false); stream.start();

List of all members

NameKindOwner
PacketStreamfriendDeclared here
AudioPacketEncoderfunctionDeclared here
AudioPacketEncoderfunctionDeclared here
processfunctionDeclared here
acceptsfunctionDeclared here
_initializedvariableDeclared here
_mutexvariableDeclared here
onStreamStateChangefunctionDeclared here
fifovariableInherited from AudioEncoder
formatvariableInherited from AudioEncoder
nextOutputPtsvariableInherited from AudioEncoder
AudioEncoderfunctionInherited from AudioEncoder
createfunctionInherited from AudioEncoder
closefunctionInherited from AudioEncoder
encodefunctionInherited from AudioEncoder
encodefunctionInherited from AudioEncoder
encodefunctionInherited from AudioEncoder
flushfunctionInherited from AudioEncoder
emittervariableInherited from AudioContext
iparamsvariableInherited from AudioContext
oparamsvariableInherited from AudioContext
streamvariableInherited from AudioContext
ctxvariableInherited from AudioContext
codecvariableInherited from AudioContext
framevariableInherited from AudioContext
resamplervariableInherited from AudioContext
outputFrameSizevariableInherited from AudioContext
timevariableInherited from AudioContext
ptsvariableInherited from AudioContext
secondsvariableInherited from AudioContext
errorvariableInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
createfunctionInherited from AudioContext
openfunctionInherited from AudioContext
closefunctionInherited from AudioContext
decodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
flushfunctionInherited from AudioContext
recreateResamplerfunctionInherited from AudioContext
PacketProcessorfunctionInherited from PacketProcessor
processfunctionInherited from PacketProcessor
acceptsfunctionInherited from PacketProcessor
operator<<functionInherited from PacketProcessor
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter

Inherited from AudioEncoder

KindNameDescription
variablefifo
variableformat
variablenextOutputPtsRunning PTS counter for encoder output, in encoder time_base units. Anchored to the first input packet's PTS, then advanced by frame->nb_samples per encoded frame. AV_NOPTS_VALUE before anchoring.
functionAudioEncoderConstruct an encoder, optionally tied to an existing muxer context.
functioncreate virtual overrideInitialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction.
functionclose virtual overrideClose and free the AVCodecContext, FIFO buffer, and associated resources.
functionencode virtual nodiscard overrideEncode interleaved audio samples.
functionencode virtual nodiscard overrideEncode planar audio samples.
functionencode virtual nodiscard overrideEncode a single AVFrame (typically from a decoder or resampler).
functionflush virtual overrideFlush remaining packets to be encoded. This method should be called once before stream closure.

Inherited from AudioContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframelast encoded or decoded frame
variableresampleraudio resampler
variableoutputFrameSizeencoder or decoder output frame size
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsaudio time in seconds
variableerrorerror message
functionAudioContext
functionAudioContextDeleted constructor.
functionAudioContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder.
functionopen virtualOpen the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed audio packet and emit the resulting samples.
functionencode virtual nodiscardEncode a buffer of interleaved audio samples.
functionencode virtual nodiscardEncode a buffer of planar audio samples.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionrecreateResampler virtualRecreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required.

Inherited from PacketProcessor

KindNameDescription
functionPacketProcessor inline
functionprocess virtualThis method performs processing on the given packet and emits the result.
functionaccepts virtual inlineThis method ensures compatibility with the given packet type. Return false to reject the packet.
functionoperator<< virtual inlineStream operator alias for process().

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Friends

NameDescription
PacketStream

{#packetstream-1}

PacketStream

friend class PacketStream

Defined in src/av/include/icy/av/audiopacketencoder.h:64

Public Methods

ReturnNameDescription
AudioPacketEncoder
AudioPacketEncoderDeleted constructor.
voidprocess virtual overrideProcess an AudioPacket or PlanarAudioPacket from the stream. Encodes the samples and emits the resulting compressed packet.
boolaccepts virtual overrideAccept AudioPacket and PlanarAudioPacket types.

{#audiopacketencoder-1}

AudioPacketEncoder

AudioPacketEncoder(AVFormatContext * format = nullptr)

Defined in src/av/include/icy/av/audiopacketencoder.h:48


{#audiopacketencoder-2}

AudioPacketEncoder

AudioPacketEncoder(const AudioPacketEncoder &) = delete

Defined in src/av/include/icy/av/audiopacketencoder.h:51

Deleted constructor.


{#process-2}

process

virtual override

virtual void process(IPacket & packet) override

Defined in src/av/include/icy/av/audiopacketencoder.h:56

Process an AudioPacket or PlanarAudioPacket from the stream. Encodes the samples and emits the resulting compressed packet.

Reimplements

{#accepts}

accepts

virtual override

virtual bool accepts(IPacket * packet) override

Defined in src/av/include/icy/av/audiopacketencoder.h:59

Accept AudioPacket and PlanarAudioPacket types.

Reimplements

Protected Attributes

ReturnNameDescription
bool_initialized
std::mutex_mutex

{#_initialized}

_initialized

bool _initialized = false

Defined in src/av/include/icy/av/audiopacketencoder.h:66


{#_mutex-3}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/audiopacketencoder.h:67

Protected Methods

ReturnNameDescription
voidonStreamStateChange virtual overrideCalled 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-2}

onStreamStateChange

virtual override

virtual void onStreamStateChange(const PacketStreamState & state) override

Defined in src/av/include/icy/av/audiopacketencoder.h:62

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.

Reimplements

{#videopacketencoder}

VideoPacketEncoder

#include <icy/av/videopacketencoder.h>
class VideoPacketEncoder

Defined in src/av/include/icy/av/videopacketencoder.h:45

Inherits: VideoEncoder, PacketProcessor

PacketProcessor that encodes raw video frames (PlanarVideoPacket or VideoPacket) into compressed packets via VideoEncoder.

Drop this into a PacketStream between a source that emits raw frames (e.g. MediaCapture) and a sink that expects encoded data (e.g. WebRtcTrackSender or MultiplexPacketEncoder).

Example:

auto encoder = std::make_sharedav::VideoPacketEncoder(); encoder->iparams = capture->videoCodec(); // decoded format encoder->oparams = av::VideoCodec("H264", "libx264", 640, 480, 30);

PacketStream stream; stream.attachSource(capture); stream.attach(encoder, 1, true); stream.attach(&webrtcSender, 5, false); stream.start();

List of all members

NameKindOwner
PacketStreamfriendDeclared here
VideoPacketEncoderfunctionDeclared here
VideoPacketEncoderfunctionDeclared here
processfunctionDeclared here
acceptsfunctionDeclared here
_initializedvariableDeclared here
_mutexvariableDeclared here
onStreamStateChangefunctionDeclared here
formatvariableInherited from VideoEncoder
VideoEncoderfunctionInherited from VideoEncoder
createfunctionInherited from VideoEncoder
closefunctionInherited from VideoEncoder
encodefunctionInherited from VideoEncoder
encodefunctionInherited from VideoEncoder
encodefunctionInherited from VideoEncoder
flushfunctionInherited from VideoEncoder
emittervariableInherited from VideoContext
iparamsvariableInherited from VideoContext
oparamsvariableInherited from VideoContext
streamvariableInherited from VideoContext
ctxvariableInherited from VideoContext
codecvariableInherited from VideoContext
framevariableInherited from VideoContext
convvariableInherited from VideoContext
timevariableInherited from VideoContext
ptsvariableInherited from VideoContext
secondsvariableInherited from VideoContext
errorvariableInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
createfunctionInherited from VideoContext
openfunctionInherited from VideoContext
closefunctionInherited from VideoContext
decodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
flushfunctionInherited from VideoContext
convertfunctionInherited from VideoContext
recreateConverterfunctionInherited from VideoContext
PacketProcessorfunctionInherited from PacketProcessor
processfunctionInherited from PacketProcessor
acceptsfunctionInherited from PacketProcessor
operator<<functionInherited from PacketProcessor
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter

Inherited from VideoEncoder

KindNameDescription
variableformat
functionVideoEncoderConstruct an encoder, optionally tied to an existing muxer context.
functioncreate virtual overrideInitialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.
functionclose virtual overrideClose and free the AVCodecContext and associated resources.
functionencode virtual nodiscard overrideEncode a single video frame. This method is for interleaved video formats.
functionencode virtual nodiscard overrideEncode a single video frame. This method is for planar video formats.
functionencode virtual nodiscard overrideEncode a single AVFrame (typically from a decoder or converter).
functionflush virtual overrideFlush remaining packets to be encoded. This method should be called once before stream closure.

Inherited from VideoContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframeencoder or decoder frame
variableconvvideo conversion context
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsvideo time in seconds
variableerrorerror message
functionVideoContext
functionVideoContextDeleted constructor.
functionVideoContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
functionopen virtualOpen the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed video packet and emit the resulting frame.
functionencode virtual nodiscardEncode a buffer of interleaved video data.
functionencode virtual nodiscardEncode a planar video frame.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionconvert virtualConvert the video frame and return the result.
functionrecreateConverter virtualRecreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

Inherited from PacketProcessor

KindNameDescription
functionPacketProcessor inline
functionprocess virtualThis method performs processing on the given packet and emits the result.
functionaccepts virtual inlineThis method ensures compatibility with the given packet type. Return false to reject the packet.
functionoperator<< virtual inlineStream operator alias for process().

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Friends

NameDescription
PacketStream

{#packetstream-2}

PacketStream

friend class PacketStream

Defined in src/av/include/icy/av/videopacketencoder.h:65

Public Methods

ReturnNameDescription
VideoPacketEncoder
VideoPacketEncoderDeleted constructor.
voidprocess virtual overrideProcess a VideoPacket or PlanarVideoPacket from the stream. Encodes the frame and emits the resulting compressed packet.
boolaccepts virtual overrideAccept VideoPacket and PlanarVideoPacket types.

{#videopacketencoder-1}

VideoPacketEncoder

VideoPacketEncoder(AVFormatContext * format = nullptr)

Defined in src/av/include/icy/av/videopacketencoder.h:49


{#videopacketencoder-2}

VideoPacketEncoder

VideoPacketEncoder(const VideoPacketEncoder &) = delete

Defined in src/av/include/icy/av/videopacketencoder.h:52

Deleted constructor.


{#process-3}

process

virtual override

virtual void process(IPacket & packet) override

Defined in src/av/include/icy/av/videopacketencoder.h:57

Process a VideoPacket or PlanarVideoPacket from the stream. Encodes the frame and emits the resulting compressed packet.

Reimplements

{#accepts-1}

accepts

virtual override

virtual bool accepts(IPacket * packet) override

Defined in src/av/include/icy/av/videopacketencoder.h:60

Accept VideoPacket and PlanarVideoPacket types.

Reimplements

Protected Attributes

ReturnNameDescription
bool_initialized
std::mutex_mutex

{#_initialized-1}

_initialized

bool _initialized = false

Defined in src/av/include/icy/av/videopacketencoder.h:67


{#_mutex-4}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/videopacketencoder.h:68

Protected Methods

ReturnNameDescription
voidonStreamStateChange virtual overrideCalled 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-3}

onStreamStateChange

virtual override

virtual void onStreamStateChange(const PacketStreamState & state) override

Defined in src/av/include/icy/av/videopacketencoder.h:63

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.

Reimplements

{#realtimepacketqueue}

RealtimePacketQueue

#include <icy/av/realtimepacketqueue.h>
template<class PacketT>
class RealtimePacketQueue

Defined in src/av/include/icy/av/realtimepacketqueue.h:30

Inherits: AsyncPacketQueue< PacketT >

Queue that emits media packets in presentation-timestamp order relative to a realtime clock.

Packets are sorted by their [time](base.md#time-3) field on insertion. On each pop attempt the queue checks whether the wall-clock time since stream activation has reached the next packet's timestamp; if not, the packet is held back. This provides a soft realtime playback scheduler.

List of all members

NameKindOwner
RealtimePacketQueuefunctionDeclared here
pushfunctionDeclared here
realTimefunctionDeclared here
_startTimevariableDeclared here
popNextfunctionDeclared here
onStreamStateChangefunctionDeclared here
BaseQueuetypedefDeclared here
QueuetypedefInherited from AsyncPacketQueue
ProcessortypedefInherited from AsyncPacketQueue
emittervariableInherited from AsyncPacketQueue
AsyncPacketQueuefunctionInherited from AsyncPacketQueue
~AsyncPacketQueuefunctionInherited from AsyncPacketQueue
closefunctionInherited from AsyncPacketQueue
processfunctionInherited from AsyncPacketQueue
acceptsfunctionInherited from AsyncPacketQueue
retentionfunctionInherited from AsyncPacketQueue
dispatchfunctionInherited from AsyncPacketQueue
onStreamStateChangefunctionInherited from AsyncPacketQueue
QueuetypedefInherited from AsyncQueue
_threadvariableInherited from AsyncQueue
AsyncQueuefunctionInherited from AsyncQueue
cancelfunctionInherited from AsyncQueue
~AsyncQueuefunctionInherited from AsyncQueue
ondispatchvariableInherited from RunnableQueue
_limitvariableInherited from RunnableQueue
_timeoutvariableInherited from RunnableQueue
_droppedvariableInherited from RunnableQueue
RunnableQueuefunctionInherited from RunnableQueue
~RunnableQueuefunctionInherited from RunnableQueue
pushfunctionInherited from RunnableQueue
flushfunctionInherited from RunnableQueue
clearfunctionInherited from RunnableQueue
runfunctionInherited from RunnableQueue
runTimeoutfunctionInherited from RunnableQueue
dispatchfunctionInherited from RunnableQueue
timeoutfunctionInherited from RunnableQueue
setTimeoutfunctionInherited from RunnableQueue
droppedfunctionInherited from RunnableQueue
RunnableQueuefunctionInherited from RunnableQueue
operator=functionInherited from RunnableQueue
RunnableQueuefunctionInherited from RunnableQueue
operator=functionInherited from RunnableQueue
popNextfunctionInherited from RunnableQueue
dispatchNextfunctionInherited from RunnableQueue
_queuevariableInherited from Queue
_mutexvariableInherited from Queue
pushfunctionInherited from Queue
pushfunctionInherited from Queue
emptyfunctionInherited from Queue
frontfunctionInherited from Queue
backfunctionInherited from Queue
popfunctionInherited from Queue
sortfunctionInherited from Queue
sizefunctionInherited from Queue
queuefunctionInherited from Queue
RunnablefunctionInherited from Runnable
runfunctionInherited from Runnable
cancelfunctionInherited from Runnable
cancelledfunctionInherited from Runnable
exitvariableInherited from Runnable
PacketProcessorfunctionInherited from PacketProcessor
processfunctionInherited from PacketProcessor
acceptsfunctionInherited from PacketProcessor
operator<<functionInherited from PacketProcessor
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter

Inherited from AsyncPacketQueue

KindNameDescription
typedefQueue
typedefProcessor
variableemitter
functionAsyncPacketQueue inline
function~AsyncPacketQueue virtual inline
functionclose virtual inlineFlushes remaining packets, cancels the queue, and joins the dispatch thread.
functionprocess virtual inline overrideClones the incoming packet and pushes it onto the async queue. This queue is therefore an explicit PacketStream ownership boundary. Drops the packet with a warning if the queue has been cancelled.
functionaccepts virtual inline overrideReturns true if the packet can be cast to type T.
functionretention virtual const inline nodiscard overrideReturns 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.
functiondispatch inline overrideEmits the packet to downstream processors from the async thread.
functiononStreamStateChange virtual inline overrideCloses the queue on [Error](base.md#error) or Closed stream state transitions.

Inherited from AsyncQueue

KindNameDescription
typedefQueue
variable_thread
functionAsyncQueue inline
functioncancel virtual inline overrideCancels the queue and joins the dispatch thread.
function~AsyncQueue virtual inline

Inherited from RunnableQueue

KindNameDescription
variableondispatchThe default dispatch function. Must be set before the queue is running.
variable_limit
variable_timeout
variable_dropped
functionRunnableQueue inline
function~RunnableQueue virtual inline
functionpush virtual inlinePush an item onto the queue. The queue takes ownership of the item pointer.
functionflush virtual inlineFlush all outgoing items.
functionclear inline
functionrun virtual inline overrideCalled asynchronously to dispatch queued items. If not timeout is set this method blocks until cancel() is called, otherwise runTimeout() will be called.
functionrunTimeout virtual inlineCalled asynchronously to dispatch queued items until the queue is empty or the timeout expires. Pseudo protected for std::bind compatability.
functiondispatch virtual inlineDispatch a single item to listeners.
functiontimeout inline
functionsetTimeout inlineSets the dispatch timeout. Must only be called when the queue is empty.
functiondropped const inline
functionRunnableQueueDeleted constructor.
functionoperator=Deleted assignment operator.
functionRunnableQueueDeleted constructor.
functionoperator=Deleted assignment operator.
functionpopNext virtual inlinePops the next waiting item.
functiondispatchNext virtual inlinePops and dispatches the next waiting item.

Inherited from Queue

KindNameDescription
variable_queue
variable_mutex
functionpush inlineAppends an item to the back of the queue (thread-safe).
functionpush inlineAppends an item to the back of the queue by move (thread-safe).
functionempty const inline
functionfront const inline
functionback const inline
functionpop inlineRemoves the front item from the queue (thread-safe).
functionsort inlineSorts all queued items using the given comparator (thread-safe).
functionsize const inline
functionqueue const inline

Inherited from Runnable

KindNameDescription
functionRunnable inline
functionrun virtualThe run method will be called by the asynchronous context.
functioncancel virtual inlineCancel the current task. The run() method should return ASAP.
functioncancelled virtual const inlineReturns true when the task has been cancelled.
variableexit

Inherited from PacketProcessor

KindNameDescription
functionPacketProcessor inline
functionprocess virtualThis method performs processing on the given packet and emits the result.
functionaccepts virtual inlineThis method ensures compatibility with the given packet type. Return false to reject the packet.
functionoperator<< virtual inlineStream operator alias for process().

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Public Methods

ReturnNameDescription
RealtimePacketQueue inlineConstruct the queue with a maximum capacity.
voidpush virtual inline overrideInsert a packet into the queue and re-sort by presentation timestamp.
int64_trealTime inlineReturn the elapsed time since stream activation in microseconds.

{#realtimepacketqueue-1}

RealtimePacketQueue

inline

inline RealtimePacketQueue(int maxSize = 1024)

Defined in src/av/include/icy/av/realtimepacketqueue.h:37

Construct the queue with a maximum capacity.

Parameters

  • maxSize The maximum number of packets the queue will hold.

{#push}

push

virtual inline override

virtual inline void push(PacketT * item) override

Defined in src/av/include/icy/av/realtimepacketqueue.h:48

Insert a packet into the queue and re-sort by presentation timestamp.

Parameters

  • item The packet to enqueue; ownership is transferred.

{#realtime}

realTime

inline

inline int64_t realTime()

Defined in src/av/include/icy/av/realtimepacketqueue.h:55

Return the elapsed time since stream activation in microseconds.

Protected Attributes

ReturnNameDescription
int64_t_startTime

{#_starttime}

_startTime

int64_t _startTime

Defined in src/av/include/icy/av/realtimepacketqueue.h:98

Protected Methods

ReturnNameDescription
PacketT *popNext virtual inline overrideReturn the next packet whose timestamp is <= realTime(), or nullptr if none is ready.
voidonStreamStateChange virtual inline overrideRecord the stream start time when the stream becomes active.

{#popnext}

popNext

virtual inline override

virtual inline PacketT * popNext() override

Defined in src/av/include/icy/av/realtimepacketqueue.h:62

Return the next packet whose timestamp is <= realTime(), or nullptr if none is ready.

Reimplements

{#onstreamstatechange-4}

onStreamStateChange

virtual inline override

virtual inline void onStreamStateChange(const PacketStreamState & state) override

Defined in src/av/include/icy/av/realtimepacketqueue.h:78

Record the stream start time when the stream becomes active.

Reimplements

Public Types

NameDescription
BaseQueue

{#basequeue}

BaseQueue

using BaseQueue = AsyncPacketQueue< PacketT >

Defined in src/av/include/icy/av/realtimepacketqueue.h:33

{#mediapackettimecompare}

MediaPacketTimeCompare

#include <icy/av/realtimepacketqueue.h>
struct MediaPacketTimeCompare

Defined in src/av/include/icy/av/realtimepacketqueue.h:90

Comparator for ordering media packets by presentation timestamp.

List of all members

NameKindOwner
operator()functionDeclared here

Public Methods

ReturnNameDescription
booloperator() inline

{#operator-3}

operator()

inline

inline bool operator()(const MediaPacket * a, const MediaPacket * b)

Defined in src/av/include/icy/av/realtimepacketqueue.h:92

{#multiplexpacketencoder}

MultiplexPacketEncoder

#include <icy/av/multiplexpacketencoder.h>
class MultiplexPacketEncoder

Defined in src/av/include/icy/av/multiplexpacketencoder.h:28

Inherits: MultiplexEncoder, PacketProcessor

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

List of all members

NameKindOwner
PacketStreamfriendDeclared here
MultiplexPacketEncoderfunctionDeclared here
MultiplexPacketEncoderfunctionDeclared here
MultiplexPacketEncoderfunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
acceptsfunctionDeclared here
processfunctionDeclared here
_mutexvariableDeclared here
onStreamStateChangefunctionDeclared here
emittervariableInherited from MultiplexEncoder
MultiplexEncoderfunctionInherited from MultiplexEncoder
MultiplexEncoderfunctionInherited from MultiplexEncoder
MultiplexEncoderfunctionInherited from MultiplexEncoder
initfunctionInherited from MultiplexEncoder
uninitfunctionInherited from MultiplexEncoder
cleanupfunctionInherited from MultiplexEncoder
createVideofunctionInherited from MultiplexEncoder
freeVideofunctionInherited from MultiplexEncoder
encodeVideofunctionInherited from MultiplexEncoder
encodeVideofunctionInherited from MultiplexEncoder
encodeVideofunctionInherited from MultiplexEncoder
createAudiofunctionInherited from MultiplexEncoder
freeAudiofunctionInherited from MultiplexEncoder
encodeAudiofunctionInherited from MultiplexEncoder
encodeAudiofunctionInherited from MultiplexEncoder
flushfunctionInherited from MultiplexEncoder
optionsfunctionInherited from MultiplexEncoder
videofunctionInherited from MultiplexEncoder
audiofunctionInherited from MultiplexEncoder
_optionsvariableInherited from MultiplexEncoder
_formatCtxvariableInherited from MultiplexEncoder
_videovariableInherited from MultiplexEncoder
_audiovariableInherited from MultiplexEncoder
_ioCtxvariableInherited from MultiplexEncoder
_ioBuffervariableInherited from MultiplexEncoder
_ptsvariableInherited from MultiplexEncoder
_mutexvariableInherited from MultiplexEncoder
writeOutputPacketfunctionInherited from MultiplexEncoder
updateStreamPtsfunctionInherited from MultiplexEncoder
onVideoEncodedfunctionInherited from MultiplexEncoder
onAudioEncodedfunctionInherited from MultiplexEncoder
initfunctionInherited from IEncoder
uninitfunctionInherited from IEncoder
cleanupfunctionInherited from IEncoder
optionsfunctionInherited from IEncoder
createVideofunctionInherited from IEncoder
freeVideofunctionInherited from IEncoder
encodeVideofunctionInherited from IEncoder
createAudiofunctionInherited from IEncoder
freeAudiofunctionInherited from IEncoder
flushfunctionInherited from IEncoder
isNonefunctionInherited from IEncoder
isReadyfunctionInherited from IEncoder
isEncodingfunctionInherited from IEncoder
isActivefunctionInherited from IEncoder
isStoppedfunctionInherited from IEncoder
isErrorfunctionInherited from IEncoder
TypeenumInherited from IEncoder
StateChangevariableInherited from Stateful
_statevariableInherited from Stateful
StatefulfunctionInherited from Stateful
~StatefulfunctionInherited from Stateful
stateEqualsfunctionInherited from Stateful
stateBetweenfunctionInherited from Stateful
statefunctionInherited from Stateful
statefunctionInherited from Stateful
beforeStateChangefunctionInherited from Stateful
onStateChangefunctionInherited from Stateful
setStatefunctionInherited from Stateful
setStatefunctionInherited from Stateful
PacketProcessorfunctionInherited from PacketProcessor
processfunctionInherited from PacketProcessor
acceptsfunctionInherited from PacketProcessor
operator<<functionInherited from PacketProcessor
_emittervariableInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
~PacketStreamAdapterfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
emitfunctionInherited from PacketStreamAdapter
getEmitterfunctionInherited from PacketStreamAdapter
retentionfunctionInherited from PacketStreamAdapter
onStreamStateChangefunctionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter
PacketStreamAdapterfunctionInherited from PacketStreamAdapter
operator=functionInherited from PacketStreamAdapter

Inherited from MultiplexEncoder

KindNameDescription
variableemitter
functionMultiplexEncoderConstruct the encoder with the given options.
functionMultiplexEncoderDeleted constructor.
functionMultiplexEncoderDeleted constructor.
functioninit virtual overrideOpen the output container, create codec streams, and write the format header.
functionuninit virtual overrideFlush encoded packets, write the format trailer, and close the output container.
functioncleanup virtual overrideRelease all resources allocated by init() without writing a trailer.
functioncreateVideo virtual overrideCreate the video encoder and add the stream to the output container.
functionfreeVideo virtual overrideFlush and free the video encoder and its stream.
functionencodeVideo virtual nodiscard overrideEncode a single video frame. All frame values must be set, such as size, pixel format, and PTS.
functionencodeVideo virtual nodiscardEncode a single interleaved video frame. If the frame time is specified it should be the microseconds offset since the start of the input stream. If no time is specified a real-time value will be assigned to the frame.
functionencodeVideo virtual nodiscardEncode a single planar video frame.
functioncreateAudio virtual overrideCreate the audio encoder and add the stream to the output container.
functionfreeAudio virtual overrideFlush and free the audio encoder and its stream.
functionencodeAudio virtual nodiscardEncode a single interleaved audio frame.
functionencodeAudio virtual nodiscardEncode a single planar audio frame.
functionflush virtual overrideFlush any buffered or queued packets to the output container.
functionoptions virtual const nodiscard override
functionvideo
functionaudio
variable_options
variable_formatCtx
variable_video
variable_audio
variable_ioCtx
variable_ioBuffer
variable_pts
variable_mutex
functionwriteOutputPacket
functionupdateStreamPtsConvert input microseconds to the stream time base.
functiononVideoEncoded
functiononAudioEncoded

Inherited from IEncoder

KindNameDescription
functioninit virtualInitialise the encoder, open codec contexts, and transition to Ready or Encoding state.
functionuninit virtualFlush remaining packets, close codec contexts, and release all encoder resources.
functioncleanup virtual inlinePerform any additional cleanup after uninit(). Default is a no-op.
functionoptions virtual const nodiscard
functioncreateVideo virtual inlineInitialise the video codec context and stream.
functionfreeVideo virtual inlineFree the video codec context and stream.
functionencodeVideo virtual inline nodiscardEncode a single AVFrame of video.
functioncreateAudio virtual inlineInitialise the audio codec context and stream.
functionfreeAudio virtual inlineFree the audio codec context and stream.
functionflush virtual inlineFlush any internally buffered packets to the output.
functionisNone const inline
functionisReady const inline
functionisEncoding virtual const inline
functionisActive virtual const inline
functionisStopped virtual const inline
functionisError virtual const inline
enumType

Inherited from Stateful

KindNameDescription
variableStateChangeSignals when the state changes.
variable_state
functionStateful inline
function~Stateful virtual inline
functionstateEquals virtual const inlineReturns true if the current state ID equals the given ID.
functionstateBetween virtual const inlineReturns true if the current state ID is in the inclusive range [lid, rid].
functionstate virtual inlineReturns a mutable reference to the current state.
functionstate virtual const inlineReturns a copy of the current state.
functionbeforeStateChange virtual inlineOverride to handle pre state change logic. Return false to prevent state change.
functiononStateChange virtual inlineOverride to handle post state change logic.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.

Inherited from PacketProcessor

KindNameDescription
functionPacketProcessor inline
functionprocess virtualThis method performs processing on the given packet and emits the result.
functionaccepts virtual inlineThis method ensures compatibility with the given packet type. Return false to reject the packet.
functionoperator<< virtual inlineStream operator alias for process().

Inherited from PacketStreamAdapter

KindNameDescription
variable_emitter
functionPacketStreamAdapterConstruct the adapter, binding it to the given packet signal.
function~PacketStreamAdapter virtual inline
functionemit virtualEmit a mutable raw buffer as a packet.
functionemit virtualEmit a read-only raw buffer as a packet (data is copied internally).
functionemit virtualEmit a string as a packet (data is copied internally).
functionemit virtualEmit a flag-only packet carrying no payload data.
functionemit virtualEmit an existing packet directly onto the outgoing signal.
functiongetEmitterReturns a reference to the outgoing packet signal.
functionretention virtual const nodiscardReturns 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.
functiononStreamStateChange virtual inlineCalled 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.
functionPacketStreamAdapterNonCopyable and NonMovable.
functionoperator=Deleted assignment operator.
functionPacketStreamAdapterDeleted constructor.
functionoperator=Deleted assignment operator.

Friends

NameDescription
PacketStream

{#packetstream-3}

PacketStream

friend class PacketStream

Defined in src/av/include/icy/av/multiplexpacketencoder.h:61

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 override
voidprocess virtual overrideDispatch the incoming packet to encode(VideoPacket&) or encode(AudioPacket&). Throws std::invalid_argument if the packet type is unrecognised.

{#multiplexpacketencoder-1}

MultiplexPacketEncoder

MultiplexPacketEncoder(const EncoderOptions & options = EncoderOptions())

Defined in src/av/include/icy/av/multiplexpacketencoder.h:34

Construct the encoder with the given options.

Parameters

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

{#multiplexpacketencoder-2}

MultiplexPacketEncoder

MultiplexPacketEncoder(const MultiplexPacketEncoder &) = delete

Defined in src/av/include/icy/av/multiplexpacketencoder.h:37

Deleted constructor.


{#multiplexpacketencoder-3}

MultiplexPacketEncoder

MultiplexPacketEncoder(MultiplexPacketEncoder &&) = delete

Defined in src/av/include/icy/av/multiplexpacketencoder.h:39

Deleted constructor.


{#encode-12}

encode

virtual

virtual void encode(VideoPacket & packet)

Defined in src/av/include/icy/av/multiplexpacketencoder.h:44

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

Parameters

  • packet The video packet to encode.

{#encode-13}

encode

virtual

virtual void encode(AudioPacket & packet)

Defined in src/av/include/icy/av/multiplexpacketencoder.h:48

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

Parameters

  • packet The audio packet to encode.

{#accepts-2}

accepts

virtual override

virtual bool accepts(IPacket * packet) override

Defined in src/av/include/icy/av/multiplexpacketencoder.h:51

Returns

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

Reimplements

{#process-4}

process

virtual override

virtual void process(IPacket & packet) override

Defined in src/av/include/icy/av/multiplexpacketencoder.h:56

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.
Reimplements

Protected Attributes

ReturnNameDescription
std::mutex_mutex

{#_mutex-5}

_mutex

std::mutex _mutex

Defined in src/av/include/icy/av/multiplexpacketencoder.h:63

Protected Methods

ReturnNameDescription
voidonStreamStateChange virtual overrideCalled 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-5}

onStreamStateChange

virtual override

virtual void onStreamStateChange(const PacketStreamState & state) override

Defined in src/av/include/icy/av/multiplexpacketencoder.h:59

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.

Reimplements

{#codec}

Codec

#include <icy/av/codec.h>
struct Codec

Defined in src/av/include/icy/av/codec.h:29

Subclassed by: AudioCodec, VideoCodec

Codec for encoding/decoding media.

List of all members

NameKindOwner
namevariableDeclared here
encodervariableDeclared here
sampleRatevariableDeclared here
bitRatevariableDeclared here
qualityvariableDeclared here
compliancevariableDeclared here
enabledvariableDeclared here
optionsvariableDeclared here
CodecfunctionDeclared here
CodecfunctionDeclared here
CodecfunctionDeclared here
~CodecfunctionDeclared here
toStringfunctionDeclared here
specifiedfunctionDeclared here
printfunctionDeclared here

Public Attributes

ReturnNameDescription
std::stringnameThe display name for this codec.
std::stringencoderThe encoder name for FFmpeg.
intsampleRateThe sampling rate or RTP clock rate.
intbitRateThe bit rate to encode at.
intqualityOptional quality value, variable range depending on codec.
intcomplianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
boolenabledWeather or not the codec is available for use.
std::map< std::string, std::string >optionsArbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.

{#name}

name

std::string name

Defined in src/av/include/icy/av/codec.h:34

The display name for this codec.


{#encoder}

encoder

std::string encoder

Defined in src/av/include/icy/av/codec.h:35

The encoder name for FFmpeg.


{#samplerate}

sampleRate

int sampleRate

Defined in src/av/include/icy/av/codec.h:36

The sampling rate or RTP clock rate.


{#bitrate}

bitRate

int bitRate

Defined in src/av/include/icy/av/codec.h:37

The bit rate to encode at.


{#quality}

quality

int quality

Defined in src/av/include/icy/av/codec.h:38

Optional quality value, variable range depending on codec.


{#compliance}

compliance

int compliance

Defined in src/av/include/icy/av/codec.h:39

FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).


{#enabled}

enabled

bool enabled

Defined in src/av/include/icy/av/codec.h:40

Weather or not the codec is available for use.


{#options}

options

std::map< std::string, std::string > options

Defined in src/av/include/icy/av/codec.h:45

Arbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.

Public Methods

ReturnNameDescription
CodecConstruct a disabled codec with zeroed parameters.
CodecConstruct a codec with a display name, sample rate, bit rate, and enabled flag.
CodecConstruct a codec with an explicit FFmpeg encoder name.
~Codec virtual noexceptCodec(const Codec& r);.
std::stringtoString virtual constReturn a compact string representation of this codec.
boolspecified const nodiscardReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
voidprint virtualPrint a multi-line human-readable description to the given stream.

{#codec-1}

Codec

Codec()

Defined in src/av/include/icy/av/codec.h:51

Construct a disabled codec with zeroed parameters.


{#codec-2}

Codec

Codec(const std::string & name, int sampleRate = 0, int bitRate = 0, bool enabled = true)

Defined in src/av/include/icy/av/codec.h:58

Construct a codec with a display name, sample rate, bit rate, and enabled flag.

Parameters

  • name The codec display name.

  • sampleRate The sampling rate or RTP clock rate in Hz.

  • bitRate The target bit rate in bits per second.

  • enabled Whether the codec is available for use.


{#codec-3}

Codec

Codec(const std::string & name, const std::string & encoder, int sampleRate = 0, int bitRate = 0, bool enabled = true)

Defined in src/av/include/icy/av/codec.h:67

Construct a codec with an explicit FFmpeg encoder name.

Parameters

  • name The codec display name.

  • encoder The FFmpeg encoder name (e.g. "libx264").

  • sampleRate The sampling rate or RTP clock rate in Hz.

  • bitRate The target bit rate in bits per second.

  • enabled Whether the codec is available for use.


{#codec-4}

~Codec

virtual noexcept

virtual ~Codec() noexcept

Defined in src/av/include/icy/av/codec.h:70

Codec(const Codec& r);.


{#tostring}

toString

virtual const

virtual std::string toString() const

Defined in src/av/include/icy/av/codec.h:77

Return a compact string representation of this codec.

Returns

A string in the form "Codec[name:encoder:sampleRate:enabled]".

Reimplemented by

{#specified}

specified

const nodiscard

[[nodiscard]] bool specified() const

Defined in src/av/include/icy/av/codec.h:81

Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.


{#print}

virtual

virtual void print(std::ostream & ost)

Defined in src/av/include/icy/av/codec.h:85

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.
Reimplemented by

{#audiocodec}

AudioCodec

#include <icy/av/codec.h>
struct AudioCodec

Defined in src/av/include/icy/av/codec.h:102

Inherits: Codec

Audio codec parameters including channels, sample rate, and sample format.

List of all members

NameKindOwner
channelsvariableDeclared here
sampleFmtvariableDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
AudioCodecfunctionDeclared here
toStringfunctionDeclared here
printfunctionDeclared here
namevariableInherited from Codec
encodervariableInherited from Codec
sampleRatevariableInherited from Codec
bitRatevariableInherited from Codec
qualityvariableInherited from Codec
compliancevariableInherited from Codec
enabledvariableInherited from Codec
optionsvariableInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
~CodecfunctionInherited from Codec
toStringfunctionInherited from Codec
specifiedfunctionInherited from Codec
printfunctionInherited from Codec

Inherited from Codec

KindNameDescription
variablenameThe display name for this codec.
variableencoderThe encoder name for FFmpeg.
variablesampleRateThe sampling rate or RTP clock rate.
variablebitRateThe bit rate to encode at.
variablequalityOptional quality value, variable range depending on codec.
variablecomplianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
variableenabledWeather or not the codec is available for use.
variableoptionsArbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.
functionCodecConstruct a disabled codec with zeroed parameters.
functionCodecConstruct a codec with a display name, sample rate, bit rate, and enabled flag.
functionCodecConstruct a codec with an explicit FFmpeg encoder name.
function~Codec virtual noexceptCodec(const Codec& r);.
functiontoString virtual constReturn a compact string representation of this codec.
functionspecified const nodiscardReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
functionprint virtualPrint a multi-line human-readable description to the given stream.

Public Attributes

ReturnNameDescription
intchannels
std::stringsampleFmtOne of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp.

{#channels}

channels

int channels

Defined in src/av/include/icy/av/codec.h:104


{#samplefmt}

sampleFmt

std::string sampleFmt

Defined in src/av/include/icy/av/codec.h:105

One of: u8, s16, s32, flt, dbl, u8p, s16p, s32p, fltp, dblp.

Public Methods

ReturnNameDescription
AudioCodecConstruct a disabled audio codec with zeroed parameters.
AudioCodecConstruct an anonymous audio codec from raw parameters.
AudioCodecConstruct a named audio codec.
AudioCodecConstruct a named audio codec with an explicit FFmpeg encoder name.
std::stringtoString virtual const override
voidprint virtual overridePrint a multi-line human-readable description to the given stream.

{#audiocodec-1}

AudioCodec

AudioCodec()

Defined in src/av/include/icy/av/codec.h:108

Construct a disabled audio codec with zeroed parameters.


{#audiocodec-2}

AudioCodec

AudioCodec(int channels, int sampleRate, const std::string & sampleFmt = "", int bitRate = 0)

Defined in src/av/include/icy/av/codec.h:115

Construct an anonymous audio codec from raw parameters.

Parameters

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • sampleFmt The sample format string (e.g. "s16", "fltp").

  • bitRate The target bit rate in bits per second.


{#audiocodec-3}

AudioCodec

AudioCodec(const std::string & name, int channels = 0, int sampleRate = 0, int bitRate = 0, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/codec.h:126

Construct a named audio codec.

Parameters

  • name The codec display name.

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • bitRate The target bit rate in bits per second.

  • sampleFmt The sample format string.


{#audiocodec-4}

AudioCodec

AudioCodec(const std::string & name, const std::string & encoder, int channels = 0, int sampleRate = 0, int bitRate = 0, const std::string & sampleFmt = "")

Defined in src/av/include/icy/av/codec.h:139

Construct a named audio codec with an explicit FFmpeg encoder name.

Parameters

  • name The codec display name.

  • encoder The FFmpeg encoder name (e.g. "libopus").

  • channels The number of audio channels.

  • sampleRate The sample rate in Hz.

  • bitRate The target bit rate in bits per second.

  • sampleFmt The sample format string.


{#tostring-1}

toString

virtual const override

virtual std::string toString() const override

Defined in src/av/include/icy/av/codec.h:149

Returns

A string in the form "AudioCodec[name:encoder:sampleRate:bitRate:channels:sampleFmt:enabled]".

Reimplements

{#print-1}

virtual override

virtual void print(std::ostream & ost) override

Defined in src/av/include/icy/av/codec.h:153

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.
Reimplements

{#videocodec}

VideoCodec

#include <icy/av/codec.h>
struct VideoCodec

Defined in src/av/include/icy/av/codec.h:169

Inherits: Codec

Video codec parameters including resolution, frame rate, and pixel format.

List of all members

NameKindOwner
widthvariableDeclared here
heightvariableDeclared here
fpsvariableDeclared here
pixelFmtvariableDeclared here
VideoCodecfunctionDeclared here
VideoCodecfunctionDeclared here
VideoCodecfunctionDeclared here
VideoCodecfunctionDeclared here
VideoCodecfunctionDeclared here
toStringfunctionDeclared here
printfunctionDeclared here
namevariableInherited from Codec
encodervariableInherited from Codec
sampleRatevariableInherited from Codec
bitRatevariableInherited from Codec
qualityvariableInherited from Codec
compliancevariableInherited from Codec
enabledvariableInherited from Codec
optionsvariableInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
CodecfunctionInherited from Codec
~CodecfunctionInherited from Codec
toStringfunctionInherited from Codec
specifiedfunctionInherited from Codec
printfunctionInherited from Codec

Inherited from Codec

KindNameDescription
variablenameThe display name for this codec.
variableencoderThe encoder name for FFmpeg.
variablesampleRateThe sampling rate or RTP clock rate.
variablebitRateThe bit rate to encode at.
variablequalityOptional quality value, variable range depending on codec.
variablecomplianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
variableenabledWeather or not the codec is available for use.
variableoptionsArbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.
functionCodecConstruct a disabled codec with zeroed parameters.
functionCodecConstruct a codec with a display name, sample rate, bit rate, and enabled flag.
functionCodecConstruct a codec with an explicit FFmpeg encoder name.
function~Codec virtual noexceptCodec(const Codec& r);.
functiontoString virtual constReturn a compact string representation of this codec.
functionspecified const nodiscardReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
functionprint virtualPrint a multi-line human-readable description to the given stream.

Public Attributes

ReturnNameDescription
intwidth
intheight
doublefps
std::stringpixelFmt

{#width}

width

int width

Defined in src/av/include/icy/av/codec.h:171


{#height}

height

int height

Defined in src/av/include/icy/av/codec.h:172


{#fps}

fps

double fps

Defined in src/av/include/icy/av/codec.h:173


{#pixelfmt}

pixelFmt

std::string pixelFmt

Defined in src/av/include/icy/av/codec.h:174

Public Methods

ReturnNameDescription
VideoCodecConstruct a disabled video codec with zeroed parameters.
VideoCodecConstruct an anonymous video codec from raw parameters.
VideoCodecConstruct a named video codec.
VideoCodecConstruct a named video codec with an explicit FFmpeg encoder name.
VideoCodec
std::stringtoString virtual const override
voidprint virtual overridePrint a multi-line human-readable description to the given stream.

{#videocodec-1}

VideoCodec

VideoCodec()

Defined in src/av/include/icy/av/codec.h:177

Construct a disabled video codec with zeroed parameters.


{#videocodec-2}

VideoCodec

VideoCodec(int width, int height, double fps = 0.0, const std::string & pixelFmt = DEFAULT_VIDEO_PIXEL_FMT, int bitRate = 0, int sampleRate = 0)

Defined in src/av/include/icy/av/codec.h:186

Construct an anonymous video codec from raw parameters.

Parameters

  • width The frame width in pixels.

  • height The frame height in pixels.

  • fps The target frame rate in frames per second.

  • pixelFmt The pixel format string (e.g. "yuv420p").

  • bitRate The target bit rate in bits per second.

  • sampleRate The RTP clock rate in Hz.


{#videocodec-3}

VideoCodec

VideoCodec(const std::string & name, int width = 0, int height = 0, double fps = 0.0, int bitRate = 0, int sampleRate = 0, const std::string & pixelFmt = DEFAULT_VIDEO_PIXEL_FMT)

Defined in src/av/include/icy/av/codec.h:199

Construct a named video codec.

Parameters

  • name The codec display name.

  • width The frame width in pixels.

  • height The frame height in pixels.

  • fps The target frame rate in frames per second.

  • bitRate The target bit rate in bits per second.

  • sampleRate The RTP clock rate in Hz.

  • pixelFmt The pixel format string.


{#videocodec-4}

VideoCodec

VideoCodec(const std::string & name, const std::string & encoder, int width = 0, int height = 0, double fps = 0.0, int bitRate = 0, int sampleRate = 0, const std::string & pixelFmt = DEFAULT_VIDEO_PIXEL_FMT)

Defined in src/av/include/icy/av/codec.h:213

Construct a named video codec with an explicit FFmpeg encoder name.

Parameters

  • name The codec display name.

  • encoder The FFmpeg encoder name (e.g. "libx264").

  • width The frame width in pixels.

  • height The frame height in pixels.

  • fps The target frame rate in frames per second.

  • bitRate The target bit rate in bits per second.

  • sampleRate The RTP clock rate in Hz.

  • pixelFmt The pixel format string.


{#videocodec-5}

VideoCodec

VideoCodec(const VideoCodec & r)

Defined in src/av/include/icy/av/codec.h:218


{#tostring-2}

toString

virtual const override

virtual std::string toString() const override

Defined in src/av/include/icy/av/codec.h:223

Returns

A string in the form "VideoCodec[name:encoder:width:height:fps:pixelFmt:enabled]".

Reimplements

{#print-2}

virtual override

virtual void print(std::ostream & ost) override

Defined in src/av/include/icy/av/codec.h:227

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.
Reimplements

{#deleter-1}

Deleter

#include <icy/av/ffmpeg.h>
template<typename T, typename R, R(*)(T *) Fn>
struct Deleter

Defined in src/av/include/icy/av/ffmpeg.h:70

RAII helpers for owning FFmpeg allocation types.

Deleter adaptor for functions like av_free that take a pointer.

List of all members

NameKindOwner
operator()functionDeclared here

Public Methods

ReturnNameDescription
voidoperator() const inline

{#operator}

operator()

const inline

inline void operator()(T * p) const

Defined in src/av/include/icy/av/ffmpeg.h:72

{#deleterp}

Deleterp

#include <icy/av/ffmpeg.h>
template<typename T, typename R, R(*)(T **) Fn>
struct Deleterp

Defined in src/av/include/icy/av/ffmpeg.h:81

Deleter adaptor for functions like av_freep that take a pointer to a pointer.

List of all members

NameKindOwner
operator()functionDeclared here

Public Methods

ReturnNameDescription
voidoperator() const inline

{#operator-1}

operator()

const inline

inline void operator()(T * p) const

Defined in src/av/include/icy/av/ffmpeg.h:83

{#format}

Format

#include <icy/av/format.h>
struct Format

Defined in src/av/include/icy/av/format.h:30

Defines a media container format which is available through the FormatRegistry for encoding or decoding.

A format bundles the preferred default audio and video codec settings for a named container such as MP4, MKV, or WAV.

List of all members

NameKindOwner
namevariableDeclared here
idvariableDeclared here
videovariableDeclared here
audiovariableDeclared here
priorityvariableDeclared here
FormatfunctionDeclared here
FormatfunctionDeclared here
FormatfunctionDeclared here
FormatfunctionDeclared here
FormatfunctionDeclared here
typefunctionDeclared here
toStringfunctionDeclared here
printfunctionDeclared here
preferablefunctionDeclared here
TypeenumDeclared here

Public Attributes

ReturnNameDescription
std::stringnameBase Format Variables.
std::stringidThe short name of this format.
VideoCodecvideoThe video codec.
AudioCodecaudioThe audio codec.
intpriorityThe priority this format will be displayed on the list.

{#name-1}

name

std::string name

Defined in src/av/include/icy/av/format.h:43

Base Format Variables.

The display name of this format.


{#id}

id

std::string id

Defined in src/av/include/icy/av/format.h:44

The short name of this format.


{#video}

video

VideoCodec video

Defined in src/av/include/icy/av/format.h:46

The video codec.


{#audio}

audio

AudioCodec audio

Defined in src/av/include/icy/av/format.h:47

The audio codec.


{#priority}

priority

int priority

Defined in src/av/include/icy/av/format.h:49

The priority this format will be displayed on the list.

Public Methods

ReturnNameDescription
FormatCtors/Dtors.
FormatConstruct a multiplex (audio + video) format.
FormatConstruct a video-only format.
FormatConstruct an audio-only format.
Format
Typetype constReturn the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled.
std::stringtoString virtual const
voidprint virtualPrint a multi-line human-readable description to the given stream.

{#format-1}

Format

Format()

Defined in src/av/include/icy/av/format.h:56

Ctors/Dtors.

Construct an empty format with no codecs enabled.


{#format-2}

Format

Format(const std::string & name, const std::string & id, const VideoCodec & video, const AudioCodec & audio, int priority = 0)

Defined in src/av/include/icy/av/format.h:64

Construct a multiplex (audio + video) format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID (e.g. "mp4").

  • video The video codec parameters.

  • audio The audio codec parameters.

  • priority Sort priority; higher values appear first.


{#format-3}

Format

Format(const std::string & name, const std::string & id, const VideoCodec & video, int priority = 0)

Defined in src/av/include/icy/av/format.h:73

Construct a video-only format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID.

  • video The video codec parameters.

  • priority Sort priority; higher values appear first.


{#format-4}

Format

Format(const std::string & name, const std::string & id, const AudioCodec & audio, int priority = 0)

Defined in src/av/include/icy/av/format.h:82

Construct an audio-only format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID.

  • audio The audio codec parameters.

  • priority Sort priority; higher values appear first.


{#format-5}

Format

Format(const Format & r)

Defined in src/av/include/icy/av/format.h:87


{#type}

type

const

Type type() const

Defined in src/av/include/icy/av/format.h:93

Return the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled.


{#tostring-3}

toString

virtual const

virtual std::string toString() const

Defined in src/av/include/icy/av/format.h:96

Returns

A compact string representation of the format and its enabled codecs.


{#print-3}

virtual

virtual void print(std::ostream & ost)

Defined in src/av/include/icy/av/format.h:100

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.

Public Static Methods

ReturnNameDescription
boolpreferable static inlineComparator returning true if first has higher priority than second.

{#preferable}

preferable

static inline

static inline bool preferable(const Format & first, const Format & second)

Defined in src/av/include/icy/av/format.h:106

Comparator returning true if first has higher priority than second.

Parameters

  • first The format to compare.

  • second The format to compare against.

Returns

True if first.priority > second.priority.

Public Types

NameDescription
Type

{#type-1}

Type

enum Type

Defined in src/av/include/icy/av/format.h:32

ValueDescription
None
Videovideo only
Audioaudio only
Multiplexboth video & audio

{#encoderstate}

EncoderState

#include <icy/av/iencoder.h>
struct EncoderState

Defined in src/av/include/icy/av/iencoder.h:26

Inherits: State

State machine states for the encoder pipeline.

List of all members

NameKindOwner
strfunctionDeclared here
TypeenumDeclared here
IDtypedefInherited from State
_idvariableInherited from State
StatefunctionInherited from State
StatefunctionInherited from State
operator=functionInherited from State
~StatefunctionInherited from State
idfunctionInherited from State
setfunctionInherited from State
strfunctionInherited from State
toStringfunctionInherited from State
equalsfunctionInherited from State
betweenfunctionInherited from State
operator==functionInherited from State
operator==functionInherited from State
operator<<friendInherited from State

Inherited from State

KindNameDescription
typedefID
variable_id
functionState
functionStateCopy constructor.
functionoperator=Copy assignment.
function~State virtualDefaulted destructor.
functionid constReturns the current state ID.
functionsetSets the state ID.
functionstr virtual constReturns a human-readable string for the given state ID. Override in derived classes to provide meaningful names.
functiontoString virtual constReturns a human-readable string for the current state ID.
functionequals constReturns true if the current state ID equals the given ID.
functionbetween constReturns true if the current state ID is in the inclusive range [lid, rid].
functionoperator== const inline
functionoperator== const inline
friendoperator<< inline

Public Methods

ReturnNameDescription
std::stringstr const inline

{#str}

str

const inline

inline std::string str(unsigned int id) const

Defined in src/av/include/icy/av/iencoder.h:37

Public Types

NameDescription
Type

{#type-2}

Type

enum Type

Defined in src/av/include/icy/av/iencoder.h:28

ValueDescription
None
Ready
Encoding
Stopped
Error

{#encoderoptions}

EncoderOptions

#include <icy/av/iencoder.h>
struct EncoderOptions

Defined in src/av/include/icy/av/iencoder.h:57

Configuration options for audio and video encoders.

List of all members

NameKindOwner
iformatvariableDeclared here
oformatvariableDeclared here
ifilevariableDeclared here
ofilevariableDeclared here
durationvariableDeclared here
EncoderOptionsfunctionDeclared here

Public Attributes

ReturnNameDescription
Formatiformatinput media format.
Formatoformatoutput media format.
std::stringifileinput file path.
std::stringofileoutput file path.
longdurationduration of time to record in nanoseconds.

{#iformat}

iformat

Format iformat

Defined in src/av/include/icy/av/iencoder.h:59

input media format.


{#oformat}

oformat

Format oformat

Defined in src/av/include/icy/av/iencoder.h:60

output media format.


{#ifile}

ifile

std::string ifile

Defined in src/av/include/icy/av/iencoder.h:61

input file path.


{#ofile}

ofile

std::string ofile

Defined in src/av/include/icy/av/iencoder.h:62

output file path.


{#duration}

duration

long duration

Defined in src/av/include/icy/av/iencoder.h:63

duration of time to record in nanoseconds.

Public Methods

ReturnNameDescription
EncoderOptions inline

{#encoderoptions-1}

EncoderOptions

inline

inline EncoderOptions(const Format & iformat = Format(), const Format & oformat = Format(), const std::string & ifile = "", const std::string & ofile = "", long duration = 0)

Defined in src/av/include/icy/av/iencoder.h:64

{#audiobuffer}

AudioBuffer

#include <icy/av/audiobuffer.h>
struct AudioBuffer

Defined in src/av/include/icy/av/audiobuffer.h:31

FIFO buffer for queuing audio samples between encoding stages.

List of all members

NameKindOwner
fifovariableDeclared here
AudioBufferfunctionDeclared here
AudioBufferfunctionDeclared here
AudioBufferfunctionDeclared here
allocfunctionDeclared here
resetfunctionDeclared here
closefunctionDeclared here
writefunctionDeclared here
readfunctionDeclared here
availablefunctionDeclared here

Public Attributes

ReturnNameDescription
AVAudioFifo *fifoUnderlying FFmpeg audio FIFO handle.

{#fifo}

fifo

AVAudioFifo * fifo

Defined in src/av/include/icy/av/audiobuffer.h:71

Underlying FFmpeg audio FIFO handle.

Public Methods

ReturnNameDescription
AudioBuffer
AudioBufferDeleted constructor.
AudioBufferDeleted constructor.
voidallocAllocate the audio FIFO buffer.
voidresetDiscard all samples currently held in the FIFO without freeing the buffer.
voidcloseFree the underlying AVAudioFifo buffer.
voidwriteWrite samples into the FIFO buffer.
boolreadRead samples from the FIFO buffer.
intavailable constReturn the number of samples per channel currently available in the FIFO.

{#audiobuffer-1}

AudioBuffer

AudioBuffer()

Defined in src/av/include/icy/av/audiobuffer.h:33


{#audiobuffer-2}

AudioBuffer

AudioBuffer(const AudioBuffer &) = delete

Defined in src/av/include/icy/av/audiobuffer.h:36

Deleted constructor.


{#audiobuffer-3}

AudioBuffer

AudioBuffer(AudioBuffer &&) = delete

Defined in src/av/include/icy/av/audiobuffer.h:38

Deleted constructor.


{#alloc}

alloc

void alloc(const std::string & sampleFmt, int channels, int numSamples = 1024)

Defined in src/av/include/icy/av/audiobuffer.h:46

Allocate the audio FIFO buffer.

Parameters

  • sampleFmt The sample format name (e.g. "s16", "fltp").

  • channels The number of audio channels.

  • numSamples The initial buffer capacity in samples per channel.


{#reset-2}

reset

void reset()

Defined in src/av/include/icy/av/audiobuffer.h:49

Discard all samples currently held in the FIFO without freeing the buffer.


{#close-1}

close

void close()

Defined in src/av/include/icy/av/audiobuffer.h:52

Free the underlying AVAudioFifo buffer.


{#write}

write

void write(void ** samples, int numSamples)

Defined in src/av/include/icy/av/audiobuffer.h:58

Write samples into the FIFO buffer.

Parameters

  • samples Array of per-channel sample buffers.

  • numSamples The number of samples per channel to write.


{#read}

read

bool read(void ** samples, int numSamples)

Defined in src/av/include/icy/av/audiobuffer.h:65

Read samples from the FIFO buffer.

Parameters

  • samples Array of per-channel sample buffers to fill.

  • numSamples The number of samples per channel to read.

Returns

True if enough samples were available.


{#available}

available

const

int available() const

Defined in src/av/include/icy/av/audiobuffer.h:69

Return the number of samples per channel currently available in the FIFO.

Returns

The number of available samples, or zero if the buffer is not allocated.

{#audiocontext}

AudioContext

#include <icy/av/audiocontext.h>
struct AudioContext

Defined in src/av/include/icy/av/audiocontext.h:39

Subclassed by: AudioDecoder, AudioEncoder

Base context for audio encoding and decoding via FFmpeg.

List of all members

NameKindOwner
emittervariableDeclared here
iparamsvariableDeclared here
oparamsvariableDeclared here
streamvariableDeclared here
ctxvariableDeclared here
codecvariableDeclared here
framevariableDeclared here
resamplervariableDeclared here
outputFrameSizevariableDeclared here
timevariableDeclared here
ptsvariableDeclared here
secondsvariableDeclared here
errorvariableDeclared here
AudioContextfunctionDeclared here
AudioContextfunctionDeclared here
AudioContextfunctionDeclared here
createfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
decodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
flushfunctionDeclared here
recreateResamplerfunctionDeclared here

Public Attributes

ReturnNameDescription
PacketSignalemitter
AudioCodeciparamsinput parameters
AudioCodecoparamsoutput parameters
AVStream *streamencoder or decoder stream
AVCodecContext *ctxencoder or decoder context
const AVCodec *codecencoder or decoder codec
AVFrame *framelast encoded or decoded frame
std::unique_ptr< AudioResampler >resampleraudio resampler
intoutputFrameSizeencoder or decoder output frame size
int64_ttimestream time in codec time base
int64_tptslast packet pts value
doublesecondsaudio time in seconds
std::stringerrorerror message

{#emitter-2}

emitter

PacketSignal emitter

Defined in src/av/include/icy/av/audiocontext.h:92


{#iparams}

iparams

AudioCodec iparams

Defined in src/av/include/icy/av/audiocontext.h:94

input parameters


{#oparams}

oparams

AudioCodec oparams

Defined in src/av/include/icy/av/audiocontext.h:95

output parameters


{#stream-1}

stream

AVStream * stream

Defined in src/av/include/icy/av/audiocontext.h:96

encoder or decoder stream


{#ctx}

ctx

AVCodecContext * ctx

Defined in src/av/include/icy/av/audiocontext.h:97

encoder or decoder context


{#codec-5}

codec

const AVCodec * codec

Defined in src/av/include/icy/av/audiocontext.h:98

encoder or decoder codec


{#frame}

frame

AVFrame * frame

Defined in src/av/include/icy/av/audiocontext.h:99

last encoded or decoded frame


{#resampler}

resampler

std::unique_ptr< AudioResampler > resampler

Defined in src/av/include/icy/av/audiocontext.h:100

audio resampler


{#outputframesize}

outputFrameSize

int outputFrameSize

Defined in src/av/include/icy/av/audiocontext.h:101

encoder or decoder output frame size


{#time}

time

int64_t time

Defined in src/av/include/icy/av/audiocontext.h:102

stream time in codec time base


{#pts}

pts

int64_t pts

Defined in src/av/include/icy/av/audiocontext.h:103

last packet pts value


{#seconds}

seconds

double seconds

Defined in src/av/include/icy/av/audiocontext.h:104

audio time in seconds


{#error-1}

error

std::string error

Defined in src/av/include/icy/av/audiocontext.h:105

error message

Public Methods

ReturnNameDescription
AudioContext
AudioContextDeleted constructor.
AudioContextDeleted constructor.
voidcreate virtualInitialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder.
voidopen virtualOpen the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created.
voidclose virtualClose the codec context, free the frame, and reset timestamps.
booldecode virtual nodiscardDecode a compressed audio packet and emit the resulting samples.
boolencode virtual nodiscardEncode a buffer of interleaved audio samples.
boolencode virtual nodiscardEncode a buffer of planar audio samples.
boolencode virtual nodiscardEncode a single AVFrame.
voidflush virtualFlush any frames buffered inside the codec and emit remaining output.
boolrecreateResampler virtualRecreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required.

{#audiocontext-1}

AudioContext

AudioContext()

Defined in src/av/include/icy/av/audiocontext.h:41


{#audiocontext-2}

AudioContext

AudioContext(const AudioContext &) = delete

Defined in src/av/include/icy/av/audiocontext.h:44

Deleted constructor.


{#audiocontext-3}

AudioContext

AudioContext(AudioContext &&) = delete

Defined in src/av/include/icy/av/audiocontext.h:46

Deleted constructor.


{#create}

create

virtual

virtual void create()

Defined in src/av/include/icy/av/audiocontext.h:51

Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder.

Reimplemented by

{#open}

open

virtual

virtual void open()

Defined in src/av/include/icy/av/audiocontext.h:55

Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created.


{#close-2}

close

virtual

virtual void close()

Defined in src/av/include/icy/av/audiocontext.h:58

Close the codec context, free the frame, and reset timestamps.

Reimplemented by

{#decode}

decode

virtual nodiscard

[[nodiscard]] virtual bool decode(AVPacket & ipacket)

Defined in src/av/include/icy/av/audiocontext.h:63

Decode a compressed audio packet and emit the resulting samples.

Parameters

  • ipacket The compressed audio packet to decode.

Returns

True if one or more decoded frames were emitted, false otherwise.

Reimplemented by

{#encode}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(uint8_t * samples, int numSamples, int64_t pts)

Defined in src/av/include/icy/av/audiocontext.h:70

Encode a buffer of interleaved audio samples.

Parameters

  • samples Pointer to the interleaved sample buffer.

  • numSamples Number of samples per channel.

  • pts Presentation timestamp in stream time base units.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#encode-1}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(uint8_t * samples, int numSamples, int64_t pts)

Defined in src/av/include/icy/av/audiocontext.h:77

Encode a buffer of planar audio samples.

Parameters

  • samples Array of per-channel sample buffers (up to 4 planes).

  • numSamples Number of samples per channel.

  • pts Presentation timestamp in stream time base units.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#encode-2}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(AVFrame * iframe)

Defined in src/av/include/icy/av/audiocontext.h:82

Encode a single AVFrame.

Parameters

  • iframe The source audio frame; must have all fields set correctly.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#flush-1}

flush

virtual

virtual void flush()

Defined in src/av/include/icy/av/audiocontext.h:85

Flush any frames buffered inside the codec and emit remaining output.

Reimplemented by

{#recreateresampler}

recreateResampler

virtual

virtual bool recreateResampler()

Defined in src/av/include/icy/av/audiocontext.h:90

Recreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required.

Returns

True if the resampler was successfully created.

{#audiodecoder}

AudioDecoder

#include <icy/av/audiodecoder.h>
struct AudioDecoder

Defined in src/av/include/icy/av/audiodecoder.h:28

Inherits: AudioContext

Decodes compressed audio packets into raw sample frames.

List of all members

NameKindOwner
AudioDecoderfunctionDeclared here
createfunctionDeclared here
closefunctionDeclared here
decodefunctionDeclared here
flushfunctionDeclared here
emittervariableInherited from AudioContext
iparamsvariableInherited from AudioContext
oparamsvariableInherited from AudioContext
streamvariableInherited from AudioContext
ctxvariableInherited from AudioContext
codecvariableInherited from AudioContext
framevariableInherited from AudioContext
resamplervariableInherited from AudioContext
outputFrameSizevariableInherited from AudioContext
timevariableInherited from AudioContext
ptsvariableInherited from AudioContext
secondsvariableInherited from AudioContext
errorvariableInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
createfunctionInherited from AudioContext
openfunctionInherited from AudioContext
closefunctionInherited from AudioContext
decodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
flushfunctionInherited from AudioContext
recreateResamplerfunctionInherited from AudioContext

Inherited from AudioContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframelast encoded or decoded frame
variableresampleraudio resampler
variableoutputFrameSizeencoder or decoder output frame size
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsaudio time in seconds
variableerrorerror message
functionAudioContext
functionAudioContextDeleted constructor.
functionAudioContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder.
functionopen virtualOpen the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed audio packet and emit the resulting samples.
functionencode virtual nodiscardEncode a buffer of interleaved audio samples.
functionencode virtual nodiscardEncode a buffer of planar audio samples.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionrecreateResampler virtualRecreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required.

Public Methods

ReturnNameDescription
AudioDecoderConstruct a decoder for the given stream. The codec parameters are read from the stream's codecpar.
voidcreate virtual overrideInitialise the AVCodecContext from the stream's codec parameters.
voidclose virtual overrideClose and free the AVCodecContext and associated resources.
booldecode virtual nodiscard overrideDecode the given compressed audio packet and emit the decoded samples.
voidflush virtual overrideFlush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output.

{#audiodecoder-1}

AudioDecoder

AudioDecoder(AVStream * stream)

Defined in src/av/include/icy/av/audiodecoder.h:33

Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar.

Parameters

  • stream The AVStream to decode; must remain valid for the lifetime of this decoder.

{#create-1}

create

virtual override

virtual void create() override

Defined in src/av/include/icy/av/audiodecoder.h:37

Initialise the AVCodecContext from the stream's codec parameters.

Reimplements

{#close-3}

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/audiodecoder.h:40

Close and free the AVCodecContext and associated resources.

Reimplements

{#decode-1}

decode

virtual nodiscard override

[[nodiscard]] virtual bool decode(AVPacket & ipacket) override

Defined in src/av/include/icy/av/audiodecoder.h:45

Decode the given compressed audio packet and emit the decoded samples.

Parameters

  • ipacket The compressed audio packet to decode.

Returns

True if one or more output frames were decoded and emitted, false otherwise.

Reimplements

{#flush-2}

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/audiodecoder.h:49

Flush any frames buffered inside the decoder. Call this after the last packet to retrieve all remaining decoded output.

Reimplements

{#audioencoder}

AudioEncoder

#include <icy/av/audioencoder.h>
struct AudioEncoder

Defined in src/av/include/icy/av/audioencoder.h:37

Inherits: AudioContext Subclassed by: AudioPacketEncoder

Encodes raw audio samples into a compressed format.

List of all members

NameKindOwner
fifovariableDeclared here
formatvariableDeclared here
nextOutputPtsvariableDeclared here
AudioEncoderfunctionDeclared here
createfunctionDeclared here
closefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
flushfunctionDeclared here
emittervariableInherited from AudioContext
iparamsvariableInherited from AudioContext
oparamsvariableInherited from AudioContext
streamvariableInherited from AudioContext
ctxvariableInherited from AudioContext
codecvariableInherited from AudioContext
framevariableInherited from AudioContext
resamplervariableInherited from AudioContext
outputFrameSizevariableInherited from AudioContext
timevariableInherited from AudioContext
ptsvariableInherited from AudioContext
secondsvariableInherited from AudioContext
errorvariableInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
AudioContextfunctionInherited from AudioContext
createfunctionInherited from AudioContext
openfunctionInherited from AudioContext
closefunctionInherited from AudioContext
decodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
encodefunctionInherited from AudioContext
flushfunctionInherited from AudioContext
recreateResamplerfunctionInherited from AudioContext

Inherited from AudioContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframelast encoded or decoded frame
variableresampleraudio resampler
variableoutputFrameSizeencoder or decoder output frame size
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsaudio time in seconds
variableerrorerror message
functionAudioContext
functionAudioContextDeleted constructor.
functionAudioContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder.
functionopen virtualOpen the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed audio packet and emit the resulting samples.
functionencode virtual nodiscardEncode a buffer of interleaved audio samples.
functionencode virtual nodiscardEncode a buffer of planar audio samples.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionrecreateResampler virtualRecreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required.

Public Attributes

ReturnNameDescription
av::AudioBufferfifo
AVFormatContext *format
int64_tnextOutputPtsRunning PTS counter for encoder output, in encoder time_base units. Anchored to the first input packet's PTS, then advanced by frame->nb_samples per encoded frame. AV_NOPTS_VALUE before anchoring.

{#fifo-1}

fifo

av::AudioBuffer fifo

Defined in src/av/include/icy/av/audioencoder.h:74


{#format-6}

format

AVFormatContext * format

Defined in src/av/include/icy/av/audioencoder.h:75


{#nextoutputpts}

nextOutputPts

int64_t nextOutputPts = AV_NOPTS_VALUE

Defined in src/av/include/icy/av/audioencoder.h:80

Running PTS counter for encoder output, in encoder time_base units. Anchored to the first input packet's PTS, then advanced by frame->nb_samples per encoded frame. AV_NOPTS_VALUE before anchoring.

Public Methods

ReturnNameDescription
AudioEncoderConstruct an encoder, optionally tied to an existing muxer context.
voidcreate virtual overrideInitialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction.
voidclose virtual overrideClose and free the AVCodecContext, FIFO buffer, and associated resources.
boolencode virtual nodiscard overrideEncode interleaved audio samples.
boolencode virtual nodiscard overrideEncode planar audio samples.
boolencode virtual nodiscard overrideEncode a single AVFrame (typically from a decoder or resampler).
voidflush virtual overrideFlush remaining packets to be encoded. This method should be called once before stream closure.

{#audioencoder-1}

AudioEncoder

AudioEncoder(AVFormatContext * format = nullptr)

Defined in src/av/include/icy/av/audioencoder.h:41

Construct an encoder, optionally tied to an existing muxer context.

Parameters

  • format The AVFormatContext that will receive encoded packets, or nullptr for standalone use.

{#create-2}

create

virtual override

virtual void create() override

Defined in src/av/include/icy/av/audioencoder.h:46

Initialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction.

Reimplements

{#close-4}

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/audioencoder.h:49

Close and free the AVCodecContext, FIFO buffer, and associated resources.

Reimplements

{#encode-3}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(uint8_t * samples, const int numSamples, const int64_t pts) override

Defined in src/av/include/icy/av/audioencoder.h:56

Encode interleaved audio samples.

Parameters

  • samples The input samples to encode.

  • numSamples The number of input samples per channel.

  • pts The input samples presentation timestamp.

Reimplements

{#encode-4}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(uint8_t * samples, const int numSamples, const int64_t pts) override

Defined in src/av/include/icy/av/audioencoder.h:63

Encode planar audio samples.

Parameters

  • samples The input samples to encode.

  • numSamples The number of input samples per channel.

  • pts The input samples presentation timestamp.

Reimplements

{#encode-5}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(AVFrame * iframe) override

Defined in src/av/include/icy/av/audioencoder.h:68

Encode a single AVFrame (typically from a decoder or resampler).

Parameters

  • iframe The source audio frame with all fields set.

Returns

True if an encoded packet was produced and emitted.

Reimplements

{#flush-3}

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/audioencoder.h:72

Flush remaining packets to be encoded. This method should be called once before stream closure.

Reimplements

{#videocontext}

VideoContext

#include <icy/av/videocontext.h>
struct VideoContext

Defined in src/av/include/icy/av/videocontext.h:42

Subclassed by: VideoDecoder, VideoEncoder

Base video context from which all video encoders and decoders derive.

List of all members

NameKindOwner
emittervariableDeclared here
iparamsvariableDeclared here
oparamsvariableDeclared here
streamvariableDeclared here
ctxvariableDeclared here
codecvariableDeclared here
framevariableDeclared here
convvariableDeclared here
timevariableDeclared here
ptsvariableDeclared here
secondsvariableDeclared here
errorvariableDeclared here
VideoContextfunctionDeclared here
VideoContextfunctionDeclared here
VideoContextfunctionDeclared here
createfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
decodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
flushfunctionDeclared here
convertfunctionDeclared here
recreateConverterfunctionDeclared here

Public Attributes

ReturnNameDescription
PacketSignalemitter
VideoCodeciparamsinput parameters
VideoCodecoparamsoutput parameters
AVStream *streamencoder or decoder stream
AVCodecContext *ctxencoder or decoder context
const AVCodec *codecencoder or decoder codec
AVFrame *frameencoder or decoder frame
std::unique_ptr< VideoConverter >convvideo conversion context
int64_ttimestream time in codec time base
int64_tptslast packet pts value
doublesecondsvideo time in seconds
std::stringerrorerror message

{#emitter-3}

emitter

PacketSignal emitter

Defined in src/av/include/icy/av/videocontext.h:103


{#iparams-1}

iparams

VideoCodec iparams

Defined in src/av/include/icy/av/videocontext.h:105

input parameters


{#oparams-1}

oparams

VideoCodec oparams

Defined in src/av/include/icy/av/videocontext.h:106

output parameters


{#stream-2}

stream

AVStream * stream

Defined in src/av/include/icy/av/videocontext.h:107

encoder or decoder stream


{#ctx-1}

ctx

AVCodecContext * ctx

Defined in src/av/include/icy/av/videocontext.h:108

encoder or decoder context


{#codec-6}

codec

const AVCodec * codec

Defined in src/av/include/icy/av/videocontext.h:109

encoder or decoder codec


{#frame-1}

frame

AVFrame * frame

Defined in src/av/include/icy/av/videocontext.h:110

encoder or decoder frame


{#conv}

conv

std::unique_ptr< VideoConverter > conv

Defined in src/av/include/icy/av/videocontext.h:111

video conversion context


{#time-1}

time

int64_t time

Defined in src/av/include/icy/av/videocontext.h:112

stream time in codec time base


{#pts-1}

pts

int64_t pts

Defined in src/av/include/icy/av/videocontext.h:113

last packet pts value


{#seconds-1}

seconds

double seconds

Defined in src/av/include/icy/av/videocontext.h:114

video time in seconds


{#error-3}

error

std::string error

Defined in src/av/include/icy/av/videocontext.h:115

error message

Public Methods

ReturnNameDescription
VideoContext
VideoContextDeleted constructor.
VideoContextDeleted constructor.
voidcreate virtualInitialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
voidopen virtualOpen the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
voidclose virtualClose the codec context, free the frame, and reset timestamps.
booldecode virtual nodiscardDecode a compressed video packet and emit the resulting frame.
boolencode virtual nodiscardEncode a buffer of interleaved video data.
boolencode virtual nodiscardEncode a planar video frame.
boolencode virtual nodiscardEncode a single AVFrame.
voidflush virtualFlush any frames buffered inside the codec and emit remaining output.
AVFrame *convert virtualConvert the video frame and return the result.
boolrecreateConverter virtualRecreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

{#videocontext-1}

VideoContext

VideoContext()

Defined in src/av/include/icy/av/videocontext.h:44


{#videocontext-2}

VideoContext

VideoContext(const VideoContext &) = delete

Defined in src/av/include/icy/av/videocontext.h:47

Deleted constructor.


{#videocontext-3}

VideoContext

VideoContext(VideoContext &&) = delete

Defined in src/av/include/icy/av/videocontext.h:49

Deleted constructor.


{#create-3}

create

virtual

virtual void create()

Defined in src/av/include/icy/av/videocontext.h:54

Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.

Reimplemented by

{#open-1}

open

virtual

virtual void open()

Defined in src/av/include/icy/av/videocontext.h:58

Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.

Reimplemented by

{#close-6}

close

virtual

virtual void close()

Defined in src/av/include/icy/av/videocontext.h:61

Close the codec context, free the frame, and reset timestamps.

Reimplemented by

{#decode-2}

decode

virtual nodiscard

[[nodiscard]] virtual bool decode(AVPacket & ipacket)

Defined in src/av/include/icy/av/videocontext.h:66

Decode a compressed video packet and emit the resulting frame.

Parameters

  • ipacket The compressed video packet to decode.

Returns

True if an output frame was decoded and emitted, false otherwise.

Reimplemented by

{#encode-6}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(uint8_t * data, int size, int64_t pts)

Defined in src/av/include/icy/av/videocontext.h:73

Encode a buffer of interleaved video data.

Parameters

  • data Pointer to the interleaved frame buffer.

  • size Size of the buffer in bytes.

  • pts Presentation timestamp in stream time base units.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#encode-7}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(uint8_t * data, int linesize, int64_t pts)

Defined in src/av/include/icy/av/videocontext.h:80

Encode a planar video frame.

Parameters

  • data Array of per-plane data pointers (up to 4 planes).

  • linesize Array of per-plane byte strides.

  • pts Presentation timestamp in stream time base units.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#encode-8}

encode

virtual nodiscard

[[nodiscard]] virtual bool encode(AVFrame * iframe)

Defined in src/av/include/icy/av/videocontext.h:85

Encode a single AVFrame.

Parameters

  • iframe The source video frame; must have all fields set correctly.

Returns

True if an encoded packet was produced and emitted.

Reimplemented by

{#flush-4}

flush

virtual

virtual void flush()

Defined in src/av/include/icy/av/videocontext.h:88

Flush any frames buffered inside the codec and emit remaining output.

Reimplemented by

{#convert}

convert

virtual

virtual AVFrame * convert(AVFrame * iframe)

Defined in src/av/include/icy/av/videocontext.h:96

Convert the video frame and return the result.

The input frame will only be converted if it doesn't match the output format. If the frame is not converted the input frame will be returned. If the input frame format does not match the [VideoConverter](#videoconverter) context then the [VideoConverter](#videoconverter) will be recreated with the input frame params.


{#recreateconverter}

recreateConverter

virtual

virtual bool recreateConverter()

Defined in src/av/include/icy/av/videocontext.h:101

Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

Returns

True if the converter was (re)created, false if it is already up to date.

{#videodecoder}

VideoDecoder

#include <icy/av/videodecoder.h>
struct VideoDecoder

Defined in src/av/include/icy/av/videodecoder.h:28

Inherits: VideoContext

Decodes compressed video packets into raw frames.

List of all members

NameKindOwner
VideoDecoderfunctionDeclared here
createfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
decodefunctionDeclared here
flushfunctionDeclared here
emittervariableInherited from VideoContext
iparamsvariableInherited from VideoContext
oparamsvariableInherited from VideoContext
streamvariableInherited from VideoContext
ctxvariableInherited from VideoContext
codecvariableInherited from VideoContext
framevariableInherited from VideoContext
convvariableInherited from VideoContext
timevariableInherited from VideoContext
ptsvariableInherited from VideoContext
secondsvariableInherited from VideoContext
errorvariableInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
createfunctionInherited from VideoContext
openfunctionInherited from VideoContext
closefunctionInherited from VideoContext
decodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
flushfunctionInherited from VideoContext
convertfunctionInherited from VideoContext
recreateConverterfunctionInherited from VideoContext

Inherited from VideoContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframeencoder or decoder frame
variableconvvideo conversion context
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsvideo time in seconds
variableerrorerror message
functionVideoContext
functionVideoContextDeleted constructor.
functionVideoContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
functionopen virtualOpen the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed video packet and emit the resulting frame.
functionencode virtual nodiscardEncode a buffer of interleaved video data.
functionencode virtual nodiscardEncode a planar video frame.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionconvert virtualConvert the video frame and return the result.
functionrecreateConverter virtualRecreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

Public Methods

ReturnNameDescription
VideoDecoderConstruct a decoder for the given stream. The codec parameters are read from the stream's codecpar.
voidcreate virtual overrideInitialise the AVCodecContext from the stream's codec parameters.
voidopen virtual overrideOpen the codec and initialise any required pixel format conversion context.
voidclose virtual overrideClose and free the AVCodecContext and associated resources.
booldecode virtual nodiscard overrideDecode the given compressed video packet and emit the decoded frame. Input packets must use the raw AVStream time base; time base conversion to microseconds is performed internally.
voidflush virtual overrideFlush any frames buffered inside the decoder. Call repeatedly after the last packet until false is returned.

{#videodecoder-1}

VideoDecoder

VideoDecoder(AVStream * stream)

Defined in src/av/include/icy/av/videodecoder.h:33

Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar.

Parameters

  • stream The AVStream to decode; must remain valid for the lifetime of this decoder.

{#create-4}

create

virtual override

virtual void create() override

Defined in src/av/include/icy/av/videodecoder.h:37

Initialise the AVCodecContext from the stream's codec parameters.

Reimplements

{#open-2}

open

virtual override

virtual void open() override

Defined in src/av/include/icy/av/videodecoder.h:40

Open the codec and initialise any required pixel format conversion context.

Reimplements

{#close-7}

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/videodecoder.h:43

Close and free the AVCodecContext and associated resources.

Reimplements

{#decode-3}

decode

virtual nodiscard override

[[nodiscard]] virtual bool decode(AVPacket & ipacket) override

Defined in src/av/include/icy/av/videodecoder.h:50

Decode the given compressed video packet and emit the decoded frame. Input packets must use the raw AVStream time base; time base conversion to microseconds is performed internally.

Parameters

  • ipacket The compressed video packet to decode.

Returns

True if an output frame was decoded and emitted, false otherwise.

Reimplements

{#flush-5}

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/videodecoder.h:54

Flush any frames buffered inside the decoder. Call repeatedly after the last packet until false is returned.

Reimplements

{#videoencoder}

VideoEncoder

#include <icy/av/videoencoder.h>
struct VideoEncoder

Defined in src/av/include/icy/av/videoencoder.h:30

Inherits: VideoContext Subclassed by: VideoPacketEncoder

Encodes raw video frames into a compressed format.

List of all members

NameKindOwner
formatvariableDeclared here
VideoEncoderfunctionDeclared here
createfunctionDeclared here
closefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
encodefunctionDeclared here
flushfunctionDeclared here
emittervariableInherited from VideoContext
iparamsvariableInherited from VideoContext
oparamsvariableInherited from VideoContext
streamvariableInherited from VideoContext
ctxvariableInherited from VideoContext
codecvariableInherited from VideoContext
framevariableInherited from VideoContext
convvariableInherited from VideoContext
timevariableInherited from VideoContext
ptsvariableInherited from VideoContext
secondsvariableInherited from VideoContext
errorvariableInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
VideoContextfunctionInherited from VideoContext
createfunctionInherited from VideoContext
openfunctionInherited from VideoContext
closefunctionInherited from VideoContext
decodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
encodefunctionInherited from VideoContext
flushfunctionInherited from VideoContext
convertfunctionInherited from VideoContext
recreateConverterfunctionInherited from VideoContext

Inherited from VideoContext

KindNameDescription
variableemitter
variableiparamsinput parameters
variableoparamsoutput parameters
variablestreamencoder or decoder stream
variablectxencoder or decoder context
variablecodecencoder or decoder codec
variableframeencoder or decoder frame
variableconvvideo conversion context
variabletimestream time in codec time base
variableptslast packet pts value
variablesecondsvideo time in seconds
variableerrorerror message
functionVideoContext
functionVideoContextDeleted constructor.
functionVideoContextDeleted constructor.
functioncreate virtualInitialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
functionopen virtualOpen the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
functionclose virtualClose the codec context, free the frame, and reset timestamps.
functiondecode virtual nodiscardDecode a compressed video packet and emit the resulting frame.
functionencode virtual nodiscardEncode a buffer of interleaved video data.
functionencode virtual nodiscardEncode a planar video frame.
functionencode virtual nodiscardEncode a single AVFrame.
functionflush virtualFlush any frames buffered inside the codec and emit remaining output.
functionconvert virtualConvert the video frame and return the result.
functionrecreateConverter virtualRecreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().

Public Attributes

ReturnNameDescription
AVFormatContext *format

{#format-7}

format

AVFormatContext * format

Defined in src/av/include/icy/av/videoencoder.h:69

Public Methods

ReturnNameDescription
VideoEncoderConstruct an encoder, optionally tied to an existing muxer context.
voidcreate virtual overrideInitialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.
voidclose virtual overrideClose and free the AVCodecContext and associated resources.
boolencode virtual nodiscard overrideEncode a single video frame. This method is for interleaved video formats.
boolencode virtual nodiscard overrideEncode a single video frame. This method is for planar video formats.
boolencode virtual nodiscard overrideEncode a single AVFrame (typically from a decoder or converter).
voidflush virtual overrideFlush remaining packets to be encoded. This method should be called once before stream closure.

{#videoencoder-1}

VideoEncoder

VideoEncoder(AVFormatContext * format = nullptr)

Defined in src/av/include/icy/av/videoencoder.h:34

Construct an encoder, optionally tied to an existing muxer context.

Parameters

  • format The AVFormatContext that will receive encoded packets, or nullptr for standalone use.

{#create-5}

create

virtual override

virtual void create() override

Defined in src/av/include/icy/av/videoencoder.h:39

Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.

Reimplements

{#close-8}

close

virtual override

virtual void close() override

Defined in src/av/include/icy/av/videoencoder.h:42

Close and free the AVCodecContext and associated resources.

Reimplements

{#encode-9}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(uint8_t * data, int size, int64_t pts) override

Defined in src/av/include/icy/av/videoencoder.h:50

Encode a single video frame. This method is for interleaved video formats.

Parameters

  • data The raw video frame buffer.

  • size The buffer size in bytes.

  • pts The presentation timestamp in stream time base units.

Reimplements

{#encode-10}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(uint8_t * data, int linesize, int64_t pts) override

Defined in src/av/include/icy/av/videoencoder.h:58

Encode a single video frame. This method is for planar video formats.

Parameters

  • data Array of per-plane data pointers (up to 4 planes).

  • linesize Array of per-plane byte strides.

  • pts The presentation timestamp in stream time base units.

Reimplements

{#encode-11}

encode

virtual nodiscard override

[[nodiscard]] virtual bool encode(AVFrame * iframe) override

Defined in src/av/include/icy/av/videoencoder.h:63

Encode a single AVFrame (typically from a decoder or converter).

Parameters

  • iframe The source video frame with all fields set.

Returns

True if an encoded packet was produced and emitted.

Reimplements

{#flush-6}

flush

virtual override

virtual void flush() override

Defined in src/av/include/icy/av/videoencoder.h:67

Flush remaining packets to be encoded. This method should be called once before stream closure.

Reimplements

{#device}

Device

#include <icy/av/devicemanager.h>
struct Device

Defined in src/av/include/icy/av/devicemanager.h:44

Represents a system audio, video or render device.

List of all members

NameKindOwner
typevariableDeclared here
idvariableDeclared here
namevariableDeclared here
isDefaultvariableDeclared here
isConnectedvariableDeclared here
isInUsevariableDeclared here
videoCapabilitiesvariableDeclared here
audioCapabilitiesvariableDeclared here
DevicefunctionDeclared here
DevicefunctionDeclared here
printfunctionDeclared here
operator==functionDeclared here
bestVideoCapabilityfunctionDeclared here
bestAudioCapabilityfunctionDeclared here
TypeenumDeclared here

Public Attributes

ReturnNameDescription
Typetype
std::stringid
std::stringname
boolisDefault
boolisConnected
boolisInUse
std::vector< VideoCapability >videoCapabilities
std::vector< AudioCapability >audioCapabilities

{#type-4}

type

Type type {}

Defined in src/av/include/icy/av/devicemanager.h:73


{#id-1}

id

std::string id

Defined in src/av/include/icy/av/devicemanager.h:74


{#name-2}

name

std::string name

Defined in src/av/include/icy/av/devicemanager.h:75


{#isdefault}

isDefault

bool isDefault {false}

Defined in src/av/include/icy/av/devicemanager.h:76


{#isconnected}

isConnected

bool isConnected {true}

Defined in src/av/include/icy/av/devicemanager.h:77


{#isinuse}

isInUse

bool isInUse {false}

Defined in src/av/include/icy/av/devicemanager.h:78


{#videocapabilities}

videoCapabilities

std::vector< VideoCapability > videoCapabilities

Defined in src/av/include/icy/av/devicemanager.h:80


{#audiocapabilities}

audioCapabilities

std::vector< AudioCapability > audioCapabilities

Defined in src/av/include/icy/av/devicemanager.h:81

Public Methods

ReturnNameDescription
DeviceConstruct a device with Unknown type and empty fields.
DeviceConstruct a device with explicit fields.
voidprint constPrint device details (type, id, name, capabilities) to the given stream.
booloperator== const inlineEquality based on type, id, and name.
VideoCapabilitybestVideoCapability const inlineFind the video capability closest to the requested parameters.
AudioCapabilitybestAudioCapability const inlineFind the audio capability closest to the requested parameters.

{#device-1}

Device

Device()

Defined in src/av/include/icy/av/devicemanager.h:84

Construct a device with Unknown type and empty fields.


{#device-2}

Device

Device(Type type, const std::string & id, const std::string & name, bool isDefault = false)

Defined in src/av/include/icy/av/devicemanager.h:91

Construct a device with explicit fields.

Parameters

  • type The device type (VideoInput, AudioInput, etc.).

  • id The platform-specific device identifier.

  • name The human-readable device name.

  • isDefault True if this is the system default device of its type.


{#print-4}

const

void print(std::ostream & os) const

Defined in src/av/include/icy/av/devicemanager.h:95

Print device details (type, id, name, capabilities) to the given stream.

Parameters

  • os The output stream to write to.

{#operator-2}

operator==

const inline

inline bool operator==(const Device & that) const

Defined in src/av/include/icy/av/devicemanager.h:98

Equality based on type, id, and name.


{#bestvideocapability}

bestVideoCapability

const inline

inline VideoCapability bestVideoCapability(int width, int height, double fps) const

Defined in src/av/include/icy/av/devicemanager.h:112

Find the video capability closest to the requested parameters.

Scoring: resolution match weighted 70%, fps match weighted 30%. Both dimensions are normalised to [0,1] so the weights are meaningful. Prefers capabilities that are >= the requested resolution (upscaling is worse than slight downscaling).

Returns a default capability with the requested values if none are available (allows callers to skip the empty check).


{#bestaudiocapability}

bestAudioCapability

const inline

inline AudioCapability bestAudioCapability(int sampleRate, int channels) const

Defined in src/av/include/icy/av/devicemanager.h:151

Find the audio capability closest to the requested parameters.

Scoring: sample rate match weighted 70%, channel count weighted 30%. Both dimensions are normalised to [0,1].

Returns a default capability with the requested values if none are available.

Public Types

NameDescription
Type

{#type-5}

Type

enum Type

Defined in src/av/include/icy/av/devicemanager.h:46

ValueDescription
Unknown
VideoInput
VideoOutput
AudioInput
AudioOutput

{#videocapability}

VideoCapability

#include <icy/av/devicemanager.h>
struct VideoCapability

Defined in src/av/include/icy/av/devicemanager.h:56

A video format supported by the device.

List of all members

NameKindOwner
widthvariableDeclared here
heightvariableDeclared here
minFpsvariableDeclared here
maxFpsvariableDeclared here
pixelFormatvariableDeclared here

Public Attributes

ReturnNameDescription
intwidth
intheight
doubleminFps
doublemaxFps
std::stringpixelFormat

{#width-1}

width

int width {0}

Defined in src/av/include/icy/av/devicemanager.h:58


{#height-1}

height

int height {0}

Defined in src/av/include/icy/av/devicemanager.h:59


{#minfps}

minFps

double minFps {0}

Defined in src/av/include/icy/av/devicemanager.h:60


{#maxfps}

maxFps

double maxFps {0}

Defined in src/av/include/icy/av/devicemanager.h:61


{#pixelformat}

pixelFormat

std::string pixelFormat

Defined in src/av/include/icy/av/devicemanager.h:62

{#audiocapability}

AudioCapability

#include <icy/av/devicemanager.h>
struct AudioCapability

Defined in src/av/include/icy/av/devicemanager.h:66

An audio format supported by the device.

List of all members

NameKindOwner
sampleRatevariableDeclared here
channelsvariableDeclared here
sampleFormatvariableDeclared here

Public Attributes

ReturnNameDescription
intsampleRate
intchannels
std::stringsampleFormat

{#samplerate-1}

sampleRate

int sampleRate {0}

Defined in src/av/include/icy/av/devicemanager.h:68


{#channels-1}

channels

int channels {0}

Defined in src/av/include/icy/av/devicemanager.h:69


{#sampleformat}

sampleFormat

std::string sampleFormat

Defined in src/av/include/icy/av/devicemanager.h:70

{#audioresampler}

AudioResampler

#include <icy/av/audioresampler.h>
struct AudioResampler

Defined in src/av/include/icy/av/audioresampler.h:39

Converts audio samples between different formats, sample rates, and channel layouts.

List of all members

NameKindOwner
ctxvariableDeclared here
iparamsvariableDeclared here
oparamsvariableDeclared here
outSamplesvariableDeclared here
outNumSamplesvariableDeclared here
outBufferSizevariableDeclared here
maxNumSamplesvariableDeclared here
inSampleFmtvariableDeclared here
outSampleFmtvariableDeclared here
AudioResamplerfunctionDeclared here
AudioResamplerfunctionDeclared here
AudioResamplerfunctionDeclared here
openfunctionDeclared here
closefunctionDeclared here
resamplefunctionDeclared here

Public Attributes

ReturnNameDescription
SwrContext *ctxthe conversion context
AudioCodeciparamsinput audio parameters
AudioCodecoparamsoutput audio parameters
uint8_t **outSamplesthe output samples buffer
intoutNumSamplesthe number of samples currently in the output buffer
intoutBufferSizethe number of bytes currently in the buffer
intmaxNumSamplesthe maximum number of samples that can be stored in
enum AVSampleFormatinSampleFmtinput sample format
enum AVSampleFormatoutSampleFmtoutput sample format

{#ctx-2}

ctx

SwrContext * ctx

Defined in src/av/include/icy/av/audioresampler.h:69

the conversion context


{#iparams-2}

iparams

AudioCodec iparams

Defined in src/av/include/icy/av/audioresampler.h:71

input audio parameters


{#oparams-2}

oparams

AudioCodec oparams

Defined in src/av/include/icy/av/audioresampler.h:72

output audio parameters


{#outsamples}

outSamples

uint8_t ** outSamples

Defined in src/av/include/icy/av/audioresampler.h:73

the output samples buffer


{#outnumsamples}

outNumSamples

int outNumSamples

Defined in src/av/include/icy/av/audioresampler.h:74

the number of samples currently in the output buffer


{#outbuffersize}

outBufferSize

int outBufferSize

Defined in src/av/include/icy/av/audioresampler.h:75

the number of bytes currently in the buffer


{#maxnumsamples}

maxNumSamples

int maxNumSamples

Defined in src/av/include/icy/av/audioresampler.h:76

the maximum number of samples that can be stored in


{#insamplefmt}

inSampleFmt

enum AVSampleFormat inSampleFmt

Defined in src/av/include/icy/av/audioresampler.h:77

input sample format


{#outsamplefmt}

outSampleFmt

enum AVSampleFormat outSampleFmt

Defined in src/av/include/icy/av/audioresampler.h:78

output sample format

Public Methods

ReturnNameDescription
AudioResampler
AudioResamplerDeleted constructor.
AudioResamplerDeleted constructor.
voidopenInitialise the libswresample context using iparams and oparams. Throws std::runtime_error if the context is already open or if required parameters (channels, sample rate, format) are missing.
voidcloseFree the libswresample context and release the output sample buffer.
intresampleConvert the input samples to the output format. NOTE: Input buffers must be contiguous, therefore only interleaved input formats are accepted at this point.

{#audioresampler-1}

AudioResampler

AudioResampler(const AudioCodec & iparams = AudioCodec(), const AudioCodec & oparams = AudioCodec())

Defined in src/av/include/icy/av/audioresampler.h:41


{#audioresampler-2}

AudioResampler

AudioResampler(const AudioResampler &) = delete

Defined in src/av/include/icy/av/audioresampler.h:45

Deleted constructor.


{#audioresampler-3}

AudioResampler

AudioResampler(AudioResampler &&) = delete

Defined in src/av/include/icy/av/audioresampler.h:47

Deleted constructor.


{#open-3}

open

void open()

Defined in src/av/include/icy/av/audioresampler.h:53

Initialise the libswresample context using iparams and oparams. Throws std::runtime_error if the context is already open or if required parameters (channels, sample rate, format) are missing.


{#close-9}

close

void close()

Defined in src/av/include/icy/av/audioresampler.h:56

Free the libswresample context and release the output sample buffer.


{#resample}

resample

int resample(uint8_t ** inSamples, int inNumSamples)

Defined in src/av/include/icy/av/audioresampler.h:67

Convert the input samples to the output format. NOTE: Input buffers must be contiguous, therefore only interleaved input formats are accepted at this point.

Converted samples are accessible via the [outSamples](#outsamples) class member.

Parameters

  • inSamples Pointer to the input sample buffer array.

  • inNumSamples The number of input samples per channel.

Returns

The number of converted samples, or zero if samples were internally buffered.

{#videoconverter}

VideoConverter

#include <icy/av/videoconverter.h>
struct VideoConverter

Defined in src/av/include/icy/av/videoconverter.h:32

Converts video frames between pixel formats and resolutions.

List of all members

NameKindOwner
ctxvariableDeclared here
oframevariableDeclared here
iparamsvariableDeclared here
oparamsvariableDeclared here
VideoConverterfunctionDeclared here
VideoConverterfunctionDeclared here
VideoConverterfunctionDeclared here
createfunctionDeclared here
closefunctionDeclared here
convertfunctionDeclared here

Public Attributes

ReturnNameDescription
SwsContext *ctxlibswscale conversion context.
AVFrame *oframeReusable output frame allocated by create().
VideoCodeciparamsExpected input video parameters.
VideoCodecoparamsTarget output video parameters.

{#ctx-3}

ctx

SwsContext * ctx

Defined in src/av/include/icy/av/videoconverter.h:56

libswscale conversion context.


{#oframe}

oframe

AVFrame * oframe

Defined in src/av/include/icy/av/videoconverter.h:57

Reusable output frame allocated by create().


{#iparams-3}

iparams

VideoCodec iparams

Defined in src/av/include/icy/av/videoconverter.h:58

Expected input video parameters.


{#oparams-3}

oparams

VideoCodec oparams

Defined in src/av/include/icy/av/videoconverter.h:59

Target output video parameters.

Public Methods

ReturnNameDescription
VideoConverter
VideoConverterDeleted constructor.
VideoConverterDeleted constructor.
voidcreate virtualInitialise the libswscale context and allocate the output frame. Uses iparams and oparams to configure the conversion pipeline. Throws std::runtime_error if already initialised or if parameters are invalid.
voidclose virtualFree the libswscale context and the output frame.
AVFrame *convert virtualConvert iframe to the output pixel format and resolution. The returned frame is owned by this converter and is overwritten on the next call.

{#videoconverter-1}

VideoConverter

VideoConverter()

Defined in src/av/include/icy/av/videoconverter.h:34


{#videoconverter-2}

VideoConverter

VideoConverter(const VideoConverter &) = delete

Defined in src/av/include/icy/av/videoconverter.h:37

Deleted constructor.


{#videoconverter-3}

VideoConverter

VideoConverter(VideoConverter &&) = delete

Defined in src/av/include/icy/av/videoconverter.h:39

Deleted constructor.


{#create-6}

create

virtual

virtual void create()

Defined in src/av/include/icy/av/videoconverter.h:45

Initialise the libswscale context and allocate the output frame. Uses iparams and oparams to configure the conversion pipeline. Throws std::runtime_error if already initialised or if parameters are invalid.


{#close-10}

close

virtual

virtual void close()

Defined in src/av/include/icy/av/videoconverter.h:48

Free the libswscale context and the output frame.


{#convert-1}

convert

virtual

virtual AVFrame * convert(AVFrame * iframe)

Defined in src/av/include/icy/av/videoconverter.h:54

Convert iframe to the output pixel format and resolution. The returned frame is owned by this converter and is overwritten on the next call.

Parameters

  • iframe The source AVFrame; must match iparams dimensions and pixel format.

Returns

The converted output AVFrame.

{#mediapacket}

MediaPacket

#include <icy/av/packet.h>
struct MediaPacket

Defined in src/av/include/icy/av/packet.h:28

Inherits: RawPacket Subclassed by: AudioPacket, VideoPacket

Timestamped media packet carrying raw audio or video data.

List of all members

NameKindOwner
timevariableDeclared here
MediaPacketfunctionDeclared here
MediaPacketfunctionDeclared here
MediaPacketfunctionDeclared here
clonefunctionDeclared here
classNamefunctionDeclared here
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket
operator<<friendInherited from IPacket

Inherited from RawPacket

KindNameDescription
variable_data
variable_size
variable_owned
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline

Inherited from IPacket

KindNameDescription
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.
friendoperator<< inlineStream insertion operator; delegates to print().

Public Attributes

ReturnNameDescription
int64_ttimePresentation timestamp in microseconds.

{#time-2}

time

int64_t time

Defined in src/av/include/icy/av/packet.h:30

Presentation timestamp in microseconds.

Public Methods

ReturnNameDescription
MediaPacket inlineConstruct with a non-owning or owning mutable buffer.
MediaPacket inlineConstruct with const data (copied, owning).
MediaPacket inlineCopy constructor.
std::unique_ptr< IPacket >clone virtual const inline override
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

{#mediapacket-1}

MediaPacket

inline

inline MediaPacket(uint8_t * data = nullptr, size_t size = 0, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:36

Construct with a non-owning or owning mutable buffer.

Parameters

  • data Pointer to the raw data buffer (may be null).

  • size Size of the buffer in bytes.

  • time Presentation timestamp in microseconds.


{#mediapacket-2}

MediaPacket

inline

inline MediaPacket(const uint8_t * data, size_t size, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:46

Construct with const data (copied, owning).

Parameters

  • data Pointer to the const raw data buffer (data is copied).

  • size Size of the buffer in bytes.

  • time Presentation timestamp in microseconds.


{#mediapacket-3}

MediaPacket

inline

inline MediaPacket(const MediaPacket & r)

Defined in src/av/include/icy/av/packet.h:53

Copy constructor.


{#clone}

clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:62

Returns

A heap-allocated copy of this packet.

Reimplements
Reimplemented by

{#classname}

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:64

Returns the class name of this packet type for logging and diagnostics.

Reimplements
Reimplemented by

{#videopacket}

VideoPacket

#include <icy/av/packet.h>
struct VideoPacket

Defined in src/av/include/icy/av/packet.h:69

Inherits: MediaPacket Subclassed by: PlanarVideoPacket

Video packet for interleaved formats.

List of all members

NameKindOwner
widthvariableDeclared here
heightvariableDeclared here
iframevariableDeclared here
avpacketvariableDeclared here
VideoPacketfunctionDeclared here
VideoPacketfunctionDeclared here
clonefunctionDeclared here
classNamefunctionDeclared here
timevariableInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
clonefunctionInherited from MediaPacket
classNamefunctionInherited from MediaPacket
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket
operator<<friendInherited from IPacket

Inherited from MediaPacket

KindNameDescription
variabletimePresentation timestamp in microseconds.
functionMediaPacket inlineConstruct with a non-owning or owning mutable buffer.
functionMediaPacket inlineConstruct with const data (copied, owning).
functionMediaPacket inlineCopy constructor.
functionclone virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from RawPacket

KindNameDescription
variable_data
variable_size
variable_owned
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline

Inherited from IPacket

KindNameDescription
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.
friendoperator<< inlineStream insertion operator; delegates to print().

Public Attributes

ReturnNameDescription
intwidthFrame width in pixels.
intheightFrame height in pixels.
booliframeTrue if this is an intra (keyframe) frame.
AVPacket *avpacketNon-owning pointer to the encoded AVPacket from FFmpeg. Set by VideoEncoder, read by MultiplexEncoder.

{#width-2}

width

int width

Defined in src/av/include/icy/av/packet.h:71

Frame width in pixels.


{#height-2}

height

int height

Defined in src/av/include/icy/av/packet.h:72

Frame height in pixels.


{#iframe}

iframe

bool iframe

Defined in src/av/include/icy/av/packet.h:73

True if this is an intra (keyframe) frame.


{#avpacket}

avpacket

AVPacket * avpacket = nullptr

Defined in src/av/include/icy/av/packet.h:77

Non-owning pointer to the encoded AVPacket from FFmpeg. Set by VideoEncoder, read by MultiplexEncoder.

Public Methods

ReturnNameDescription
VideoPacket inlineConstruct a video packet with an interleaved buffer.
VideoPacket inlineCopy constructor. The avpacket pointer is shallow-copied (non-owning).
std::unique_ptr< IPacket >clone virtual const inline override
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

{#videopacket-1}

VideoPacket

inline

inline VideoPacket(uint8_t * data = nullptr, size_t size = 0, int width = 0, int height = 0, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:85

Construct a video packet with an interleaved buffer.

Parameters

  • data Pointer to the raw frame buffer (may be null).

  • size Size of the buffer in bytes.

  • width Frame width in pixels.

  • height Frame height in pixels.

  • time Presentation timestamp in microseconds.


{#videopacket-2}

VideoPacket

inline

inline VideoPacket(const VideoPacket & r)

Defined in src/av/include/icy/av/packet.h:95

Copy constructor. The avpacket pointer is shallow-copied (non-owning).


{#clone-1}

clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:107

Returns

A heap-allocated copy of this packet.

Reimplements
Reimplemented by

{#classname-1}

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:109

Returns the class name of this packet type for logging and diagnostics.

Reimplements
Reimplemented by

{#planarvideopacket}

PlanarVideoPacket

#include <icy/av/packet.h>
struct PlanarVideoPacket

Defined in src/av/include/icy/av/packet.h:121

Inherits: VideoPacket Subclassed by: VisionFramePacket

Video packet for planar formats.

Parameters

  • data Array of per-plane data pointers (up to 4 planes).

  • linesize Array of per-plane byte strides.

  • pixelFmt The pixel format name (e.g. "yuv420p").

  • width The frame width in pixels.

  • height The frame height in pixels.

  • time The timestamp in microseconds.

List of all members

NameKindOwner
buffervariableDeclared here
linesizevariableDeclared here
pixelFmtvariableDeclared here
owns_buffervariableDeclared here
avframevariableDeclared here
PlanarVideoPacketfunctionDeclared here
PlanarVideoPacketfunctionDeclared here
clonefunctionDeclared here
classNamefunctionDeclared here
widthvariableInherited from VideoPacket
heightvariableInherited from VideoPacket
iframevariableInherited from VideoPacket
avpacketvariableInherited from VideoPacket
VideoPacketfunctionInherited from VideoPacket
VideoPacketfunctionInherited from VideoPacket
clonefunctionInherited from VideoPacket
classNamefunctionInherited from VideoPacket
timevariableInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
clonefunctionInherited from MediaPacket
classNamefunctionInherited from MediaPacket
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket
operator<<friendInherited from IPacket

Inherited from VideoPacket

KindNameDescription
variablewidthFrame width in pixels.
variableheightFrame height in pixels.
variableiframeTrue if this is an intra (keyframe) frame.
variableavpacketNon-owning pointer to the encoded AVPacket from FFmpeg. Set by VideoEncoder, read by MultiplexEncoder.
functionVideoPacket inlineConstruct a video packet with an interleaved buffer.
functionVideoPacket inlineCopy constructor. The avpacket pointer is shallow-copied (non-owning).
functionclone virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from MediaPacket

KindNameDescription
variabletimePresentation timestamp in microseconds.
functionMediaPacket inlineConstruct with a non-owning or owning mutable buffer.
functionMediaPacket inlineConstruct with const data (copied, owning).
functionMediaPacket inlineCopy constructor.
functionclone virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from RawPacket

KindNameDescription
variable_data
variable_size
variable_owned
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline

Inherited from IPacket

KindNameDescription
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.
friendoperator<< inlineStream insertion operator; delegates to print().

Public Attributes

ReturnNameDescription
uint8_t *buffer
intlinesize
std::stringpixelFmt
boolowns_buffer
AVFrame *avframeNon-owning pointer to the decoded AVFrame from FFmpeg. Set by VideoDecoder.

{#buffer}

buffer

uint8_t * buffer = {nullptr}

Defined in src/av/include/icy/av/packet.h:123


{#linesize}

linesize

int linesize = {0}

Defined in src/av/include/icy/av/packet.h:124


{#pixelfmt-1}

pixelFmt

std::string pixelFmt

Defined in src/av/include/icy/av/packet.h:125


{#owns_buffer}

owns_buffer

bool owns_buffer = false

Defined in src/av/include/icy/av/packet.h:126


{#avframe}

avframe

AVFrame * avframe = nullptr

Defined in src/av/include/icy/av/packet.h:130

Non-owning pointer to the decoded AVFrame from FFmpeg. Set by VideoDecoder.

Public Methods

ReturnNameDescription
PlanarVideoPacketConstruct a planar video packet, copying the plane pointers (not the pixel data).
PlanarVideoPacketCopy constructor. Performs a deep copy of the owned buffer if owns_buffer is set.
std::unique_ptr< IPacket >clone virtual const inline override
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

{#planarvideopacket-1}

PlanarVideoPacket

PlanarVideoPacket(uint8_t * data, const int linesize, const std::string & pixelFmt = "", int width = 0, int height = 0, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:139

Construct a planar video packet, copying the plane pointers (not the pixel data).

Parameters

  • data Array of up to 4 per-plane data pointers.

  • linesize Array of per-plane byte strides.

  • pixelFmt The pixel format string (e.g. "yuv420p").

  • width Frame width in pixels.

  • height Frame height in pixels.

  • time Presentation timestamp in microseconds.


{#planarvideopacket-2}

PlanarVideoPacket

PlanarVideoPacket(const PlanarVideoPacket & r)

Defined in src/av/include/icy/av/packet.h:143

Copy constructor. Performs a deep copy of the owned buffer if owns_buffer is set.


{#clone-2}

clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:147

Returns

A heap-allocated deep copy of this packet.

Reimplements
Reimplemented by

{#classname-2}

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:149

Returns the class name of this packet type for logging and diagnostics.

Reimplements
Reimplemented by

{#audiopacket}

AudioPacket

#include <icy/av/packet.h>
struct AudioPacket

Defined in src/av/include/icy/av/packet.h:154

Inherits: MediaPacket Subclassed by: PlanarAudioPacket

Audio packet for interleaved formats.

List of all members

NameKindOwner
numSamplesvariableDeclared here
avpacketvariableDeclared here
AudioPacketfunctionDeclared here
clonefunctionDeclared here
samplesfunctionDeclared here
classNamefunctionDeclared here
timevariableInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
clonefunctionInherited from MediaPacket
classNamefunctionInherited from MediaPacket
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket
operator<<friendInherited from IPacket

Inherited from MediaPacket

KindNameDescription
variabletimePresentation timestamp in microseconds.
functionMediaPacket inlineConstruct with a non-owning or owning mutable buffer.
functionMediaPacket inlineConstruct with const data (copied, owning).
functionMediaPacket inlineCopy constructor.
functionclone virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from RawPacket

KindNameDescription
variable_data
variable_size
variable_owned
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline

Inherited from IPacket

KindNameDescription
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.
friendoperator<< inlineStream insertion operator; delegates to print().

Public Attributes

ReturnNameDescription
size_tnumSamplesNumber of audio samples per channel.
AVPacket *avpacketNon-owning pointer to the encoded AVPacket from FFmpeg. Set by AudioEncoder, read by MultiplexEncoder.

{#numsamples}

numSamples

size_t numSamples

Defined in src/av/include/icy/av/packet.h:156

Number of audio samples per channel.


{#avpacket-1}

avpacket

AVPacket * avpacket = nullptr

Defined in src/av/include/icy/av/packet.h:160

Non-owning pointer to the encoded AVPacket from FFmpeg. Set by AudioEncoder, read by MultiplexEncoder.

Public Methods

ReturnNameDescription
AudioPacket inlineConstruct an audio packet with an interleaved sample buffer.
std::unique_ptr< IPacket >clone virtual const inline override
uint8_t *samples virtual const inline
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

{#audiopacket-1}

AudioPacket

inline

inline AudioPacket(uint8_t * data = nullptr, size_t size = 0, size_t numSamples = 0, int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:167

Construct an audio packet with an interleaved sample buffer.

Parameters

  • data Pointer to the interleaved sample buffer (may be null).

  • size Size of the buffer in bytes.

  • numSamples Number of samples per channel.

  • time Presentation timestamp in microseconds.


{#clone-3}

clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:178

Returns

A heap-allocated copy of this packet.

Reimplements
Reimplemented by

{#samples}

samples

virtual const inline

virtual inline uint8_t * samples() const

Defined in src/av/include/icy/av/packet.h:181

Returns

A pointer to the raw interleaved sample buffer.


{#classname-3}

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:186

Returns the class name of this packet type for logging and diagnostics.

Reimplements
Reimplemented by

{#planaraudiopacket}

PlanarAudioPacket

#include <icy/av/packet.h>
struct PlanarAudioPacket

Defined in src/av/include/icy/av/packet.h:197

Inherits: AudioPacket

Audio packet for planar formats.

Parameters

  • data Array of per-plane sample buffers (one per channel).

  • channels The number of audio channels.

  • numSamples The number of samples per channel.

  • sampleFmt The sample format name (e.g. "fltp").

  • time The timestamp in microseconds.

List of all members

NameKindOwner
buffervariableDeclared here
linesizevariableDeclared here
channelsvariableDeclared here
sampleFmtvariableDeclared here
owns_buffervariableDeclared here
PlanarAudioPacketfunctionDeclared here
PlanarAudioPacketfunctionDeclared here
clonefunctionDeclared here
classNamefunctionDeclared here
numSamplesvariableInherited from AudioPacket
avpacketvariableInherited from AudioPacket
AudioPacketfunctionInherited from AudioPacket
clonefunctionInherited from AudioPacket
samplesfunctionInherited from AudioPacket
classNamefunctionInherited from AudioPacket
timevariableInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
MediaPacketfunctionInherited from MediaPacket
clonefunctionInherited from MediaPacket
classNamefunctionInherited from MediaPacket
_datavariableInherited from RawPacket
_sizevariableInherited from RawPacket
_ownedvariableInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
RawPacketfunctionInherited from RawPacket
~RawPacketfunctionInherited from RawPacket
clonefunctionInherited from RawPacket
copyDatafunctionInherited from RawPacket
readfunctionInherited from RawPacket
writefunctionInherited from RawPacket
datafunctionInherited from RawPacket
sizefunctionInherited from RawPacket
classNamefunctionInherited from RawPacket
ownsBufferfunctionInherited from RawPacket
opaquevariableInherited from IPacket
infovariableInherited from IPacket
flagsvariableInherited from IPacket
IPacketfunctionInherited from IPacket
IPacketfunctionInherited from IPacket
operator=functionInherited from IPacket
clonefunctionInherited from IPacket
~IPacketfunctionInherited from IPacket
readfunctionInherited from IPacket
writefunctionInherited from IPacket
sizefunctionInherited from IPacket
hasDatafunctionInherited from IPacket
datafunctionInherited from IPacket
constDatafunctionInherited from IPacket
classNamefunctionInherited from IPacket
printfunctionInherited from IPacket
operator<<friendInherited from IPacket

Inherited from AudioPacket

KindNameDescription
variablenumSamplesNumber of audio samples per channel.
variableavpacketNon-owning pointer to the encoded AVPacket from FFmpeg. Set by AudioEncoder, read by MultiplexEncoder.
functionAudioPacket inlineConstruct an audio packet with an interleaved sample buffer.
functionclone virtual const inline override
functionsamples virtual const inline
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from MediaPacket

KindNameDescription
variabletimePresentation timestamp in microseconds.
functionMediaPacket inlineConstruct with a non-owning or owning mutable buffer.
functionMediaPacket inlineConstruct with const data (copied, owning).
functionMediaPacket inlineCopy constructor.
functionclone virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

Inherited from RawPacket

KindNameDescription
variable_data
variable_size
variable_owned
functionRawPacket inlineConstruct with borrowed (non-owning) buffer.
functionRawPacket inlineConstruct with const data (copied, owning).
functionRawPacket inlineCopy constructor (always copies data).
function~RawPacket virtualDefaulted destructor.
functionclone virtual const inline override
functioncopyData virtual inlineCopies data into an internally owned buffer, replacing any prior content.
functionread virtual inline overrideReads from the buffer by copying its contents into an owned buffer.
functionwrite virtual const inline overrideAppends the packet data to the given output buffer.
functiondata virtual const inline override
functionsize virtual const inline override
functionclassName virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.
functionownsBuffer const inline

Inherited from IPacket

KindNameDescription
variableopaqueOptional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime.
variableinfoOptional extra information about the packet.
variableflagsProvides basic information about the packet.
functionIPacket inline
functionIPacket inlineCopy constructor; clones the info object if present.
functionoperator= inlineCopy assignment; clones the info object if present.
functionclone virtual constReturns a heap-allocated deep copy of this packet.
function~IPacket virtualDefaulted destructor.
functionread virtualRead/parse to the packet from the given input buffer. The number of bytes read is returned.
functionwrite virtual constCopy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer.
functionsize virtual const inlineThe size of the packet in bytes.
functionhasData virtual const inlineReturns true if the packet has a non-null data pointer.
functiondata virtual const inlineThe packet data pointer for buffered packets.
functionconstData virtual const inlineThe const packet data pointer for buffered packets.
functionclassName virtual constReturns the class name of this packet type for logging and diagnostics.
functionprint virtual const inlinePrints a human-readable representation to the given stream.
friendoperator<< inlineStream insertion operator; delegates to print().

Public Attributes

ReturnNameDescription
uint8_t *buffer
intlinesize
intchannels
std::stringsampleFmt
boolowns_buffer

{#buffer-1}

buffer

uint8_t * buffer = {nullptr}

Defined in src/av/include/icy/av/packet.h:199


{#linesize-1}

linesize

int linesize = 0

Defined in src/av/include/icy/av/packet.h:200


{#channels-2}

channels

int channels = 0

Defined in src/av/include/icy/av/packet.h:201


{#samplefmt-1}

sampleFmt

std::string sampleFmt

Defined in src/av/include/icy/av/packet.h:202


{#owns_buffer-1}

owns_buffer

bool owns_buffer = false

Defined in src/av/include/icy/av/packet.h:203

Public Methods

ReturnNameDescription
PlanarAudioPacketConstruct a planar audio packet, copying the plane pointers (not the sample data).
PlanarAudioPacketCopy constructor. Performs a deep copy of the owned buffer if owns_buffer is set.
std::unique_ptr< IPacket >clone virtual const inline override
const char *className virtual const inline overrideReturns the class name of this packet type for logging and diagnostics.

{#planaraudiopacket-1}

PlanarAudioPacket

PlanarAudioPacket(uint8_t * data, int channels = 0, size_t numSamples = 0, const std::string & sampleFmt = "", int64_t time = 0)

Defined in src/av/include/icy/av/packet.h:211

Construct a planar audio packet, copying the plane pointers (not the sample data).

Parameters

  • data Array of up to 4 per-channel sample buffers.

  • channels Number of audio channels.

  • numSamples Number of samples per channel.

  • sampleFmt The sample format string (e.g. "fltp").

  • time Presentation timestamp in microseconds.


{#planaraudiopacket-2}

PlanarAudioPacket

PlanarAudioPacket(const PlanarAudioPacket & r)

Defined in src/av/include/icy/av/packet.h:215

Copy constructor. Performs a deep copy of the owned buffer if owns_buffer is set.


{#clone-4}

clone

virtual const inline override

virtual inline std::unique_ptr< IPacket > clone() const override

Defined in src/av/include/icy/av/packet.h:219

Returns

A heap-allocated deep copy of this packet.

Reimplements

{#classname-4}

className

virtual const inline override

virtual inline const char * className() const override

Defined in src/av/include/icy/av/packet.h:221

Returns the class name of this packet type for logging and diagnostics.

Reimplements