av
May 15, 2026 ยท View on GitHub
{#avmodule}
av
Audio/video encoding, decoding, device capture, and media formats.
Namespaces
| Name | Description |
|---|---|
v4l2 | Linux V4L2 device enumeration helpers. |
coreaudio | Apple CoreAudio device enumeration helpers. |
legacy | Legacy timing helpers kept for compatibility with older media pipelines. |
avfoundation | Apple AVFoundation device enumeration helpers. |
mediafoundation | Windows Media Foundation device enumeration helpers. |
wasapi | Windows WASAPI device enumeration helpers. |
Classes
| Name | Description |
|---|---|
LinuxDeviceWatcher | Monitors device add/remove events via libudev. |
ICapture | Abstract interface for audio and video capture devices. |
IEncoder | This is the abstract class for all encoders. |
AppleDeviceWatcher | Monitors device add/remove events via AVFoundation notifications and CoreAudio property listeners. |
FPSCounter | FPS counter based on the simple moving average (SMA) algorithm. |
FPSLimiter | PacketStream processor that caps packet throughput to a maximum FPS. |
AudioCapture | Cross-platform audio capture device backed by FFmpeg input devices. |
MediaCapture | Unified capture and decode source for files and live media devices. |
VideoCapture | Cross-platform video device capturer backed by FFmpeg avdevice. |
DeviceWatcher | Base class for platform-specific device change monitors. |
DeviceManager | Enumerates and manages system audio and video devices. |
FormatRegistry | Singleton registry of available media container formats for encoding and decoding. |
WindowsDeviceWatcher | Monitors device add/remove events via IMMNotificationClient (audio) and RegisterDeviceNotification (video). |
MultiplexEncoder | Multiplexing encoder that writes synchronized audio and video streams. |
AudioPacketEncoder | PacketProcessor that encodes raw audio samples (PlanarAudioPacket or AudioPacket) into compressed packets via AudioEncoder. |
VideoPacketEncoder | PacketProcessor that encodes raw video frames (PlanarVideoPacket or VideoPacket) into compressed packets via VideoEncoder. |
RealtimePacketQueue | Queue that emits media packets in presentation-timestamp order relative to a realtime clock. |
MultiplexPacketEncoder | Encodes and multiplexes a realtime video stream form audio / video capture sources. FFmpeg is used for encoding. |
Codec | Codec for encoding/decoding media. |
AudioCodec | Audio codec parameters including channels, sample rate, and sample format. |
VideoCodec | Video codec parameters including resolution, frame rate, and pixel format. |
Deleter | RAII helpers for owning FFmpeg allocation types. |
Deleterp | Deleter adaptor for functions like av_freep that take a pointer to a pointer. |
Format | Defines a media container format which is available through the FormatRegistry for encoding or decoding. |
EncoderState | State machine states for the encoder pipeline. |
EncoderOptions | Configuration options for audio and video encoders. |
AudioBuffer | FIFO buffer for queuing audio samples between encoding stages. |
AudioContext | Base context for audio encoding and decoding via FFmpeg. |
AudioDecoder | Decodes compressed audio packets into raw sample frames. |
AudioEncoder | Encodes raw audio samples into a compressed format. |
VideoContext | Base video context from which all video encoders and decoders derive. |
VideoDecoder | Decodes compressed video packets into raw frames. |
VideoEncoder | Encodes raw video frames into a compressed format. |
Device | Represents a system audio, video or render device. |
AudioResampler | Converts audio samples between different formats, sample rates, and channel layouts. |
VideoConverter | Converts video frames between pixel formats and resolutions. |
MediaPacket | Timestamped media packet carrying raw audio or video data. |
VideoPacket | Video packet for interleaved formats. |
PlanarVideoPacket | Video packet for planar formats. |
AudioPacket | Audio packet for interleaved formats. |
PlanarAudioPacket | Audio packet for planar formats. |
Macros
| Name | Description |
|---|---|
MAX_AUDIO_PACKET_SIZE | 1 second of 48khz 32bit audio |
MAX_ENCODE_DURATION | 3 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
| Name | Description |
|---|---|
MediaCapabilities | Bitmask of media capabilities detected on this system. |
{#mediacapabilities}
MediaCapabilities
enum MediaCapabilities
Bitmask of media capabilities detected on this system.
| Value | Description |
|---|---|
AUDIO_RECV | Audio capture or decode is available. |
AUDIO_SEND | Audio playback or encode is available. |
VIDEO_RECV | Video capture or decode is available. |
VIDEO_SEND | Video render or encode is available. |
Typedefs
| Return | Name | Description |
|---|---|---|
std::list< Codec > | CodecList | List of codec value objects. |
std::list< Codec * > | CodecPList | List of codec pointers. |
std::unique_ptr< AVFrame, Deleterp< AVFrame, void, av_frame_free > > | AVFrameHolder | Owning AVFrame pointer released with av_frame_free(). |
std::unique_ptr< AVFormatContext, Deleter< AVFormatContext, void, avformat_free_context > > | AVFormatContextHolder | Owning AVFormatContext pointer released with avformat_free_context(). |
std::unique_ptr< AVCodecContext, Deleterp< AVCodecContext, void, avcodec_free_context > > | AVCodecContextHolder | Owning AVCodecContext pointer released with avcodec_free_context(). |
std::unique_ptr< AVDictionary *, Deleter< AVDictionary *, void, av_dict_free > > | AVDictionaryCleanup | Cleanup wrapper for AVDictionary* values freed with av_dict_free(). |
std::unique_ptr< AVPacket, Deleterp< AVPacket, void, av_packet_free > > | AVPacketHolder | Owning AVPacket pointer released with av_packet_free(). |
std::vector< Format > | FormatList | List of container format value objects. |
std::vector< Format * > | FormatPList | List of container format pointers. |
IEncoder | IPacketEncoder | Legacy 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
| Return | Name | Description |
|---|---|---|
int64_t | fpsToInterval inline | Convert a frame rate to a nanosecond frame interval. |
int | intervalToFps inline | Convert a nanosecond frame interval to a frame rate. |
float | intervalToFpsFloat inline | Convert a nanosecond frame interval to a floating-point frame rate. |
void | initializeFFmpeg | Initialize the FFmpeg library. |
void | uninitializeFFmpeg | Uninitializes the FFmpeg library. |
std::string | averror | Get an error string for the given error code. |
void | printInputFormats | Print all available FFmpeg demuxer (input) format names to the given stream. |
void | printOutputFormats | Print all available FFmpeg muxer (output) format names to the given stream. |
void | printEncoders | Print all available FFmpeg encoder names to the given stream. |
AVPacketHolder | makeOwnedPacket | 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. |
void | initAudioCodecFromContext | Populate an AudioCodec from an open AVCodecContext. |
AVSampleFormat | selectSampleFormat | 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. |
bool | isSampleFormatSupported | Check whether a specific sample format is in the codec's supported list. |
bool | formatIsPlanar | Return true if the named sample format is planar (e.g. "fltp", "s16p"). |
bool | formatIsPlanar | Return true if the given AVSampleFormat is planar. |
AVFrame * | createVideoFrame | Allocate a new AVFrame with the given pixel format and dimensions. Uses av_frame_get_buffer for reference-counted allocation with 16-byte alignment. |
AVFrame * | cloneVideoFrame | Perform a deep copy of an AVFrame including its buffer data and properties. |
void | initVideoCodecFromContext | Populate a VideoCodec from an open AVStream and AVCodecContext. |
AVPixelFormat | selectPixelFormat | 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. |
std::optional< std::pair< const AVInputFormat *, std::string > > | parseDeviceUrl | Parse a libavdevice URL scheme. |
{#fpstointerval}
fpsToInterval
inline
inline int64_t fpsToInterval(int fps)
Convert a frame rate to a nanosecond frame interval.
Parameters
fpsThe 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
intervalThe 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
intervalThe 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
-
ostThe output stream to write to. -
delimDelimiter 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
-
ostThe output stream to write to. -
delimDelimiter 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
-
ostThe output stream to write to. -
delimDelimiter 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
-
ctxThe FFmpeg codec context to read from. -
paramsThe 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
-
codecThe FFmpeg codec whose supported formats are queried. -
paramsThe 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
-
codecThe FFmpeg codec to query. -
sampleFormatThe 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
pixfmtThe sample format name string.
{#formatisplanar-1}
formatIsPlanar
bool formatIsPlanar(AVSampleFormat format)
Return true if the given AVSampleFormat is planar.
Parameters
formatThe 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
-
pixelFmtThe pixel format for the frame. -
widthThe frame width in pixels. -
heightThe 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
sourceThe 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
-
streamThe AVStream for frame rate information (may be null). -
ctxThe FFmpeg codec context to read from. -
paramsThe 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
-
codecThe FFmpeg codec whose supported formats are queried. -
paramsThe 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:
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
| Return | Name | Description |
|---|---|---|
bool | getDeviceList | Enumerate 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
-
typeMust be Device::VideoInput. -
devicesOutput vector to fill with discovered devices.
Returns
True if enumeration succeeded.
{#coreaudio}
coreaudio
Apple CoreAudio device enumeration helpers.
Functions
| Return | Name | Description |
|---|---|---|
bool | getDeviceList | Enumerate 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
-
typeThe device type to enumerate (AudioInput or AudioOutput). -
devicesOutput vector to fill with discovered devices.
Returns
True if enumeration succeeded.
{#legacy}
legacy
Legacy timing helpers kept for compatibility with older media pipelines.
Classes
| Name | Description |
|---|---|
FPSCounter | Legacy 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
| Name | Kind | Owner |
|---|---|---|
start | variable | Declared here |
end | variable | Declared here |
frames | variable | Declared here |
total | variable | Declared here |
fps | variable | Declared here |
FPSCounter | function | Declared here |
tick | function | Declared here |
reset | function | Declared here |
started | function | Declared here |
startFrame | function | Declared here |
endFrame | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
clock_t | start | |
clock_t | end | |
int64_t | frames | |
double | total | |
double | fps |
{#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
| Return | Name | Description |
|---|---|---|
FPSCounter inline | ||
void | tick inline | Begin a new timing cycle (calls endFrame() first if already started). |
void | reset inline | Reset all counters to zero. |
bool | started inline | |
void | startFrame inline | Record the frame start time. |
double | endFrame inline | Record 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
| Return | Name | Description |
|---|---|---|
bool | getDeviceList | Enumerate 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
-
typeMust be Device::VideoInput. -
devicesOutput vector to fill with discovered devices.
Returns
True if enumeration succeeded.
{#mediafoundation}
mediafoundation
Windows Media Foundation device enumeration helpers.
Functions
| Return | Name | Description |
|---|---|---|
bool | getDeviceList | Enumerate 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
-
typeThe device type to enumerate (VideoInput or AudioInput). -
devicesOutput vector to fill with discovered devices.
Returns
True if enumeration succeeded.
{#wasapi}
wasapi
Windows WASAPI device enumeration helpers.
Functions
| Return | Name | Description |
|---|---|---|
bool | getDeviceList | Enumerate 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
-
typeThe device type to enumerate (AudioInput or AudioOutput). -
devicesOutput 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
| Name | Kind | Owner |
|---|---|---|
LinuxDeviceWatcher | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
_impl | variable | Declared here |
_manager | variable | Declared here |
DeviceWatcher | function | Inherited from DeviceWatcher |
start | function | Inherited from DeviceWatcher |
stop | function | Inherited from DeviceWatcher |
Inherited from DeviceWatcher
| Kind | Name | Description |
|---|---|---|
function | DeviceWatcher inline explicit | |
function | start virtual inline | |
function | stop virtual inline |
Public Methods
| Return | Name | Description |
|---|---|---|
LinuxDeviceWatcher explicit | ||
bool | start virtual override | Begin monitoring via libudev inotify events. |
void | stop virtual override | Stop 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
managerThe 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
| Return | Name | Description |
|---|---|---|
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,StartableSubclassed by:MediaCapture
Abstract interface for audio and video capture devices.
List of all members
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
ICapture | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
openFile | function | Declared here |
close | function | Declared here |
getEncoderFormat | function | Declared here |
getEncoderAudioCodec | function | Declared here |
getEncoderVideoCodec | function | Declared here |
openAudio | function | Declared here |
openVideo | function | Declared here |
onStreamStateChange | function | Declared here |
openStream | function | Declared here |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
start | function | Inherited from Startable |
stop | function | Inherited from Startable |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Inherited from Startable
| Kind | Name | Description |
|---|---|---|
function | start virtual | Starts the object (e.g. begins processing or listening). |
function | stop virtual | Stops the object (e.g. halts processing or closes resources). |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
{#emitter}
emitter
PacketSignal emitter
Defined in src/av/include/icy/av/icapture.h:89
Public Methods
| Return | Name | Description |
|---|---|---|
ICapture inline | ||
void | start virtual override | Start capturing and emitting packets. |
void | stop virtual override | Stop capturing and release device resources. |
void | openFile virtual inline | Open a media file as the capture source. |
void | close virtual inline | Release the capture source and any associated resources. |
void | getEncoderFormat virtual | Populate iformat with the encoder-ready format derived from this capture source. |
void | getEncoderAudioCodec virtual inline | Populate params with the encoder-ready audio codec parameters. |
void | getEncoderVideoCodec virtual inline | Populate params with the encoder-ready video codec parameters. |
void | openAudio virtual inline | Open an audio capture device with the given parameters. |
void | openVideo virtual inline | Open a video capture device with the given parameters. |
void | onStreamStateChange virtual inline override | React 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
filePath 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
iformatOutput 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
paramsOutput AudioCodec struct to fill.
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
paramsOutput VideoCodec struct to fill.
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
-
deviceThe platform audio device identifier. -
paramsThe 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
-
deviceThe platform video device identifier. -
paramsThe 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
| Return | Name | Description |
|---|---|---|
void | openStream 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
| Name | Kind | Owner |
|---|---|---|
init | function | Declared here |
uninit | function | Declared here |
cleanup | function | Declared here |
options | function | Declared here |
createVideo | function | Declared here |
freeVideo | function | Declared here |
encodeVideo | function | Declared here |
createAudio | function | Declared here |
freeAudio | function | Declared here |
flush | function | Declared here |
isNone | function | Declared here |
isReady | function | Declared here |
isEncoding | function | Declared here |
isActive | function | Declared here |
isStopped | function | Declared here |
isError | function | Declared here |
Type | enum | Declared here |
StateChange | variable | Inherited from Stateful |
_state | variable | Inherited from Stateful |
Stateful | function | Inherited from Stateful |
~Stateful | function | Inherited from Stateful |
stateEquals | function | Inherited from Stateful |
stateBetween | function | Inherited from Stateful |
state | function | Inherited from Stateful |
state | function | Inherited from Stateful |
beforeStateChange | function | Inherited from Stateful |
onStateChange | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
Inherited from Stateful
| Kind | Name | Description |
|---|---|---|
variable | StateChange | Signals when the state changes. |
variable | _state | |
function | Stateful inline | |
function | ~Stateful virtual inline | |
function | stateEquals virtual const inline | Returns true if the current state ID equals the given ID. |
function | stateBetween virtual const inline | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | state virtual inline | Returns a mutable reference to the current state. |
function | state virtual const inline | Returns a copy of the current state. |
function | beforeStateChange virtual inline | Override to handle pre state change logic. Return false to prevent state change. |
function | onStateChange virtual inline | Override to handle post state change logic. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
Public Methods
| Return | Name | Description |
|---|---|---|
void | init virtual | Initialise the encoder, open codec contexts, and transition to Ready or Encoding state. |
void | uninit virtual | Flush remaining packets, close codec contexts, and release all encoder resources. |
void | cleanup virtual inline | Perform any additional cleanup after uninit(). Default is a no-op. |
const EncoderOptions & | options virtual const nodiscard | |
void | createVideo virtual inline | Initialise the video codec context and stream. |
void | freeVideo virtual inline | Free the video codec context and stream. |
bool | encodeVideo virtual inline nodiscard | Encode a single AVFrame of video. |
void | createAudio virtual inline | Initialise the audio codec context and stream. |
void | freeAudio virtual inline | Free the audio codec context and stream. |
void | flush virtual inline | Flush any internally buffered packets to the output. |
bool | isNone const inline | |
bool | isReady const inline | |
bool | isEncoding virtual const inline | |
bool | isActive virtual const inline | |
bool | isStopped virtual const inline | |
bool | isError 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
frameThe 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
| Name | Description |
|---|---|
Type |
{#type-3}
Type
enum Type
Defined in src/av/include/icy/av/iencoder.h:84
| Value | Description |
|---|---|
None | huh? |
Video | video only |
Audio | audio only |
Multiplex | both 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
| Name | Kind | Owner |
|---|---|---|
AppleDeviceWatcher | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
_impl | variable | Declared here |
_manager | variable | Declared here |
DeviceWatcher | function | Inherited from DeviceWatcher |
start | function | Inherited from DeviceWatcher |
stop | function | Inherited from DeviceWatcher |
Inherited from DeviceWatcher
| Kind | Name | Description |
|---|---|---|
function | DeviceWatcher inline explicit | |
function | start virtual inline | |
function | stop virtual inline |
Public Methods
| Return | Name | Description |
|---|---|---|
AppleDeviceWatcher explicit | ||
bool | start virtual override | Begin monitoring for device connect/disconnect events. |
void | stop virtual override | Stop 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
managerThe 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
| Return | Name | Description |
|---|---|---|
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
| Name | Kind | Owner |
|---|---|---|
fps | variable | Declared here |
frames | variable | Declared here |
FPSCounter | function | Declared here |
reset | function | Declared here |
tick | function | Declared here |
tickIndex | variable | Declared here |
prevTick | variable | Declared here |
tickSum | variable | Declared here |
tickList | variable | Declared here |
updateAvg | function | Declared here |
MAX | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
double | fps | |
int64_t | frames |
{#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
| Return | Name | Description |
|---|---|---|
FPSCounter inline | Initialise the counter with all zeroes. | |
void | reset inline | Reset all counters and the SMA window to zero. |
void | tick inline | Record 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
| Return | Name | Description |
|---|---|---|
int | tickIndex | |
clock_t | prevTick | |
clock_t | tickSum | |
clock_t | tickList |
{#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
| Return | Name | Description |
|---|---|---|
double | updateAvg inline |
{#updateavg}
updateAvg
inline
inline double updateAvg(clock_t newTick)
Defined in src/av/include/icy/av/fpscounter.h:37
Private Static Attributes
| Return | Name | Description |
|---|---|---|
const int | MAX 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
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process(). |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
{#emitter-1}
emitter
PacketSignal emitter
Defined in src/av/include/icy/av/fpscounter.h:192
Public Methods
| Return | Name | Description |
|---|---|---|
FPSLimiter inline | Construct the limiter. | |
void | process virtual inline | Process a packet: forward it if within the rate limit, drop it otherwise. |
void | onStreamStateChange virtual inline | Reset 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
-
maxThe maximum allowed frame rate in frames per second. -
videoOnlyIf 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
packetThe 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
| Return | Name | Description |
|---|---|---|
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
| Name | Kind | Owner |
|---|---|---|
AudioCapture | function | Declared here |
AudioCapture | function | Declared here |
AudioCapture | function | Declared here |
openAudio | function | Declared here |
openAudio | function | Declared here |
Ptr | typedef | Declared here |
Closing | variable | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
openFile | function | Inherited from MediaCapture |
close | function | Inherited from MediaCapture |
start | function | Inherited from MediaCapture |
stop | function | Inherited from MediaCapture |
run | function | Inherited from MediaCapture |
getEncoderFormat | function | Inherited from MediaCapture |
getEncoderAudioCodec | function | Inherited from MediaCapture |
getEncoderVideoCodec | function | Inherited from MediaCapture |
setLoopInput | function | Inherited from MediaCapture |
setLimitFramerate | function | Inherited from MediaCapture |
setRealtimePTS | function | Inherited from MediaCapture |
setOpenOptions | function | Inherited from MediaCapture |
setPassthroughVideo | function | Inherited from MediaCapture |
formatCtx | function | Inherited from MediaCapture |
video | function | Inherited from MediaCapture |
audio | function | Inherited from MediaCapture |
stopping | function | Inherited from MediaCapture |
error | function | Inherited from MediaCapture |
_mutex | variable | Inherited from MediaCapture |
_thread | variable | Inherited from MediaCapture |
_formatCtx | variable | Inherited from MediaCapture |
_video | variable | Inherited from MediaCapture |
_audio | variable | Inherited from MediaCapture |
_error | variable | Inherited from MediaCapture |
_stopping | variable | Inherited from MediaCapture |
_looping | variable | Inherited from MediaCapture |
_realtime | variable | Inherited from MediaCapture |
_ratelimit | variable | Inherited from MediaCapture |
_passthroughVideo | variable | Inherited from MediaCapture |
_openOptions | variable | Inherited from MediaCapture |
_videoStream | variable | Inherited from MediaCapture |
openStream | function | Inherited from MediaCapture |
emit | function | Inherited from MediaCapture |
Ptr | typedef | Inherited from MediaCapture |
emitter | variable | Inherited from ICapture |
ICapture | function | Inherited from ICapture |
start | function | Inherited from ICapture |
stop | function | Inherited from ICapture |
openFile | function | Inherited from ICapture |
close | function | Inherited from ICapture |
getEncoderFormat | function | Inherited from ICapture |
getEncoderAudioCodec | function | Inherited from ICapture |
getEncoderVideoCodec | function | Inherited from ICapture |
openAudio | function | Inherited from ICapture |
openVideo | function | Inherited from ICapture |
onStreamStateChange | function | Inherited from ICapture |
openStream | function | Inherited from ICapture |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
start | function | Inherited from Startable |
stop | function | Inherited from Startable |
Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
Inherited from MediaCapture
| Kind | Name | Description |
|---|---|---|
variable | Closing | Signals that the capture thread is closing. This signal is emitted from the capture thread context. |
function | MediaCapture | |
function | MediaCapture | Deleted constructor. |
function | MediaCapture | Deleted constructor. |
function | openFile virtual override | Open a media file for decoding. Automatically detects video and audio streams. |
function | close virtual override | Stop the capture thread and close the media stream and all decoders. |
function | start virtual override | Start the background capture and decode thread. Throws std::runtime_error if no media streams have been opened. |
function | stop virtual override | Signal the capture thread to stop and join it before returning. |
function | run virtual override | Entry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called. |
function | getEncoderFormat virtual override | Fill format with the combined encoder-ready video and audio codec parameters. |
function | getEncoderAudioCodec virtual override | Fill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised. |
function | getEncoderVideoCodec virtual override | Fill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised. |
function | setLoopInput | Continuously loop the input file when set. |
function | setLimitFramerate | Limit playback to video FPS. |
function | setRealtimePTS | Set to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable. |
function | setOpenOptions | 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. |
function | setPassthroughVideo | 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. |
function | formatCtx const | |
function | video const | |
function | audio const | |
function | stopping const | |
function | error 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 | |
function | openStream virtual override | Open the underlying media stream. |
function | emit virtual override | Emit an existing packet directly onto the outgoing signal. |
typedef | Ptr |
Inherited from ICapture
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
function | ICapture inline | |
function | start virtual override | Start capturing and emitting packets. |
function | stop virtual override | Stop capturing and release device resources. |
function | openFile virtual inline | Open a media file as the capture source. |
function | close virtual inline | Release the capture source and any associated resources. |
function | getEncoderFormat virtual | Populate iformat with the encoder-ready format derived from this capture source. |
function | getEncoderAudioCodec virtual inline | Populate params with the encoder-ready audio codec parameters. |
function | getEncoderVideoCodec virtual inline | Populate params with the encoder-ready video codec parameters. |
function | openAudio virtual inline | Open an audio capture device with the given parameters. |
function | openVideo virtual inline | Open a video capture device with the given parameters. |
function | onStreamStateChange virtual inline override | React to PacketStream state transitions by starting or stopping capture. |
function | openStream virtual inline |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Inherited from Startable
| Kind | Name | Description |
|---|---|---|
function | start virtual | Starts the object (e.g. begins processing or listening). |
function | stop virtual | Stops the object (e.g. halts processing or closes resources). |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
Public Methods
| Return | Name | Description |
|---|---|---|
AudioCapture | Construct without opening a device. Call openAudio() before start(). | |
AudioCapture | Construct and immediately open the given audio device using an AudioCodec params struct. | |
AudioCapture | Construct and immediately open the given audio device with individual parameters. | |
void | openAudio virtual override | Open the given audio device using an AudioCodec params struct. |
void | openAudio virtual | 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. |
{#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
-
deviceThe platform audio device identifier. -
paramsThe 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
-
deviceThe platform audio device identifier. -
channelsThe desired number of channels, or -1 for device default. -
sampleRateThe desired sample rate in Hz, or -1 for device default. -
sampleFmtThe 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
-
deviceThe platform audio device identifier. -
paramsThe 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
-
deviceThe platform audio device identifier. -
channelsThe desired number of channels, or -1 for device default. -
sampleRateThe desired sample rate in Hz, or -1 for device default. -
sampleFmtThe desired sample format string, or "" for device default.
Public Types
| Name | Description |
|---|---|
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,RunnableSubclassed by:AudioCapture,VideoCapture
Unified capture and decode source for files and live media devices.
List of all members
| Name | Kind | Owner |
|---|---|---|
Closing | variable | Declared here |
MediaCapture | function | Declared here |
MediaCapture | function | Declared here |
MediaCapture | function | Declared here |
openFile | function | Declared here |
close | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
run | function | Declared here |
getEncoderFormat | function | Declared here |
getEncoderAudioCodec | function | Declared here |
getEncoderVideoCodec | function | Declared here |
setLoopInput | function | Declared here |
setLimitFramerate | function | Declared here |
setRealtimePTS | function | Declared here |
setOpenOptions | function | Declared here |
setPassthroughVideo | function | Declared here |
formatCtx | function | Declared here |
video | function | Declared here |
audio | function | Declared here |
stopping | function | Declared here |
error | function | Declared here |
_mutex | variable | Declared here |
_thread | variable | Declared here |
_formatCtx | variable | Declared here |
_video | variable | Declared here |
_audio | variable | Declared here |
_error | variable | Declared here |
_stopping | variable | Declared here |
_looping | variable | Declared here |
_realtime | variable | Declared here |
_ratelimit | variable | Declared here |
_passthroughVideo | variable | Declared here |
_openOptions | variable | Declared here |
_videoStream | variable | Declared here |
openStream | function | Declared here |
emit | function | Declared here |
Ptr | typedef | Declared here |
emitter | variable | Inherited from ICapture |
ICapture | function | Inherited from ICapture |
start | function | Inherited from ICapture |
stop | function | Inherited from ICapture |
openFile | function | Inherited from ICapture |
close | function | Inherited from ICapture |
getEncoderFormat | function | Inherited from ICapture |
getEncoderAudioCodec | function | Inherited from ICapture |
getEncoderVideoCodec | function | Inherited from ICapture |
openAudio | function | Inherited from ICapture |
openVideo | function | Inherited from ICapture |
onStreamStateChange | function | Inherited from ICapture |
openStream | function | Inherited from ICapture |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
start | function | Inherited from Startable |
stop | function | Inherited from Startable |
Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
Inherited from ICapture
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
function | ICapture inline | |
function | start virtual override | Start capturing and emitting packets. |
function | stop virtual override | Stop capturing and release device resources. |
function | openFile virtual inline | Open a media file as the capture source. |
function | close virtual inline | Release the capture source and any associated resources. |
function | getEncoderFormat virtual | Populate iformat with the encoder-ready format derived from this capture source. |
function | getEncoderAudioCodec virtual inline | Populate params with the encoder-ready audio codec parameters. |
function | getEncoderVideoCodec virtual inline | Populate params with the encoder-ready video codec parameters. |
function | openAudio virtual inline | Open an audio capture device with the given parameters. |
function | openVideo virtual inline | Open a video capture device with the given parameters. |
function | onStreamStateChange virtual inline override | React to PacketStream state transitions by starting or stopping capture. |
function | openStream virtual inline |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Inherited from Startable
| Kind | Name | Description |
|---|---|---|
function | start virtual | Starts the object (e.g. begins processing or listening). |
function | stop virtual | Stops the object (e.g. halts processing or closes resources). |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
Public Attributes
| Return | Name | Description |
|---|---|---|
NullSignal | Closing | Signals 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
| Return | Name | Description |
|---|---|---|
MediaCapture | ||
MediaCapture | Deleted constructor. | |
MediaCapture | Deleted constructor. | |
void | openFile virtual override | Open a media file for decoding. Automatically detects video and audio streams. |
void | close virtual override | Stop the capture thread and close the media stream and all decoders. |
void | start virtual override | Start the background capture and decode thread. Throws std::runtime_error if no media streams have been opened. |
void | stop virtual override | Signal the capture thread to stop and join it before returning. |
void | run virtual override | Entry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called. |
void | getEncoderFormat virtual override | Fill format with the combined encoder-ready video and audio codec parameters. |
void | getEncoderAudioCodec virtual override | Fill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised. |
void | getEncoderVideoCodec virtual override | Fill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised. |
void | setLoopInput | Continuously loop the input file when set. |
void | setLimitFramerate | Limit playback to video FPS. |
void | setRealtimePTS | Set to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable. |
void | setOpenOptions | 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. |
void | setPassthroughVideo | 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. |
AVFormatContext * | formatCtx const | |
VideoDecoder * | video const | |
AudioDecoder * | audio const | |
bool | stopping const | |
std::string | error 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
filePath 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
formatOutput 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
paramsOutput AudioCodec struct to populate.
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
paramsOutput VideoCodec struct to populate.
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
| Return | Name | Description |
|---|---|---|
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
| Return | Name | Description |
|---|---|---|
void | openStream virtual override | Open the underlying media stream. |
void | emit virtual override | Emit 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
-
filenameThe file path or device name to open. -
inputFormatThe forced input format, or nullptr for auto-detect. -
formatParamsOptional 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
packetThe packet to forward; must remain valid for the duration of the call.
Reimplements
Public Types
| Name | Description |
|---|---|
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
| Name | Kind | Owner |
|---|---|---|
VideoCapture | function | Declared here |
VideoCapture | function | Declared here |
VideoCapture | function | Declared here |
openVideo | function | Declared here |
openVideo | function | Declared here |
Ptr | typedef | Declared here |
Closing | variable | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
openFile | function | Inherited from MediaCapture |
close | function | Inherited from MediaCapture |
start | function | Inherited from MediaCapture |
stop | function | Inherited from MediaCapture |
run | function | Inherited from MediaCapture |
getEncoderFormat | function | Inherited from MediaCapture |
getEncoderAudioCodec | function | Inherited from MediaCapture |
getEncoderVideoCodec | function | Inherited from MediaCapture |
setLoopInput | function | Inherited from MediaCapture |
setLimitFramerate | function | Inherited from MediaCapture |
setRealtimePTS | function | Inherited from MediaCapture |
setOpenOptions | function | Inherited from MediaCapture |
setPassthroughVideo | function | Inherited from MediaCapture |
formatCtx | function | Inherited from MediaCapture |
video | function | Inherited from MediaCapture |
audio | function | Inherited from MediaCapture |
stopping | function | Inherited from MediaCapture |
error | function | Inherited from MediaCapture |
_mutex | variable | Inherited from MediaCapture |
_thread | variable | Inherited from MediaCapture |
_formatCtx | variable | Inherited from MediaCapture |
_video | variable | Inherited from MediaCapture |
_audio | variable | Inherited from MediaCapture |
_error | variable | Inherited from MediaCapture |
_stopping | variable | Inherited from MediaCapture |
_looping | variable | Inherited from MediaCapture |
_realtime | variable | Inherited from MediaCapture |
_ratelimit | variable | Inherited from MediaCapture |
_passthroughVideo | variable | Inherited from MediaCapture |
_openOptions | variable | Inherited from MediaCapture |
_videoStream | variable | Inherited from MediaCapture |
openStream | function | Inherited from MediaCapture |
emit | function | Inherited from MediaCapture |
Ptr | typedef | Inherited from MediaCapture |
emitter | variable | Inherited from ICapture |
ICapture | function | Inherited from ICapture |
start | function | Inherited from ICapture |
stop | function | Inherited from ICapture |
openFile | function | Inherited from ICapture |
close | function | Inherited from ICapture |
getEncoderFormat | function | Inherited from ICapture |
getEncoderAudioCodec | function | Inherited from ICapture |
getEncoderVideoCodec | function | Inherited from ICapture |
openAudio | function | Inherited from ICapture |
openVideo | function | Inherited from ICapture |
onStreamStateChange | function | Inherited from ICapture |
openStream | function | Inherited from ICapture |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
start | function | Inherited from Startable |
stop | function | Inherited from Startable |
Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
Inherited from MediaCapture
| Kind | Name | Description |
|---|---|---|
variable | Closing | Signals that the capture thread is closing. This signal is emitted from the capture thread context. |
function | MediaCapture | |
function | MediaCapture | Deleted constructor. |
function | MediaCapture | Deleted constructor. |
function | openFile virtual override | Open a media file for decoding. Automatically detects video and audio streams. |
function | close virtual override | Stop the capture thread and close the media stream and all decoders. |
function | start virtual override | Start the background capture and decode thread. Throws std::runtime_error if no media streams have been opened. |
function | stop virtual override | Signal the capture thread to stop and join it before returning. |
function | run virtual override | Entry point for the background capture thread. Reads and decodes packets from the format context until EOF or stop() is called. |
function | getEncoderFormat virtual override | Fill format with the combined encoder-ready video and audio codec parameters. |
function | getEncoderAudioCodec virtual override | Fill params with the decoder's output audio codec parameters. Throws std::runtime_error if audio parameters have not been initialised. |
function | getEncoderVideoCodec virtual override | Fill params with the decoder's output video codec parameters. Throws std::runtime_error if video parameters have not been initialised. |
function | setLoopInput | Continuously loop the input file when set. |
function | setLimitFramerate | Limit playback to video FPS. |
function | setRealtimePTS | Set to use realtime PTS calculation. This is preferred when using live captures as FFmpeg-provided values are not always reliable. |
function | setOpenOptions | 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. |
function | setPassthroughVideo | 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. |
function | formatCtx const | |
function | video const | |
function | audio const | |
function | stopping const | |
function | error 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 | |
function | openStream virtual override | Open the underlying media stream. |
function | emit virtual override | Emit an existing packet directly onto the outgoing signal. |
typedef | Ptr |
Inherited from ICapture
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
function | ICapture inline | |
function | start virtual override | Start capturing and emitting packets. |
function | stop virtual override | Stop capturing and release device resources. |
function | openFile virtual inline | Open a media file as the capture source. |
function | close virtual inline | Release the capture source and any associated resources. |
function | getEncoderFormat virtual | Populate iformat with the encoder-ready format derived from this capture source. |
function | getEncoderAudioCodec virtual inline | Populate params with the encoder-ready audio codec parameters. |
function | getEncoderVideoCodec virtual inline | Populate params with the encoder-ready video codec parameters. |
function | openAudio virtual inline | Open an audio capture device with the given parameters. |
function | openVideo virtual inline | Open a video capture device with the given parameters. |
function | onStreamStateChange virtual inline override | React to PacketStream state transitions by starting or stopping capture. |
function | openStream virtual inline |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Inherited from Startable
| Kind | Name | Description |
|---|---|---|
function | start virtual | Starts the object (e.g. begins processing or listening). |
function | stop virtual | Stops the object (e.g. halts processing or closes resources). |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
Public Methods
| Return | Name | Description |
|---|---|---|
VideoCapture | Construct without opening a device. Call openVideo() before start(). | |
VideoCapture | Construct and immediately open the given video device using a VideoCodec params struct. | |
VideoCapture | Construct and immediately open the given video device with individual parameters. | |
void | openVideo virtual override | Open the given video device using a VideoCodec params struct. |
void | openVideo virtual | 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. |
{#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
-
deviceThe platform video device identifier (e.g. "/dev/video0" or "0" on Windows). -
paramsThe 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
-
deviceThe platform video device identifier. -
widthThe desired frame width in pixels, or 0 for device default. -
heightThe desired frame height in pixels, or 0 for device default. -
framerateThe desired frame rate, or 0 for device default. -
pixelFmtThe 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
-
deviceThe platform video device identifier. -
paramsThe 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
-
deviceThe platform video device identifier. -
widthThe desired frame width in pixels, or 0 for device default. -
heightThe desired frame height in pixels, or 0 for device default. -
framerateThe desired frame rate, or 0 for device default. -
pixelFmtThe desired pixel format string, or "" for "yuv420p".
Public Types
| Name | Description |
|---|---|
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
| Name | Kind | Owner |
|---|---|---|
DeviceWatcher | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
DeviceWatcher inline explicit | ||
bool | start virtual inline | |
void | stop 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
| Name | Kind | Owner |
|---|---|---|
DevicesChanged | variable | Declared here |
DeviceManager | function | Declared here |
getCameras | function | Declared here |
getMicrophones | function | Declared here |
getSpeakers | function | Declared here |
getDefaultCamera | function | Declared here |
getDefaultMicrophone | function | Declared here |
getDefaultSpeaker | function | Declared here |
findCamera | function | Declared here |
findMicrophone | function | Declared here |
findSpeaker | function | Declared here |
getDeviceList | function | Declared here |
getCapabilities | function | Declared here |
setWatcher | function | Declared here |
watcher | function | Declared here |
print | function | Declared here |
getHardwareCodecs | function | Declared here |
negotiateVideoCapture | function | Declared here |
negotiateAudioCapture | function | Declared here |
findVideoInputFormat | function | Declared here |
findAudioInputFormat | function | Declared here |
instance | function | Declared here |
shutdown | function | Declared here |
_watcher | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
NullSignal | DevicesChanged | Signals 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
| Return | Name | Description |
|---|---|---|
DeviceManager | ||
bool | getCameras const | Populate devices with all connected video input (camera) devices. |
bool | getMicrophones const | Populate devices with all connected audio input (microphone) devices. |
bool | getSpeakers const | Populate devices with all connected audio output (speaker) devices. |
bool | getDefaultCamera const | Return the default (or first available) camera. |
bool | getDefaultMicrophone const | Return the default (or first available) microphone. |
bool | getDefaultSpeaker const | Return the default (or first available) speaker. |
bool | findCamera const | Find a camera by display name or device id. |
bool | findMicrophone const | Find a microphone by display name or device id. |
bool | findSpeaker const | Find a speaker by display name or device id. |
bool | getDeviceList const | Populate devices from the platform-specific backend for the given type. |
int | getCapabilities const | |
void | setWatcher | Replace the active device watcher. Takes ownership. |
DeviceWatcher * | watcher const | |
void | print const | Print all devices to the output stream. |
std::vector< HardwareCodec > | getHardwareCodecs const | Detect available hardware-accelerated codecs via FFmpeg. |
std::optional< std::pair< Device, Device::VideoCapability > > | negotiateVideoCapture const | Resolve the best video capture parameters for a device. |
std::optional< std::pair< Device, Device::AudioCapability > > | negotiateAudioCapture const | Resolve the best audio capture parameters for a device. Returns std::nullopt if no microphone is available. |
const AVInputFormat * | findVideoInputFormat const | Find 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
devicesOutput 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
devicesOutput 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
devicesOutput 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
deviceOutput 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
deviceOutput 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
deviceOutput 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
-
nameThe name or id to search for. -
deviceOutput 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
-
nameThe name or id to search for. -
deviceOutput 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
-
nameThe name or id to search for. -
deviceOutput 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
-
typeThe device type to enumerate. -
devicesOutput 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
watcherThe new DeviceWatcher, or nullptr to disable watching.
{#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}
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
| Return | Name | Description |
|---|---|---|
DeviceManager & | instance static | Returns the default [DeviceManager](#devicemanager) singleton. |
void | shutdown static | Shuts 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
| Return | Name | Description |
|---|---|---|
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
| Name | Kind | Owner |
|---|---|---|
name | variable | Declared here |
type | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | name | |
std::string | type |
{#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
| Name | Kind | Owner |
|---|---|---|
FormatRegistry | function | Declared here |
get | function | Declared here |
getByID | function | Declared here |
getOrDefault | function | Declared here |
getDefault | function | Declared here |
registerFormat | function | Declared here |
unregisterFormat | function | Declared here |
setDefault | function | Declared here |
exists | function | Declared here |
clear | function | Declared here |
formats | function | Declared here |
instance | function | Declared here |
_formats | variable | Declared here |
_default | variable | Declared here |
_mutex | variable | Declared here |
FormatRegistry | function | Declared here |
FormatRegistry | function | Declared here |
findByName | function | Declared here |
defaultLocked | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
FormatRegistry | ||
Format & | get virtual | Return the format with the given display name. Throws std::runtime_error if no format with that name is registered. |
Format & | getByID virtual | Return the format with the given short ID (e.g. "mp4"). Throws std::runtime_error if no format with that ID is registered. |
Format & | getOrDefault virtual | Return the format with the given name, or the default format if not found. |
Format & | getDefault virtual | If a default has been specified it will be returned, other the format with the highest priority will take precedence. |
void | registerFormat virtual | Registers the given media format overriding existing media formats of the same name. |
bool | unregisterFormat virtual | Unregisters the media format matching the given name. |
void | setDefault virtual | Sets the default fallback media format. |
bool | exists virtual | |
void | clear virtual | Remove all registered formats and clear the default. |
FormatList | formats 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
nameThe 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
idThe 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
nameThe 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
nameThe 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
| Return | Name | Description |
|---|---|---|
FormatRegistry & | instance static | Return 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
| Return | Name | Description |
|---|---|---|
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
| Return | Name | Description |
|---|---|---|
FormatRegistry | Deleted constructor. | |
FormatRegistry | Deleted 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
| Name | Kind | Owner |
|---|---|---|
WindowsDeviceWatcher | function | Declared here |
start | function | Declared here |
stop | function | Declared here |
_impl | variable | Declared here |
_manager | variable | Declared here |
DeviceWatcher | function | Inherited from DeviceWatcher |
start | function | Inherited from DeviceWatcher |
stop | function | Inherited from DeviceWatcher |
Inherited from DeviceWatcher
| Kind | Name | Description |
|---|---|---|
function | DeviceWatcher inline explicit | |
function | start virtual inline | |
function | stop virtual inline |
Public Methods
| Return | Name | Description |
|---|---|---|
WindowsDeviceWatcher explicit | ||
bool | start virtual override | Begin monitoring via IMMNotificationClient and RegisterDeviceNotification. |
void | stop virtual override | Stop 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
managerThe 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
| Return | Name | Description |
|---|---|---|
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:
IEncoderSubclassed by:MultiplexPacketEncoder
Multiplexing encoder that writes synchronized audio and video streams.
List of all members
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
MultiplexEncoder | function | Declared here |
MultiplexEncoder | function | Declared here |
MultiplexEncoder | function | Declared here |
init | function | Declared here |
uninit | function | Declared here |
cleanup | function | Declared here |
createVideo | function | Declared here |
freeVideo | function | Declared here |
encodeVideo | function | Declared here |
encodeVideo | function | Declared here |
encodeVideo | function | Declared here |
createAudio | function | Declared here |
freeAudio | function | Declared here |
encodeAudio | function | Declared here |
encodeAudio | function | Declared here |
flush | function | Declared here |
options | function | Declared here |
video | function | Declared here |
audio | function | Declared here |
_options | variable | Declared here |
_formatCtx | variable | Declared here |
_video | variable | Declared here |
_audio | variable | Declared here |
_ioCtx | variable | Declared here |
_ioBuffer | variable | Declared here |
_pts | variable | Declared here |
_mutex | variable | Declared here |
writeOutputPacket | function | Declared here |
updateStreamPts | function | Declared here |
onVideoEncoded | function | Declared here |
onAudioEncoded | function | Declared here |
init | function | Inherited from IEncoder |
uninit | function | Inherited from IEncoder |
cleanup | function | Inherited from IEncoder |
options | function | Inherited from IEncoder |
createVideo | function | Inherited from IEncoder |
freeVideo | function | Inherited from IEncoder |
encodeVideo | function | Inherited from IEncoder |
createAudio | function | Inherited from IEncoder |
freeAudio | function | Inherited from IEncoder |
flush | function | Inherited from IEncoder |
isNone | function | Inherited from IEncoder |
isReady | function | Inherited from IEncoder |
isEncoding | function | Inherited from IEncoder |
isActive | function | Inherited from IEncoder |
isStopped | function | Inherited from IEncoder |
isError | function | Inherited from IEncoder |
Type | enum | Inherited from IEncoder |
StateChange | variable | Inherited from Stateful |
_state | variable | Inherited from Stateful |
Stateful | function | Inherited from Stateful |
~Stateful | function | Inherited from Stateful |
stateEquals | function | Inherited from Stateful |
stateBetween | function | Inherited from Stateful |
state | function | Inherited from Stateful |
state | function | Inherited from Stateful |
beforeStateChange | function | Inherited from Stateful |
onStateChange | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
Inherited from IEncoder
| Kind | Name | Description |
|---|---|---|
function | init virtual | Initialise the encoder, open codec contexts, and transition to Ready or Encoding state. |
function | uninit virtual | Flush remaining packets, close codec contexts, and release all encoder resources. |
function | cleanup virtual inline | Perform any additional cleanup after uninit(). Default is a no-op. |
function | options virtual const nodiscard | |
function | createVideo virtual inline | Initialise the video codec context and stream. |
function | freeVideo virtual inline | Free the video codec context and stream. |
function | encodeVideo virtual inline nodiscard | Encode a single AVFrame of video. |
function | createAudio virtual inline | Initialise the audio codec context and stream. |
function | freeAudio virtual inline | Free the audio codec context and stream. |
function | flush virtual inline | Flush any internally buffered packets to the output. |
function | isNone const inline | |
function | isReady const inline | |
function | isEncoding virtual const inline | |
function | isActive virtual const inline | |
function | isStopped virtual const inline | |
function | isError virtual const inline | |
enum | Type |
Inherited from Stateful
| Kind | Name | Description |
|---|---|---|
variable | StateChange | Signals when the state changes. |
variable | _state | |
function | Stateful inline | |
function | ~Stateful virtual inline | |
function | stateEquals virtual const inline | Returns true if the current state ID equals the given ID. |
function | stateBetween virtual const inline | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | state virtual inline | Returns a mutable reference to the current state. |
function | state virtual const inline | Returns a copy of the current state. |
function | beforeStateChange virtual inline | Override to handle pre state change logic. Return false to prevent state change. |
function | onStateChange virtual inline | Override to handle post state change logic. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
{#emitter-4}
emitter
PacketSignal emitter
Defined in src/av/include/icy/av/multiplexencoder.h:130
Public Methods
| Return | Name | Description |
|---|---|---|
MultiplexEncoder | Construct the encoder with the given options. | |
MultiplexEncoder | Deleted constructor. | |
MultiplexEncoder | Deleted constructor. | |
void | init virtual override | Open the output container, create codec streams, and write the format header. |
void | uninit virtual override | Flush encoded packets, write the format trailer, and close the output container. |
void | cleanup virtual override | Release all resources allocated by init() without writing a trailer. |
void | createVideo virtual override | Create the video encoder and add the stream to the output container. |
void | freeVideo virtual override | Flush and free the video encoder and its stream. |
bool | encodeVideo virtual nodiscard override | Encode a single video frame. All frame values must be set, such as size, pixel format, and PTS. |
bool | encodeVideo virtual nodiscard | 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. |
bool | encodeVideo virtual nodiscard | Encode a single planar video frame. |
void | createAudio virtual override | Create the audio encoder and add the stream to the output container. |
void | freeAudio virtual override | Flush and free the audio encoder and its stream. |
bool | encodeAudio virtual nodiscard | Encode a single interleaved audio frame. |
bool | encodeAudio virtual nodiscard | Encode a single planar audio frame. |
void | flush virtual override | Flush 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
optionsThe 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
-
bufferThe raw video frame buffer. -
bufferSizeThe buffer size in bytes. -
widthThe frame width in pixels. -
heightThe frame height in pixels. -
timeThe 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
-
dataArray of per-plane data pointers (up to 4 planes). -
linesizeArray of per-plane byte strides. -
widthThe frame width in pixels. -
heightThe frame height in pixels. -
timeThe 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
-
bufferThe interleaved audio sample buffer. -
numSamplesThe number of samples per channel. -
timeThe 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
-
dataArray of per-plane sample buffers (one per channel). -
numSamplesThe number of samples per channel. -
timeThe 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
| Return | Name | Description |
|---|---|---|
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
| Return | Name | Description |
|---|---|---|
bool | writeOutputPacket | |
bool | updateStreamPts | Convert input microseconds to the stream time base. |
void | onVideoEncoded | |
void | onAudioEncoded |
{#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
-
streamThe target stream for time base conversion. -
ptsPointer 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
| Name | Kind | Owner |
|---|---|---|
PacketStream | friend | Declared here |
AudioPacketEncoder | function | Declared here |
AudioPacketEncoder | function | Declared here |
process | function | Declared here |
accepts | function | Declared here |
_initialized | variable | Declared here |
_mutex | variable | Declared here |
onStreamStateChange | function | Declared here |
fifo | variable | Inherited from AudioEncoder |
format | variable | Inherited from AudioEncoder |
nextOutputPts | variable | Inherited from AudioEncoder |
AudioEncoder | function | Inherited from AudioEncoder |
create | function | Inherited from AudioEncoder |
close | function | Inherited from AudioEncoder |
encode | function | Inherited from AudioEncoder |
encode | function | Inherited from AudioEncoder |
encode | function | Inherited from AudioEncoder |
flush | function | Inherited from AudioEncoder |
emitter | variable | Inherited from AudioContext |
iparams | variable | Inherited from AudioContext |
oparams | variable | Inherited from AudioContext |
stream | variable | Inherited from AudioContext |
ctx | variable | Inherited from AudioContext |
codec | variable | Inherited from AudioContext |
frame | variable | Inherited from AudioContext |
resampler | variable | Inherited from AudioContext |
outputFrameSize | variable | Inherited from AudioContext |
time | variable | Inherited from AudioContext |
pts | variable | Inherited from AudioContext |
seconds | variable | Inherited from AudioContext |
error | variable | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
create | function | Inherited from AudioContext |
open | function | Inherited from AudioContext |
close | function | Inherited from AudioContext |
decode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
flush | function | Inherited from AudioContext |
recreateResampler | function | Inherited from AudioContext |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from AudioEncoder
| Kind | Name | Description |
|---|---|---|
variable | fifo | |
variable | format | |
variable | nextOutputPts | 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. |
function | AudioEncoder | Construct an encoder, optionally tied to an existing muxer context. |
function | create virtual override | Initialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction. |
function | close virtual override | Close and free the AVCodecContext, FIFO buffer, and associated resources. |
function | encode virtual nodiscard override | Encode interleaved audio samples. |
function | encode virtual nodiscard override | Encode planar audio samples. |
function | encode virtual nodiscard override | Encode a single AVFrame (typically from a decoder or resampler). |
function | flush virtual override | Flush remaining packets to be encoded. This method should be called once before stream closure. |
Inherited from AudioContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | last encoded or decoded frame |
variable | resampler | audio resampler |
variable | outputFrameSize | encoder or decoder output frame size |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | audio time in seconds |
variable | error | error message |
function | AudioContext | |
function | AudioContext | Deleted constructor. |
function | AudioContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder. |
function | open virtual | Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed audio packet and emit the resulting samples. |
function | encode virtual nodiscard | Encode a buffer of interleaved audio samples. |
function | encode virtual nodiscard | Encode a buffer of planar audio samples. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | recreateResampler virtual | Recreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required. |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process(). |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Friends
| Name | Description |
|---|---|
PacketStream |
{#packetstream-1}
PacketStream
friend class PacketStream
Defined in src/av/include/icy/av/audiopacketencoder.h:64
Public Methods
| Return | Name | Description |
|---|---|---|
AudioPacketEncoder | ||
AudioPacketEncoder | Deleted constructor. | |
void | process virtual override | Process an AudioPacket or PlanarAudioPacket from the stream. Encodes the samples and emits the resulting compressed packet. |
bool | accepts virtual override | Accept 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
| Return | Name | Description |
|---|---|---|
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
| Return | Name | Description |
|---|---|---|
void | onStreamStateChange virtual override | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
{#onstreamstatechange-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
| Name | Kind | Owner |
|---|---|---|
PacketStream | friend | Declared here |
VideoPacketEncoder | function | Declared here |
VideoPacketEncoder | function | Declared here |
process | function | Declared here |
accepts | function | Declared here |
_initialized | variable | Declared here |
_mutex | variable | Declared here |
onStreamStateChange | function | Declared here |
format | variable | Inherited from VideoEncoder |
VideoEncoder | function | Inherited from VideoEncoder |
create | function | Inherited from VideoEncoder |
close | function | Inherited from VideoEncoder |
encode | function | Inherited from VideoEncoder |
encode | function | Inherited from VideoEncoder |
encode | function | Inherited from VideoEncoder |
flush | function | Inherited from VideoEncoder |
emitter | variable | Inherited from VideoContext |
iparams | variable | Inherited from VideoContext |
oparams | variable | Inherited from VideoContext |
stream | variable | Inherited from VideoContext |
ctx | variable | Inherited from VideoContext |
codec | variable | Inherited from VideoContext |
frame | variable | Inherited from VideoContext |
conv | variable | Inherited from VideoContext |
time | variable | Inherited from VideoContext |
pts | variable | Inherited from VideoContext |
seconds | variable | Inherited from VideoContext |
error | variable | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
create | function | Inherited from VideoContext |
open | function | Inherited from VideoContext |
close | function | Inherited from VideoContext |
decode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
flush | function | Inherited from VideoContext |
convert | function | Inherited from VideoContext |
recreateConverter | function | Inherited from VideoContext |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from VideoEncoder
| Kind | Name | Description |
|---|---|---|
variable | format | |
function | VideoEncoder | Construct an encoder, optionally tied to an existing muxer context. |
function | create virtual override | Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction. |
function | close virtual override | Close and free the AVCodecContext and associated resources. |
function | encode virtual nodiscard override | Encode a single video frame. This method is for interleaved video formats. |
function | encode virtual nodiscard override | Encode a single video frame. This method is for planar video formats. |
function | encode virtual nodiscard override | Encode a single AVFrame (typically from a decoder or converter). |
function | flush virtual override | Flush remaining packets to be encoded. This method should be called once before stream closure. |
Inherited from VideoContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | encoder or decoder frame |
variable | conv | video conversion context |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | video time in seconds |
variable | error | error message |
function | VideoContext | |
function | VideoContext | Deleted constructor. |
function | VideoContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
function | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed video packet and emit the resulting frame. |
function | encode virtual nodiscard | Encode a buffer of interleaved video data. |
function | encode virtual nodiscard | Encode a planar video frame. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | convert virtual | Convert the video frame and return the result. |
function | recreateConverter virtual | Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert(). |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process(). |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Friends
| Name | Description |
|---|---|
PacketStream |
{#packetstream-2}
PacketStream
friend class PacketStream
Defined in src/av/include/icy/av/videopacketencoder.h:65
Public Methods
| Return | Name | Description |
|---|---|---|
VideoPacketEncoder | ||
VideoPacketEncoder | Deleted constructor. | |
void | process virtual override | Process a VideoPacket or PlanarVideoPacket from the stream. Encodes the frame and emits the resulting compressed packet. |
bool | accepts virtual override | Accept 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
| Return | Name | Description |
|---|---|---|
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
| Return | Name | Description |
|---|---|---|
void | onStreamStateChange virtual override | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
{#onstreamstatechange-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
| Name | Kind | Owner |
|---|---|---|
RealtimePacketQueue | function | Declared here |
push | function | Declared here |
realTime | function | Declared here |
_startTime | variable | Declared here |
popNext | function | Declared here |
onStreamStateChange | function | Declared here |
BaseQueue | typedef | Declared here |
Queue | typedef | Inherited from AsyncPacketQueue |
Processor | typedef | Inherited from AsyncPacketQueue |
emitter | variable | Inherited from AsyncPacketQueue |
AsyncPacketQueue | function | Inherited from AsyncPacketQueue |
~AsyncPacketQueue | function | Inherited from AsyncPacketQueue |
close | function | Inherited from AsyncPacketQueue |
process | function | Inherited from AsyncPacketQueue |
accepts | function | Inherited from AsyncPacketQueue |
retention | function | Inherited from AsyncPacketQueue |
dispatch | function | Inherited from AsyncPacketQueue |
onStreamStateChange | function | Inherited from AsyncPacketQueue |
Queue | typedef | Inherited from AsyncQueue |
_thread | variable | Inherited from AsyncQueue |
AsyncQueue | function | Inherited from AsyncQueue |
cancel | function | Inherited from AsyncQueue |
~AsyncQueue | function | Inherited from AsyncQueue |
ondispatch | variable | Inherited from RunnableQueue |
_limit | variable | Inherited from RunnableQueue |
_timeout | variable | Inherited from RunnableQueue |
_dropped | variable | Inherited from RunnableQueue |
RunnableQueue | function | Inherited from RunnableQueue |
~RunnableQueue | function | Inherited from RunnableQueue |
push | function | Inherited from RunnableQueue |
flush | function | Inherited from RunnableQueue |
clear | function | Inherited from RunnableQueue |
run | function | Inherited from RunnableQueue |
runTimeout | function | Inherited from RunnableQueue |
dispatch | function | Inherited from RunnableQueue |
timeout | function | Inherited from RunnableQueue |
setTimeout | function | Inherited from RunnableQueue |
dropped | function | Inherited from RunnableQueue |
RunnableQueue | function | Inherited from RunnableQueue |
operator= | function | Inherited from RunnableQueue |
RunnableQueue | function | Inherited from RunnableQueue |
operator= | function | Inherited from RunnableQueue |
popNext | function | Inherited from RunnableQueue |
dispatchNext | function | Inherited from RunnableQueue |
_queue | variable | Inherited from Queue |
_mutex | variable | Inherited from Queue |
push | function | Inherited from Queue |
push | function | Inherited from Queue |
empty | function | Inherited from Queue |
front | function | Inherited from Queue |
back | function | Inherited from Queue |
pop | function | Inherited from Queue |
sort | function | Inherited from Queue |
size | function | Inherited from Queue |
queue | function | Inherited from Queue |
Runnable | function | Inherited from Runnable |
run | function | Inherited from Runnable |
cancel | function | Inherited from Runnable |
cancelled | function | Inherited from Runnable |
exit | variable | Inherited from Runnable |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from AsyncPacketQueue
| Kind | Name | Description |
|---|---|---|
typedef | Queue | |
typedef | Processor | |
variable | emitter | |
function | AsyncPacketQueue inline | |
function | ~AsyncPacketQueue virtual inline | |
function | close virtual inline | Flushes remaining packets, cancels the queue, and joins the dispatch thread. |
function | process virtual inline override | Clones 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. |
function | accepts virtual inline override | Returns true if the packet can be cast to type T. |
function | retention virtual const inline nodiscard override | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | dispatch inline override | Emits the packet to downstream processors from the async thread. |
function | onStreamStateChange virtual inline override | Closes the queue on [Error](base.md#error) or Closed stream state transitions. |
Inherited from AsyncQueue
| Kind | Name | Description |
|---|---|---|
typedef | Queue | |
variable | _thread | |
function | AsyncQueue inline | |
function | cancel virtual inline override | Cancels the queue and joins the dispatch thread. |
function | ~AsyncQueue virtual inline |
Inherited from RunnableQueue
| Kind | Name | Description |
|---|---|---|
variable | ondispatch | The default dispatch function. Must be set before the queue is running. |
variable | _limit | |
variable | _timeout | |
variable | _dropped | |
function | RunnableQueue inline | |
function | ~RunnableQueue virtual inline | |
function | push virtual inline | Push an item onto the queue. The queue takes ownership of the item pointer. |
function | flush virtual inline | Flush all outgoing items. |
function | clear inline | |
function | run virtual inline override | Called asynchronously to dispatch queued items. If not timeout is set this method blocks until cancel() is called, otherwise runTimeout() will be called. |
function | runTimeout virtual inline | Called asynchronously to dispatch queued items until the queue is empty or the timeout expires. Pseudo protected for std::bind compatability. |
function | dispatch virtual inline | Dispatch a single item to listeners. |
function | timeout inline | |
function | setTimeout inline | Sets the dispatch timeout. Must only be called when the queue is empty. |
function | dropped const inline | |
function | RunnableQueue | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | RunnableQueue | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | popNext virtual inline | Pops the next waiting item. |
function | dispatchNext virtual inline | Pops and dispatches the next waiting item. |
Inherited from Queue
| Kind | Name | Description |
|---|---|---|
variable | _queue | |
variable | _mutex | |
function | push inline | Appends an item to the back of the queue (thread-safe). |
function | push inline | Appends an item to the back of the queue by move (thread-safe). |
function | empty const inline | |
function | front const inline | |
function | back const inline | |
function | pop inline | Removes the front item from the queue (thread-safe). |
function | sort inline | Sorts all queued items using the given comparator (thread-safe). |
function | size const inline | |
function | queue const inline |
Inherited from Runnable
| Kind | Name | Description |
|---|---|---|
function | Runnable inline | |
function | run virtual | The run method will be called by the asynchronous context. |
function | cancel virtual inline | Cancel the current task. The run() method should return ASAP. |
function | cancelled virtual const inline | Returns true when the task has been cancelled. |
variable | exit |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process(). |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Public Methods
| Return | Name | Description |
|---|---|---|
RealtimePacketQueue inline | Construct the queue with a maximum capacity. | |
void | push virtual inline override | Insert a packet into the queue and re-sort by presentation timestamp. |
int64_t | realTime inline | Return 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
maxSizeThe 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
itemThe 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
| Return | Name | Description |
|---|---|---|
int64_t | _startTime |
{#_starttime}
_startTime
int64_t _startTime
Defined in src/av/include/icy/av/realtimepacketqueue.h:98
Protected Methods
| Return | Name | Description |
|---|---|---|
PacketT * | popNext virtual inline override | Return the next packet whose timestamp is <= realTime(), or nullptr if none is ready. |
void | onStreamStateChange virtual inline override | Record 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
| Name | Description |
|---|---|
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
| Name | Kind | Owner |
|---|---|---|
operator() | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
bool | operator() 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
| Name | Kind | Owner |
|---|---|---|
PacketStream | friend | Declared here |
MultiplexPacketEncoder | function | Declared here |
MultiplexPacketEncoder | function | Declared here |
MultiplexPacketEncoder | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
accepts | function | Declared here |
process | function | Declared here |
_mutex | variable | Declared here |
onStreamStateChange | function | Declared here |
emitter | variable | Inherited from MultiplexEncoder |
MultiplexEncoder | function | Inherited from MultiplexEncoder |
MultiplexEncoder | function | Inherited from MultiplexEncoder |
MultiplexEncoder | function | Inherited from MultiplexEncoder |
init | function | Inherited from MultiplexEncoder |
uninit | function | Inherited from MultiplexEncoder |
cleanup | function | Inherited from MultiplexEncoder |
createVideo | function | Inherited from MultiplexEncoder |
freeVideo | function | Inherited from MultiplexEncoder |
encodeVideo | function | Inherited from MultiplexEncoder |
encodeVideo | function | Inherited from MultiplexEncoder |
encodeVideo | function | Inherited from MultiplexEncoder |
createAudio | function | Inherited from MultiplexEncoder |
freeAudio | function | Inherited from MultiplexEncoder |
encodeAudio | function | Inherited from MultiplexEncoder |
encodeAudio | function | Inherited from MultiplexEncoder |
flush | function | Inherited from MultiplexEncoder |
options | function | Inherited from MultiplexEncoder |
video | function | Inherited from MultiplexEncoder |
audio | function | Inherited from MultiplexEncoder |
_options | variable | Inherited from MultiplexEncoder |
_formatCtx | variable | Inherited from MultiplexEncoder |
_video | variable | Inherited from MultiplexEncoder |
_audio | variable | Inherited from MultiplexEncoder |
_ioCtx | variable | Inherited from MultiplexEncoder |
_ioBuffer | variable | Inherited from MultiplexEncoder |
_pts | variable | Inherited from MultiplexEncoder |
_mutex | variable | Inherited from MultiplexEncoder |
writeOutputPacket | function | Inherited from MultiplexEncoder |
updateStreamPts | function | Inherited from MultiplexEncoder |
onVideoEncoded | function | Inherited from MultiplexEncoder |
onAudioEncoded | function | Inherited from MultiplexEncoder |
init | function | Inherited from IEncoder |
uninit | function | Inherited from IEncoder |
cleanup | function | Inherited from IEncoder |
options | function | Inherited from IEncoder |
createVideo | function | Inherited from IEncoder |
freeVideo | function | Inherited from IEncoder |
encodeVideo | function | Inherited from IEncoder |
createAudio | function | Inherited from IEncoder |
freeAudio | function | Inherited from IEncoder |
flush | function | Inherited from IEncoder |
isNone | function | Inherited from IEncoder |
isReady | function | Inherited from IEncoder |
isEncoding | function | Inherited from IEncoder |
isActive | function | Inherited from IEncoder |
isStopped | function | Inherited from IEncoder |
isError | function | Inherited from IEncoder |
Type | enum | Inherited from IEncoder |
StateChange | variable | Inherited from Stateful |
_state | variable | Inherited from Stateful |
Stateful | function | Inherited from Stateful |
~Stateful | function | Inherited from Stateful |
stateEquals | function | Inherited from Stateful |
stateBetween | function | Inherited from Stateful |
state | function | Inherited from Stateful |
state | function | Inherited from Stateful |
beforeStateChange | function | Inherited from Stateful |
onStateChange | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
setState | function | Inherited from Stateful |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from MultiplexEncoder
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
function | MultiplexEncoder | Construct the encoder with the given options. |
function | MultiplexEncoder | Deleted constructor. |
function | MultiplexEncoder | Deleted constructor. |
function | init virtual override | Open the output container, create codec streams, and write the format header. |
function | uninit virtual override | Flush encoded packets, write the format trailer, and close the output container. |
function | cleanup virtual override | Release all resources allocated by init() without writing a trailer. |
function | createVideo virtual override | Create the video encoder and add the stream to the output container. |
function | freeVideo virtual override | Flush and free the video encoder and its stream. |
function | encodeVideo virtual nodiscard override | Encode a single video frame. All frame values must be set, such as size, pixel format, and PTS. |
function | encodeVideo virtual nodiscard | 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. |
function | encodeVideo virtual nodiscard | Encode a single planar video frame. |
function | createAudio virtual override | Create the audio encoder and add the stream to the output container. |
function | freeAudio virtual override | Flush and free the audio encoder and its stream. |
function | encodeAudio virtual nodiscard | Encode a single interleaved audio frame. |
function | encodeAudio virtual nodiscard | Encode a single planar audio frame. |
function | flush virtual override | Flush any buffered or queued packets to the output container. |
function | options virtual const nodiscard override | |
function | video | |
function | audio | |
variable | _options | |
variable | _formatCtx | |
variable | _video | |
variable | _audio | |
variable | _ioCtx | |
variable | _ioBuffer | |
variable | _pts | |
variable | _mutex | |
function | writeOutputPacket | |
function | updateStreamPts | Convert input microseconds to the stream time base. |
function | onVideoEncoded | |
function | onAudioEncoded |
Inherited from IEncoder
| Kind | Name | Description |
|---|---|---|
function | init virtual | Initialise the encoder, open codec contexts, and transition to Ready or Encoding state. |
function | uninit virtual | Flush remaining packets, close codec contexts, and release all encoder resources. |
function | cleanup virtual inline | Perform any additional cleanup after uninit(). Default is a no-op. |
function | options virtual const nodiscard | |
function | createVideo virtual inline | Initialise the video codec context and stream. |
function | freeVideo virtual inline | Free the video codec context and stream. |
function | encodeVideo virtual inline nodiscard | Encode a single AVFrame of video. |
function | createAudio virtual inline | Initialise the audio codec context and stream. |
function | freeAudio virtual inline | Free the audio codec context and stream. |
function | flush virtual inline | Flush any internally buffered packets to the output. |
function | isNone const inline | |
function | isReady const inline | |
function | isEncoding virtual const inline | |
function | isActive virtual const inline | |
function | isStopped virtual const inline | |
function | isError virtual const inline | |
enum | Type |
Inherited from Stateful
| Kind | Name | Description |
|---|---|---|
variable | StateChange | Signals when the state changes. |
variable | _state | |
function | Stateful inline | |
function | ~Stateful virtual inline | |
function | stateEquals virtual const inline | Returns true if the current state ID equals the given ID. |
function | stateBetween virtual const inline | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | state virtual inline | Returns a mutable reference to the current state. |
function | state virtual const inline | Returns a copy of the current state. |
function | beforeStateChange virtual inline | Override to handle pre state change logic. Return false to prevent state change. |
function | onStateChange virtual inline | Override to handle post state change logic. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
function | setState virtual inline | Sets the state and sends the state signal if the state change was successful. |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process(). |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
variable | _emitter | |
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const nodiscard | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Friends
| Name | Description |
|---|---|
PacketStream |
{#packetstream-3}
PacketStream
friend class PacketStream
Defined in src/av/include/icy/av/multiplexpacketencoder.h:61
Public Methods
| Return | Name | Description |
|---|---|---|
MultiplexPacketEncoder | Construct the encoder with the given options. | |
MultiplexPacketEncoder | Deleted constructor. | |
MultiplexPacketEncoder | Deleted constructor. | |
void | encode virtual | Encode a VideoPacket, dispatching to the planar or interleaved encode path as appropriate. |
void | encode virtual | Encode an AudioPacket, dispatching to the planar or interleaved encode path as appropriate. |
bool | accepts virtual override | |
void | process virtual override | Dispatch 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
optionsThe 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
packetThe 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
packetThe 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
packetThe incoming media packet.
Reimplements
Protected Attributes
| Return | Name | Description |
|---|---|---|
std::mutex | _mutex |
{#_mutex-5}
_mutex
std::mutex _mutex
Defined in src/av/include/icy/av/multiplexpacketencoder.h:63
Protected Methods
| Return | Name | Description |
|---|---|---|
void | onStreamStateChange virtual override | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
{#onstreamstatechange-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
| Name | Kind | Owner |
|---|---|---|
name | variable | Declared here |
encoder | variable | Declared here |
sampleRate | variable | Declared here |
bitRate | variable | Declared here |
quality | variable | Declared here |
compliance | variable | Declared here |
enabled | variable | Declared here |
options | variable | Declared here |
Codec | function | Declared here |
Codec | function | Declared here |
Codec | function | Declared here |
~Codec | function | Declared here |
toString | function | Declared here |
specified | function | Declared here |
print | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | name | The display name for this codec. |
std::string | encoder | The encoder name for FFmpeg. |
int | sampleRate | The sampling rate or RTP clock rate. |
int | bitRate | The bit rate to encode at. |
int | quality | Optional quality value, variable range depending on codec. |
int | compliance | FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL). |
bool | enabled | Weather or not the codec is available for use. |
std::map< std::string, std::string > | options | 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. |
{#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
| Return | Name | Description |
|---|---|---|
Codec | Construct a disabled codec with zeroed parameters. | |
Codec | Construct a codec with a display name, sample rate, bit rate, and enabled flag. | |
Codec | Construct a codec with an explicit FFmpeg encoder name. | |
~Codec virtual noexcept | Codec(const Codec& r);. | |
std::string | toString virtual const | Return a compact string representation of this codec. |
bool | specified const nodiscard | Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use. |
void | print virtual | Print 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
-
nameThe codec display name. -
sampleRateThe sampling rate or RTP clock rate in Hz. -
bitRateThe target bit rate in bits per second. -
enabledWhether 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
-
nameThe codec display name. -
encoderThe FFmpeg encoder name (e.g. "libx264"). -
sampleRateThe sampling rate or RTP clock rate in Hz. -
bitRateThe target bit rate in bits per second. -
enabledWhether 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
ostThe 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
| Name | Kind | Owner |
|---|---|---|
channels | variable | Declared here |
sampleFmt | variable | Declared here |
AudioCodec | function | Declared here |
AudioCodec | function | Declared here |
AudioCodec | function | Declared here |
AudioCodec | function | Declared here |
toString | function | Declared here |
print | function | Declared here |
name | variable | Inherited from Codec |
encoder | variable | Inherited from Codec |
sampleRate | variable | Inherited from Codec |
bitRate | variable | Inherited from Codec |
quality | variable | Inherited from Codec |
compliance | variable | Inherited from Codec |
enabled | variable | Inherited from Codec |
options | variable | Inherited from Codec |
Codec | function | Inherited from Codec |
Codec | function | Inherited from Codec |
Codec | function | Inherited from Codec |
~Codec | function | Inherited from Codec |
toString | function | Inherited from Codec |
specified | function | Inherited from Codec |
print | function | Inherited from Codec |
Inherited from Codec
| Kind | Name | Description |
|---|---|---|
variable | name | The display name for this codec. |
variable | encoder | The encoder name for FFmpeg. |
variable | sampleRate | The sampling rate or RTP clock rate. |
variable | bitRate | The bit rate to encode at. |
variable | quality | Optional quality value, variable range depending on codec. |
variable | compliance | FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL). |
variable | enabled | Weather or not the codec is available for use. |
variable | options | 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. |
function | Codec | Construct a disabled codec with zeroed parameters. |
function | Codec | Construct a codec with a display name, sample rate, bit rate, and enabled flag. |
function | Codec | Construct a codec with an explicit FFmpeg encoder name. |
function | ~Codec virtual noexcept | Codec(const Codec& r);. |
function | toString virtual const | Return a compact string representation of this codec. |
function | specified const nodiscard | Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use. |
function | print virtual | Print a multi-line human-readable description to the given stream. |
Public Attributes
| Return | Name | Description |
|---|---|---|
int | channels | |
std::string | sampleFmt | One 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
| Return | Name | Description |
|---|---|---|
AudioCodec | Construct a disabled audio codec with zeroed parameters. | |
AudioCodec | Construct an anonymous audio codec from raw parameters. | |
AudioCodec | Construct a named audio codec. | |
AudioCodec | Construct a named audio codec with an explicit FFmpeg encoder name. | |
std::string | toString virtual const override | |
void | print virtual override | Print 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
-
channelsThe number of audio channels. -
sampleRateThe sample rate in Hz. -
sampleFmtThe sample format string (e.g. "s16", "fltp"). -
bitRateThe 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
-
nameThe codec display name. -
channelsThe number of audio channels. -
sampleRateThe sample rate in Hz. -
bitRateThe target bit rate in bits per second. -
sampleFmtThe 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
-
nameThe codec display name. -
encoderThe FFmpeg encoder name (e.g. "libopus"). -
channelsThe number of audio channels. -
sampleRateThe sample rate in Hz. -
bitRateThe target bit rate in bits per second. -
sampleFmtThe 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
ostThe 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
| Name | Kind | Owner |
|---|---|---|
width | variable | Declared here |
height | variable | Declared here |
fps | variable | Declared here |
pixelFmt | variable | Declared here |
VideoCodec | function | Declared here |
VideoCodec | function | Declared here |
VideoCodec | function | Declared here |
VideoCodec | function | Declared here |
VideoCodec | function | Declared here |
toString | function | Declared here |
print | function | Declared here |
name | variable | Inherited from Codec |
encoder | variable | Inherited from Codec |
sampleRate | variable | Inherited from Codec |
bitRate | variable | Inherited from Codec |
quality | variable | Inherited from Codec |
compliance | variable | Inherited from Codec |
enabled | variable | Inherited from Codec |
options | variable | Inherited from Codec |
Codec | function | Inherited from Codec |
Codec | function | Inherited from Codec |
Codec | function | Inherited from Codec |
~Codec | function | Inherited from Codec |
toString | function | Inherited from Codec |
specified | function | Inherited from Codec |
print | function | Inherited from Codec |
Inherited from Codec
| Kind | Name | Description |
|---|---|---|
variable | name | The display name for this codec. |
variable | encoder | The encoder name for FFmpeg. |
variable | sampleRate | The sampling rate or RTP clock rate. |
variable | bitRate | The bit rate to encode at. |
variable | quality | Optional quality value, variable range depending on codec. |
variable | compliance | FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL). |
variable | enabled | Weather or not the codec is available for use. |
variable | options | 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. |
function | Codec | Construct a disabled codec with zeroed parameters. |
function | Codec | Construct a codec with a display name, sample rate, bit rate, and enabled flag. |
function | Codec | Construct a codec with an explicit FFmpeg encoder name. |
function | ~Codec virtual noexcept | Codec(const Codec& r);. |
function | toString virtual const | Return a compact string representation of this codec. |
function | specified const nodiscard | Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use. |
function | print virtual | Print a multi-line human-readable description to the given stream. |
Public Attributes
| Return | Name | Description |
|---|---|---|
int | width | |
int | height | |
double | fps | |
std::string | pixelFmt |
{#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
| Return | Name | Description |
|---|---|---|
VideoCodec | Construct a disabled video codec with zeroed parameters. | |
VideoCodec | Construct an anonymous video codec from raw parameters. | |
VideoCodec | Construct a named video codec. | |
VideoCodec | Construct a named video codec with an explicit FFmpeg encoder name. | |
VideoCodec | ||
std::string | toString virtual const override | |
void | print virtual override | Print 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
-
widthThe frame width in pixels. -
heightThe frame height in pixels. -
fpsThe target frame rate in frames per second. -
pixelFmtThe pixel format string (e.g. "yuv420p"). -
bitRateThe target bit rate in bits per second. -
sampleRateThe 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
-
nameThe codec display name. -
widthThe frame width in pixels. -
heightThe frame height in pixels. -
fpsThe target frame rate in frames per second. -
bitRateThe target bit rate in bits per second. -
sampleRateThe RTP clock rate in Hz. -
pixelFmtThe 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
-
nameThe codec display name. -
encoderThe FFmpeg encoder name (e.g. "libx264"). -
widthThe frame width in pixels. -
heightThe frame height in pixels. -
fpsThe target frame rate in frames per second. -
bitRateThe target bit rate in bits per second. -
sampleRateThe RTP clock rate in Hz. -
pixelFmtThe 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
ostThe 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
| Name | Kind | Owner |
|---|---|---|
operator() | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
void | operator() 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
| Name | Kind | Owner |
|---|---|---|
operator() | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
void | operator() 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
| Name | Kind | Owner |
|---|---|---|
name | variable | Declared here |
id | variable | Declared here |
video | variable | Declared here |
audio | variable | Declared here |
priority | variable | Declared here |
Format | function | Declared here |
Format | function | Declared here |
Format | function | Declared here |
Format | function | Declared here |
Format | function | Declared here |
type | function | Declared here |
toString | function | Declared here |
print | function | Declared here |
preferable | function | Declared here |
Type | enum | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | name | Base Format Variables. |
std::string | id | The short name of this format. |
VideoCodec | video | The video codec. |
AudioCodec | audio | The audio codec. |
int | priority | The 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
| Return | Name | Description |
|---|---|---|
Format | Ctors/Dtors. | |
Format | Construct a multiplex (audio + video) format. | |
Format | Construct a video-only format. | |
Format | Construct an audio-only format. | |
Format | ||
Type | type const | Return the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled. |
std::string | toString virtual const | |
void | print virtual | Print 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
-
nameThe display name of the format. -
idThe short FFmpeg muxer ID (e.g. "mp4"). -
videoThe video codec parameters. -
audioThe audio codec parameters. -
prioritySort 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
-
nameThe display name of the format. -
idThe short FFmpeg muxer ID. -
videoThe video codec parameters. -
prioritySort 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
-
nameThe display name of the format. -
idThe short FFmpeg muxer ID. -
audioThe audio codec parameters. -
prioritySort 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
ostThe output stream to write to.
Public Static Methods
| Return | Name | Description |
|---|---|---|
bool | preferable static inline | Comparator 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
-
firstThe format to compare. -
secondThe format to compare against.
Returns
True if first.priority > second.priority.
Public Types
| Name | Description |
|---|---|
Type |
{#type-1}
Type
enum Type
Defined in src/av/include/icy/av/format.h:32
| Value | Description |
|---|---|
None | |
Video | video only |
Audio | audio only |
Multiplex | both 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
| Name | Kind | Owner |
|---|---|---|
str | function | Declared here |
Type | enum | Declared here |
ID | typedef | Inherited from State |
_id | variable | Inherited from State |
State | function | Inherited from State |
State | function | Inherited from State |
operator= | function | Inherited from State |
~State | function | Inherited from State |
id | function | Inherited from State |
set | function | Inherited from State |
str | function | Inherited from State |
toString | function | Inherited from State |
equals | function | Inherited from State |
between | function | Inherited from State |
operator== | function | Inherited from State |
operator== | function | Inherited from State |
operator<< | friend | Inherited from State |
Inherited from State
| Kind | Name | Description |
|---|---|---|
typedef | ID | |
variable | _id | |
function | State | |
function | State | Copy constructor. |
function | operator= | Copy assignment. |
function | ~State virtual | Defaulted destructor. |
function | id const | Returns the current state ID. |
function | set | Sets the state ID. |
function | str virtual const | Returns a human-readable string for the given state ID. Override in derived classes to provide meaningful names. |
function | toString virtual const | Returns a human-readable string for the current state ID. |
function | equals const | Returns true if the current state ID equals the given ID. |
function | between const | Returns true if the current state ID is in the inclusive range [lid, rid]. |
function | operator== const inline | |
function | operator== const inline | |
friend | operator<< inline |
Public Methods
| Return | Name | Description |
|---|---|---|
std::string | str 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
| Name | Description |
|---|---|
Type |
{#type-2}
Type
enum Type
Defined in src/av/include/icy/av/iencoder.h:28
| Value | Description |
|---|---|
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
| Name | Kind | Owner |
|---|---|---|
iformat | variable | Declared here |
oformat | variable | Declared here |
ifile | variable | Declared here |
ofile | variable | Declared here |
duration | variable | Declared here |
EncoderOptions | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
Format | iformat | input media format. |
Format | oformat | output media format. |
std::string | ifile | input file path. |
std::string | ofile | output file path. |
long | duration | duration 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
| Return | Name | Description |
|---|---|---|
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
| Name | Kind | Owner |
|---|---|---|
fifo | variable | Declared here |
AudioBuffer | function | Declared here |
AudioBuffer | function | Declared here |
AudioBuffer | function | Declared here |
alloc | function | Declared here |
reset | function | Declared here |
close | function | Declared here |
write | function | Declared here |
read | function | Declared here |
available | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
AVAudioFifo * | fifo | Underlying 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
| Return | Name | Description |
|---|---|---|
AudioBuffer | ||
AudioBuffer | Deleted constructor. | |
AudioBuffer | Deleted constructor. | |
void | alloc | Allocate the audio FIFO buffer. |
void | reset | Discard all samples currently held in the FIFO without freeing the buffer. |
void | close | Free the underlying AVAudioFifo buffer. |
void | write | Write samples into the FIFO buffer. |
bool | read | Read samples from the FIFO buffer. |
int | available const | Return 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
-
sampleFmtThe sample format name (e.g. "s16", "fltp"). -
channelsThe number of audio channels. -
numSamplesThe 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
-
samplesArray of per-channel sample buffers. -
numSamplesThe 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
-
samplesArray of per-channel sample buffers to fill. -
numSamplesThe 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
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
stream | variable | Declared here |
ctx | variable | Declared here |
codec | variable | Declared here |
frame | variable | Declared here |
resampler | variable | Declared here |
outputFrameSize | variable | Declared here |
time | variable | Declared here |
pts | variable | Declared here |
seconds | variable | Declared here |
error | variable | Declared here |
AudioContext | function | Declared here |
AudioContext | function | Declared here |
AudioContext | function | Declared here |
create | function | Declared here |
open | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
recreateResampler | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter | |
AudioCodec | iparams | input parameters |
AudioCodec | oparams | output parameters |
AVStream * | stream | encoder or decoder stream |
AVCodecContext * | ctx | encoder or decoder context |
const AVCodec * | codec | encoder or decoder codec |
AVFrame * | frame | last encoded or decoded frame |
std::unique_ptr< AudioResampler > | resampler | audio resampler |
int | outputFrameSize | encoder or decoder output frame size |
int64_t | time | stream time in codec time base |
int64_t | pts | last packet pts value |
double | seconds | audio time in seconds |
std::string | error | error 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
| Return | Name | Description |
|---|---|---|
AudioContext | ||
AudioContext | Deleted constructor. | |
AudioContext | Deleted constructor. | |
void | create virtual | Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder. |
void | open virtual | Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created. |
void | close virtual | Close the codec context, free the frame, and reset timestamps. |
bool | decode virtual nodiscard | Decode a compressed audio packet and emit the resulting samples. |
bool | encode virtual nodiscard | Encode a buffer of interleaved audio samples. |
bool | encode virtual nodiscard | Encode a buffer of planar audio samples. |
bool | encode virtual nodiscard | Encode a single AVFrame. |
void | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
bool | recreateResampler virtual | Recreate 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
ipacketThe 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
-
samplesPointer to the interleaved sample buffer. -
numSamplesNumber of samples per channel. -
ptsPresentation 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
-
samplesArray of per-channel sample buffers (up to 4 planes). -
numSamplesNumber of samples per channel. -
ptsPresentation 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
iframeThe 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
| Name | Kind | Owner |
|---|---|---|
AudioDecoder | function | Declared here |
create | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from AudioContext |
iparams | variable | Inherited from AudioContext |
oparams | variable | Inherited from AudioContext |
stream | variable | Inherited from AudioContext |
ctx | variable | Inherited from AudioContext |
codec | variable | Inherited from AudioContext |
frame | variable | Inherited from AudioContext |
resampler | variable | Inherited from AudioContext |
outputFrameSize | variable | Inherited from AudioContext |
time | variable | Inherited from AudioContext |
pts | variable | Inherited from AudioContext |
seconds | variable | Inherited from AudioContext |
error | variable | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
create | function | Inherited from AudioContext |
open | function | Inherited from AudioContext |
close | function | Inherited from AudioContext |
decode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
flush | function | Inherited from AudioContext |
recreateResampler | function | Inherited from AudioContext |
Inherited from AudioContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | last encoded or decoded frame |
variable | resampler | audio resampler |
variable | outputFrameSize | encoder or decoder output frame size |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | audio time in seconds |
variable | error | error message |
function | AudioContext | |
function | AudioContext | Deleted constructor. |
function | AudioContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder. |
function | open virtual | Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed audio packet and emit the resulting samples. |
function | encode virtual nodiscard | Encode a buffer of interleaved audio samples. |
function | encode virtual nodiscard | Encode a buffer of planar audio samples. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | recreateResampler virtual | Recreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required. |
Public Methods
| Return | Name | Description |
|---|---|---|
AudioDecoder | Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar. | |
void | create virtual override | Initialise the AVCodecContext from the stream's codec parameters. |
void | close virtual override | Close and free the AVCodecContext and associated resources. |
bool | decode virtual nodiscard override | Decode the given compressed audio packet and emit the decoded samples. |
void | flush virtual override | Flush 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
streamThe 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
ipacketThe 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:
AudioContextSubclassed by:AudioPacketEncoder
Encodes raw audio samples into a compressed format.
List of all members
| Name | Kind | Owner |
|---|---|---|
fifo | variable | Declared here |
format | variable | Declared here |
nextOutputPts | variable | Declared here |
AudioEncoder | function | Declared here |
create | function | Declared here |
close | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from AudioContext |
iparams | variable | Inherited from AudioContext |
oparams | variable | Inherited from AudioContext |
stream | variable | Inherited from AudioContext |
ctx | variable | Inherited from AudioContext |
codec | variable | Inherited from AudioContext |
frame | variable | Inherited from AudioContext |
resampler | variable | Inherited from AudioContext |
outputFrameSize | variable | Inherited from AudioContext |
time | variable | Inherited from AudioContext |
pts | variable | Inherited from AudioContext |
seconds | variable | Inherited from AudioContext |
error | variable | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
AudioContext | function | Inherited from AudioContext |
create | function | Inherited from AudioContext |
open | function | Inherited from AudioContext |
close | function | Inherited from AudioContext |
decode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
encode | function | Inherited from AudioContext |
flush | function | Inherited from AudioContext |
recreateResampler | function | Inherited from AudioContext |
Inherited from AudioContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | last encoded or decoded frame |
variable | resampler | audio resampler |
variable | outputFrameSize | encoder or decoder output frame size |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | audio time in seconds |
variable | error | error message |
function | AudioContext | |
function | AudioContext | Deleted constructor. |
function | AudioContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Implemented by AudioEncoder and AudioDecoder. |
function | open virtual | Open the codec and create the resampler if input/output parameters differ. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed audio packet and emit the resulting samples. |
function | encode virtual nodiscard | Encode a buffer of interleaved audio samples. |
function | encode virtual nodiscard | Encode a buffer of planar audio samples. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | recreateResampler virtual | Recreate the AudioResampler using the current iparams and oparams. Called automatically by open() when format conversion is required. |
Public Attributes
| Return | Name | Description |
|---|---|---|
av::AudioBuffer | fifo | |
AVFormatContext * | format | |
int64_t | nextOutputPts | 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. |
{#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
| Return | Name | Description |
|---|---|---|
AudioEncoder | Construct an encoder, optionally tied to an existing muxer context. | |
void | create virtual override | Initialise the AVCodecContext using oparams. Adds an audio stream to format if one was provided at construction. |
void | close virtual override | Close and free the AVCodecContext, FIFO buffer, and associated resources. |
bool | encode virtual nodiscard override | Encode interleaved audio samples. |
bool | encode virtual nodiscard override | Encode planar audio samples. |
bool | encode virtual nodiscard override | Encode a single AVFrame (typically from a decoder or resampler). |
void | flush virtual override | Flush 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
formatThe 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
-
samplesThe input samples to encode. -
numSamplesThe number of input samples per channel. -
ptsThe 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
-
samplesThe input samples to encode. -
numSamplesThe number of input samples per channel. -
ptsThe 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
iframeThe 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
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
stream | variable | Declared here |
ctx | variable | Declared here |
codec | variable | Declared here |
frame | variable | Declared here |
conv | variable | Declared here |
time | variable | Declared here |
pts | variable | Declared here |
seconds | variable | Declared here |
error | variable | Declared here |
VideoContext | function | Declared here |
VideoContext | function | Declared here |
VideoContext | function | Declared here |
create | function | Declared here |
open | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
convert | function | Declared here |
recreateConverter | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter | |
VideoCodec | iparams | input parameters |
VideoCodec | oparams | output parameters |
AVStream * | stream | encoder or decoder stream |
AVCodecContext * | ctx | encoder or decoder context |
const AVCodec * | codec | encoder or decoder codec |
AVFrame * | frame | encoder or decoder frame |
std::unique_ptr< VideoConverter > | conv | video conversion context |
int64_t | time | stream time in codec time base |
int64_t | pts | last packet pts value |
double | seconds | video time in seconds |
std::string | error | error 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
| Return | Name | Description |
|---|---|---|
VideoContext | ||
VideoContext | Deleted constructor. | |
VideoContext | Deleted constructor. | |
void | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
void | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
void | close virtual | Close the codec context, free the frame, and reset timestamps. |
bool | decode virtual nodiscard | Decode a compressed video packet and emit the resulting frame. |
bool | encode virtual nodiscard | Encode a buffer of interleaved video data. |
bool | encode virtual nodiscard | Encode a planar video frame. |
bool | encode virtual nodiscard | Encode a single AVFrame. |
void | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
AVFrame * | convert virtual | Convert the video frame and return the result. |
bool | recreateConverter virtual | Recreate 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
ipacketThe 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
-
dataPointer to the interleaved frame buffer. -
sizeSize of the buffer in bytes. -
ptsPresentation 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
-
dataArray of per-plane data pointers (up to 4 planes). -
linesizeArray of per-plane byte strides. -
ptsPresentation 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
iframeThe 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
| Name | Kind | Owner |
|---|---|---|
VideoDecoder | function | Declared here |
create | function | Declared here |
open | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from VideoContext |
iparams | variable | Inherited from VideoContext |
oparams | variable | Inherited from VideoContext |
stream | variable | Inherited from VideoContext |
ctx | variable | Inherited from VideoContext |
codec | variable | Inherited from VideoContext |
frame | variable | Inherited from VideoContext |
conv | variable | Inherited from VideoContext |
time | variable | Inherited from VideoContext |
pts | variable | Inherited from VideoContext |
seconds | variable | Inherited from VideoContext |
error | variable | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
create | function | Inherited from VideoContext |
open | function | Inherited from VideoContext |
close | function | Inherited from VideoContext |
decode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
flush | function | Inherited from VideoContext |
convert | function | Inherited from VideoContext |
recreateConverter | function | Inherited from VideoContext |
Inherited from VideoContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | encoder or decoder frame |
variable | conv | video conversion context |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | video time in seconds |
variable | error | error message |
function | VideoContext | |
function | VideoContext | Deleted constructor. |
function | VideoContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
function | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed video packet and emit the resulting frame. |
function | encode virtual nodiscard | Encode a buffer of interleaved video data. |
function | encode virtual nodiscard | Encode a planar video frame. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | convert virtual | Convert the video frame and return the result. |
function | recreateConverter virtual | Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert(). |
Public Methods
| Return | Name | Description |
|---|---|---|
VideoDecoder | Construct a decoder for the given stream. The codec parameters are read from the stream's codecpar. | |
void | create virtual override | Initialise the AVCodecContext from the stream's codec parameters. |
void | open virtual override | Open the codec and initialise any required pixel format conversion context. |
void | close virtual override | Close and free the AVCodecContext and associated resources. |
bool | decode virtual nodiscard override | 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. |
void | flush virtual override | Flush 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
streamThe 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
ipacketThe 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:
VideoContextSubclassed by:VideoPacketEncoder
Encodes raw video frames into a compressed format.
List of all members
| Name | Kind | Owner |
|---|---|---|
format | variable | Declared here |
VideoEncoder | function | Declared here |
create | function | Declared here |
close | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from VideoContext |
iparams | variable | Inherited from VideoContext |
oparams | variable | Inherited from VideoContext |
stream | variable | Inherited from VideoContext |
ctx | variable | Inherited from VideoContext |
codec | variable | Inherited from VideoContext |
frame | variable | Inherited from VideoContext |
conv | variable | Inherited from VideoContext |
time | variable | Inherited from VideoContext |
pts | variable | Inherited from VideoContext |
seconds | variable | Inherited from VideoContext |
error | variable | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
create | function | Inherited from VideoContext |
open | function | Inherited from VideoContext |
close | function | Inherited from VideoContext |
decode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
flush | function | Inherited from VideoContext |
convert | function | Inherited from VideoContext |
recreateConverter | function | Inherited from VideoContext |
Inherited from VideoContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | encoder or decoder frame |
variable | conv | video conversion context |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | video time in seconds |
variable | error | error message |
function | VideoContext | |
function | VideoContext | Deleted constructor. |
function | VideoContext | Deleted constructor. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
function | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual nodiscard | Decode a compressed video packet and emit the resulting frame. |
function | encode virtual nodiscard | Encode a buffer of interleaved video data. |
function | encode virtual nodiscard | Encode a planar video frame. |
function | encode virtual nodiscard | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | convert virtual | Convert the video frame and return the result. |
function | recreateConverter virtual | Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
AVFormatContext * | format |
{#format-7}
format
AVFormatContext * format
Defined in src/av/include/icy/av/videoencoder.h:69
Public Methods
| Return | Name | Description |
|---|---|---|
VideoEncoder | Construct an encoder, optionally tied to an existing muxer context. | |
void | create virtual override | Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction. |
void | close virtual override | Close and free the AVCodecContext and associated resources. |
bool | encode virtual nodiscard override | Encode a single video frame. This method is for interleaved video formats. |
bool | encode virtual nodiscard override | Encode a single video frame. This method is for planar video formats. |
bool | encode virtual nodiscard override | Encode a single AVFrame (typically from a decoder or converter). |
void | flush virtual override | Flush 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
formatThe 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
-
dataThe raw video frame buffer. -
sizeThe buffer size in bytes. -
ptsThe 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
-
dataArray of per-plane data pointers (up to 4 planes). -
linesizeArray of per-plane byte strides. -
ptsThe 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
iframeThe 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
| Name | Kind | Owner |
|---|---|---|
type | variable | Declared here |
id | variable | Declared here |
name | variable | Declared here |
isDefault | variable | Declared here |
isConnected | variable | Declared here |
isInUse | variable | Declared here |
videoCapabilities | variable | Declared here |
audioCapabilities | variable | Declared here |
Device | function | Declared here |
Device | function | Declared here |
print | function | Declared here |
operator== | function | Declared here |
bestVideoCapability | function | Declared here |
bestAudioCapability | function | Declared here |
Type | enum | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
Type | type | |
std::string | id | |
std::string | name | |
bool | isDefault | |
bool | isConnected | |
bool | isInUse | |
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
| Return | Name | Description |
|---|---|---|
Device | Construct a device with Unknown type and empty fields. | |
Device | Construct a device with explicit fields. | |
void | print const | Print device details (type, id, name, capabilities) to the given stream. |
bool | operator== const inline | Equality based on type, id, and name. |
VideoCapability | bestVideoCapability const inline | Find the video capability closest to the requested parameters. |
AudioCapability | bestAudioCapability const inline | Find 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
-
typeThe device type (VideoInput, AudioInput, etc.). -
idThe platform-specific device identifier. -
nameThe human-readable device name. -
isDefaultTrue 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
osThe 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
| Name | Description |
|---|---|
Type |
{#type-5}
Type
enum Type
Defined in src/av/include/icy/av/devicemanager.h:46
| Value | Description |
|---|---|
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
| Name | Kind | Owner |
|---|---|---|
width | variable | Declared here |
height | variable | Declared here |
minFps | variable | Declared here |
maxFps | variable | Declared here |
pixelFormat | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
int | width | |
int | height | |
double | minFps | |
double | maxFps | |
std::string | pixelFormat |
{#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
| Name | Kind | Owner |
|---|---|---|
sampleRate | variable | Declared here |
channels | variable | Declared here |
sampleFormat | variable | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
int | sampleRate | |
int | channels | |
std::string | sampleFormat |
{#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
| Name | Kind | Owner |
|---|---|---|
ctx | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
outSamples | variable | Declared here |
outNumSamples | variable | Declared here |
outBufferSize | variable | Declared here |
maxNumSamples | variable | Declared here |
inSampleFmt | variable | Declared here |
outSampleFmt | variable | Declared here |
AudioResampler | function | Declared here |
AudioResampler | function | Declared here |
AudioResampler | function | Declared here |
open | function | Declared here |
close | function | Declared here |
resample | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
SwrContext * | ctx | the conversion context |
AudioCodec | iparams | input audio parameters |
AudioCodec | oparams | output audio parameters |
uint8_t ** | outSamples | the output samples buffer |
int | outNumSamples | the number of samples currently in the output buffer |
int | outBufferSize | the number of bytes currently in the buffer |
int | maxNumSamples | the maximum number of samples that can be stored in |
enum AVSampleFormat | inSampleFmt | input sample format |
enum AVSampleFormat | outSampleFmt | output 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
| Return | Name | Description |
|---|---|---|
AudioResampler | ||
AudioResampler | Deleted constructor. | |
AudioResampler | Deleted constructor. | |
void | open | 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. |
void | close | Free the libswresample context and release the output sample buffer. |
int | resample | Convert 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
-
inSamplesPointer to the input sample buffer array. -
inNumSamplesThe 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
| Name | Kind | Owner |
|---|---|---|
ctx | variable | Declared here |
oframe | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
VideoConverter | function | Declared here |
VideoConverter | function | Declared here |
VideoConverter | function | Declared here |
create | function | Declared here |
close | function | Declared here |
convert | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
SwsContext * | ctx | libswscale conversion context. |
AVFrame * | oframe | Reusable output frame allocated by create(). |
VideoCodec | iparams | Expected input video parameters. |
VideoCodec | oparams | Target 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
| Return | Name | Description |
|---|---|---|
VideoConverter | ||
VideoConverter | Deleted constructor. | |
VideoConverter | Deleted constructor. | |
void | create virtual | 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. |
void | close virtual | Free the libswscale context and the output frame. |
AVFrame * | convert virtual | Convert 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
iframeThe 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:
RawPacketSubclassed by:AudioPacket,VideoPacket
Timestamped media packet carrying raw audio or video data.
List of all members
| Name | Kind | Owner |
|---|---|---|
time | variable | Declared here |
MediaPacket | function | Declared here |
MediaPacket | function | Declared here |
MediaPacket | function | Declared here |
clone | function | Declared here |
className | function | Declared here |
_data | variable | Inherited from RawPacket |
_size | variable | Inherited from RawPacket |
_owned | variable | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
~RawPacket | function | Inherited from RawPacket |
clone | function | Inherited from RawPacket |
copyData | function | Inherited from RawPacket |
read | function | Inherited from RawPacket |
write | function | Inherited from RawPacket |
data | function | Inherited from RawPacket |
size | function | Inherited from RawPacket |
className | function | Inherited from RawPacket |
ownsBuffer | function | Inherited from RawPacket |
opaque | variable | Inherited from IPacket |
info | variable | Inherited from IPacket |
flags | variable | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
operator= | function | Inherited from IPacket |
clone | function | Inherited from IPacket |
~IPacket | function | Inherited from IPacket |
read | function | Inherited from IPacket |
write | function | Inherited from IPacket |
size | function | Inherited from IPacket |
hasData | function | Inherited from IPacket |
data | function | Inherited from IPacket |
constData | function | Inherited from IPacket |
className | function | Inherited from IPacket |
print | function | Inherited from IPacket |
operator<< | friend | Inherited from IPacket |
Inherited from RawPacket
| Kind | Name | Description |
|---|---|---|
variable | _data | |
variable | _size | |
variable | _owned | |
function | RawPacket inline | Construct with borrowed (non-owning) buffer. |
function | RawPacket inline | Construct with const data (copied, owning). |
function | RawPacket inline | Copy constructor (always copies data). |
function | ~RawPacket virtual | Defaulted destructor. |
function | clone virtual const inline override | |
function | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
function | read virtual inline override | Reads from the buffer by copying its contents into an owned buffer. |
function | write virtual const inline override | Appends the packet data to the given output buffer. |
function | data virtual const inline override | |
function | size virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
function | ownsBuffer const inline |
Inherited from IPacket
| Kind | Name | Description |
|---|---|---|
variable | opaque | Optional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime. |
variable | info | Optional extra information about the packet. |
variable | flags | Provides basic information about the packet. |
function | IPacket inline | |
function | IPacket inline | Copy constructor; clones the info object if present. |
function | operator= inline | Copy assignment; clones the info object if present. |
function | clone virtual const | Returns a heap-allocated deep copy of this packet. |
function | ~IPacket virtual | Defaulted destructor. |
function | read virtual | Read/parse to the packet from the given input buffer. The number of bytes read is returned. |
function | write virtual const | Copy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer. |
function | size virtual const inline | The size of the packet in bytes. |
function | hasData virtual const inline | Returns true if the packet has a non-null data pointer. |
function | data virtual const inline | The packet data pointer for buffered packets. |
function | constData virtual const inline | The const packet data pointer for buffered packets. |
function | className virtual const | Returns the class name of this packet type for logging and diagnostics. |
function | print virtual const inline | Prints a human-readable representation to the given stream. |
friend | operator<< inline | Stream insertion operator; delegates to print(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
int64_t | time | Presentation 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
| Return | Name | Description |
|---|---|---|
MediaPacket inline | Construct with a non-owning or owning mutable buffer. | |
MediaPacket inline | Construct with const data (copied, owning). | |
MediaPacket inline | Copy constructor. | |
std::unique_ptr< IPacket > | clone virtual const inline override | |
const char * | className virtual const inline override | Returns 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
-
dataPointer to the raw data buffer (may be null). -
sizeSize of the buffer in bytes. -
timePresentation 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
-
dataPointer to the const raw data buffer (data is copied). -
sizeSize of the buffer in bytes. -
timePresentation 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:
MediaPacketSubclassed by:PlanarVideoPacket
Video packet for interleaved formats.
List of all members
| Name | Kind | Owner |
|---|---|---|
width | variable | Declared here |
height | variable | Declared here |
iframe | variable | Declared here |
avpacket | variable | Declared here |
VideoPacket | function | Declared here |
VideoPacket | function | Declared here |
clone | function | Declared here |
className | function | Declared here |
time | variable | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
clone | function | Inherited from MediaPacket |
className | function | Inherited from MediaPacket |
_data | variable | Inherited from RawPacket |
_size | variable | Inherited from RawPacket |
_owned | variable | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
~RawPacket | function | Inherited from RawPacket |
clone | function | Inherited from RawPacket |
copyData | function | Inherited from RawPacket |
read | function | Inherited from RawPacket |
write | function | Inherited from RawPacket |
data | function | Inherited from RawPacket |
size | function | Inherited from RawPacket |
className | function | Inherited from RawPacket |
ownsBuffer | function | Inherited from RawPacket |
opaque | variable | Inherited from IPacket |
info | variable | Inherited from IPacket |
flags | variable | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
operator= | function | Inherited from IPacket |
clone | function | Inherited from IPacket |
~IPacket | function | Inherited from IPacket |
read | function | Inherited from IPacket |
write | function | Inherited from IPacket |
size | function | Inherited from IPacket |
hasData | function | Inherited from IPacket |
data | function | Inherited from IPacket |
constData | function | Inherited from IPacket |
className | function | Inherited from IPacket |
print | function | Inherited from IPacket |
operator<< | friend | Inherited from IPacket |
Inherited from MediaPacket
| Kind | Name | Description |
|---|---|---|
variable | time | Presentation timestamp in microseconds. |
function | MediaPacket inline | Construct with a non-owning or owning mutable buffer. |
function | MediaPacket inline | Construct with const data (copied, owning). |
function | MediaPacket inline | Copy constructor. |
function | clone virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from RawPacket
| Kind | Name | Description |
|---|---|---|
variable | _data | |
variable | _size | |
variable | _owned | |
function | RawPacket inline | Construct with borrowed (non-owning) buffer. |
function | RawPacket inline | Construct with const data (copied, owning). |
function | RawPacket inline | Copy constructor (always copies data). |
function | ~RawPacket virtual | Defaulted destructor. |
function | clone virtual const inline override | |
function | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
function | read virtual inline override | Reads from the buffer by copying its contents into an owned buffer. |
function | write virtual const inline override | Appends the packet data to the given output buffer. |
function | data virtual const inline override | |
function | size virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
function | ownsBuffer const inline |
Inherited from IPacket
| Kind | Name | Description |
|---|---|---|
variable | opaque | Optional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime. |
variable | info | Optional extra information about the packet. |
variable | flags | Provides basic information about the packet. |
function | IPacket inline | |
function | IPacket inline | Copy constructor; clones the info object if present. |
function | operator= inline | Copy assignment; clones the info object if present. |
function | clone virtual const | Returns a heap-allocated deep copy of this packet. |
function | ~IPacket virtual | Defaulted destructor. |
function | read virtual | Read/parse to the packet from the given input buffer. The number of bytes read is returned. |
function | write virtual const | Copy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer. |
function | size virtual const inline | The size of the packet in bytes. |
function | hasData virtual const inline | Returns true if the packet has a non-null data pointer. |
function | data virtual const inline | The packet data pointer for buffered packets. |
function | constData virtual const inline | The const packet data pointer for buffered packets. |
function | className virtual const | Returns the class name of this packet type for logging and diagnostics. |
function | print virtual const inline | Prints a human-readable representation to the given stream. |
friend | operator<< inline | Stream insertion operator; delegates to print(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
int | width | Frame width in pixels. |
int | height | Frame height in pixels. |
bool | iframe | True if this is an intra (keyframe) frame. |
AVPacket * | avpacket | Non-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
| Return | Name | Description |
|---|---|---|
VideoPacket inline | Construct a video packet with an interleaved buffer. | |
VideoPacket inline | Copy constructor. The avpacket pointer is shallow-copied (non-owning). | |
std::unique_ptr< IPacket > | clone virtual const inline override | |
const char * | className virtual const inline override | Returns 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
-
dataPointer to the raw frame buffer (may be null). -
sizeSize of the buffer in bytes. -
widthFrame width in pixels. -
heightFrame height in pixels. -
timePresentation 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:
VideoPacketSubclassed by:VisionFramePacket
Video packet for planar formats.
Parameters
-
dataArray of per-plane data pointers (up to 4 planes). -
linesizeArray of per-plane byte strides. -
pixelFmtThe pixel format name (e.g. "yuv420p"). -
widthThe frame width in pixels. -
heightThe frame height in pixels. -
timeThe timestamp in microseconds.
List of all members
| Name | Kind | Owner |
|---|---|---|
buffer | variable | Declared here |
linesize | variable | Declared here |
pixelFmt | variable | Declared here |
owns_buffer | variable | Declared here |
avframe | variable | Declared here |
PlanarVideoPacket | function | Declared here |
PlanarVideoPacket | function | Declared here |
clone | function | Declared here |
className | function | Declared here |
width | variable | Inherited from VideoPacket |
height | variable | Inherited from VideoPacket |
iframe | variable | Inherited from VideoPacket |
avpacket | variable | Inherited from VideoPacket |
VideoPacket | function | Inherited from VideoPacket |
VideoPacket | function | Inherited from VideoPacket |
clone | function | Inherited from VideoPacket |
className | function | Inherited from VideoPacket |
time | variable | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
clone | function | Inherited from MediaPacket |
className | function | Inherited from MediaPacket |
_data | variable | Inherited from RawPacket |
_size | variable | Inherited from RawPacket |
_owned | variable | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
~RawPacket | function | Inherited from RawPacket |
clone | function | Inherited from RawPacket |
copyData | function | Inherited from RawPacket |
read | function | Inherited from RawPacket |
write | function | Inherited from RawPacket |
data | function | Inherited from RawPacket |
size | function | Inherited from RawPacket |
className | function | Inherited from RawPacket |
ownsBuffer | function | Inherited from RawPacket |
opaque | variable | Inherited from IPacket |
info | variable | Inherited from IPacket |
flags | variable | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
operator= | function | Inherited from IPacket |
clone | function | Inherited from IPacket |
~IPacket | function | Inherited from IPacket |
read | function | Inherited from IPacket |
write | function | Inherited from IPacket |
size | function | Inherited from IPacket |
hasData | function | Inherited from IPacket |
data | function | Inherited from IPacket |
constData | function | Inherited from IPacket |
className | function | Inherited from IPacket |
print | function | Inherited from IPacket |
operator<< | friend | Inherited from IPacket |
Inherited from VideoPacket
| Kind | Name | Description |
|---|---|---|
variable | width | Frame width in pixels. |
variable | height | Frame height in pixels. |
variable | iframe | True if this is an intra (keyframe) frame. |
variable | avpacket | Non-owning pointer to the encoded AVPacket from FFmpeg. Set by VideoEncoder, read by MultiplexEncoder. |
function | VideoPacket inline | Construct a video packet with an interleaved buffer. |
function | VideoPacket inline | Copy constructor. The avpacket pointer is shallow-copied (non-owning). |
function | clone virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from MediaPacket
| Kind | Name | Description |
|---|---|---|
variable | time | Presentation timestamp in microseconds. |
function | MediaPacket inline | Construct with a non-owning or owning mutable buffer. |
function | MediaPacket inline | Construct with const data (copied, owning). |
function | MediaPacket inline | Copy constructor. |
function | clone virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from RawPacket
| Kind | Name | Description |
|---|---|---|
variable | _data | |
variable | _size | |
variable | _owned | |
function | RawPacket inline | Construct with borrowed (non-owning) buffer. |
function | RawPacket inline | Construct with const data (copied, owning). |
function | RawPacket inline | Copy constructor (always copies data). |
function | ~RawPacket virtual | Defaulted destructor. |
function | clone virtual const inline override | |
function | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
function | read virtual inline override | Reads from the buffer by copying its contents into an owned buffer. |
function | write virtual const inline override | Appends the packet data to the given output buffer. |
function | data virtual const inline override | |
function | size virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
function | ownsBuffer const inline |
Inherited from IPacket
| Kind | Name | Description |
|---|---|---|
variable | opaque | Optional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime. |
variable | info | Optional extra information about the packet. |
variable | flags | Provides basic information about the packet. |
function | IPacket inline | |
function | IPacket inline | Copy constructor; clones the info object if present. |
function | operator= inline | Copy assignment; clones the info object if present. |
function | clone virtual const | Returns a heap-allocated deep copy of this packet. |
function | ~IPacket virtual | Defaulted destructor. |
function | read virtual | Read/parse to the packet from the given input buffer. The number of bytes read is returned. |
function | write virtual const | Copy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer. |
function | size virtual const inline | The size of the packet in bytes. |
function | hasData virtual const inline | Returns true if the packet has a non-null data pointer. |
function | data virtual const inline | The packet data pointer for buffered packets. |
function | constData virtual const inline | The const packet data pointer for buffered packets. |
function | className virtual const | Returns the class name of this packet type for logging and diagnostics. |
function | print virtual const inline | Prints a human-readable representation to the given stream. |
friend | operator<< inline | Stream insertion operator; delegates to print(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
uint8_t * | buffer | |
int | linesize | |
std::string | pixelFmt | |
bool | owns_buffer | |
AVFrame * | avframe | Non-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
| Return | Name | Description |
|---|---|---|
PlanarVideoPacket | Construct a planar video packet, copying the plane pointers (not the pixel data). | |
PlanarVideoPacket | Copy 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 override | Returns 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
-
dataArray of up to 4 per-plane data pointers. -
linesizeArray of per-plane byte strides. -
pixelFmtThe pixel format string (e.g. "yuv420p"). -
widthFrame width in pixels. -
heightFrame height in pixels. -
timePresentation 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:
MediaPacketSubclassed by:PlanarAudioPacket
Audio packet for interleaved formats.
List of all members
| Name | Kind | Owner |
|---|---|---|
numSamples | variable | Declared here |
avpacket | variable | Declared here |
AudioPacket | function | Declared here |
clone | function | Declared here |
samples | function | Declared here |
className | function | Declared here |
time | variable | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
clone | function | Inherited from MediaPacket |
className | function | Inherited from MediaPacket |
_data | variable | Inherited from RawPacket |
_size | variable | Inherited from RawPacket |
_owned | variable | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
~RawPacket | function | Inherited from RawPacket |
clone | function | Inherited from RawPacket |
copyData | function | Inherited from RawPacket |
read | function | Inherited from RawPacket |
write | function | Inherited from RawPacket |
data | function | Inherited from RawPacket |
size | function | Inherited from RawPacket |
className | function | Inherited from RawPacket |
ownsBuffer | function | Inherited from RawPacket |
opaque | variable | Inherited from IPacket |
info | variable | Inherited from IPacket |
flags | variable | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
operator= | function | Inherited from IPacket |
clone | function | Inherited from IPacket |
~IPacket | function | Inherited from IPacket |
read | function | Inherited from IPacket |
write | function | Inherited from IPacket |
size | function | Inherited from IPacket |
hasData | function | Inherited from IPacket |
data | function | Inherited from IPacket |
constData | function | Inherited from IPacket |
className | function | Inherited from IPacket |
print | function | Inherited from IPacket |
operator<< | friend | Inherited from IPacket |
Inherited from MediaPacket
| Kind | Name | Description |
|---|---|---|
variable | time | Presentation timestamp in microseconds. |
function | MediaPacket inline | Construct with a non-owning or owning mutable buffer. |
function | MediaPacket inline | Construct with const data (copied, owning). |
function | MediaPacket inline | Copy constructor. |
function | clone virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from RawPacket
| Kind | Name | Description |
|---|---|---|
variable | _data | |
variable | _size | |
variable | _owned | |
function | RawPacket inline | Construct with borrowed (non-owning) buffer. |
function | RawPacket inline | Construct with const data (copied, owning). |
function | RawPacket inline | Copy constructor (always copies data). |
function | ~RawPacket virtual | Defaulted destructor. |
function | clone virtual const inline override | |
function | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
function | read virtual inline override | Reads from the buffer by copying its contents into an owned buffer. |
function | write virtual const inline override | Appends the packet data to the given output buffer. |
function | data virtual const inline override | |
function | size virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
function | ownsBuffer const inline |
Inherited from IPacket
| Kind | Name | Description |
|---|---|---|
variable | opaque | Optional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime. |
variable | info | Optional extra information about the packet. |
variable | flags | Provides basic information about the packet. |
function | IPacket inline | |
function | IPacket inline | Copy constructor; clones the info object if present. |
function | operator= inline | Copy assignment; clones the info object if present. |
function | clone virtual const | Returns a heap-allocated deep copy of this packet. |
function | ~IPacket virtual | Defaulted destructor. |
function | read virtual | Read/parse to the packet from the given input buffer. The number of bytes read is returned. |
function | write virtual const | Copy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer. |
function | size virtual const inline | The size of the packet in bytes. |
function | hasData virtual const inline | Returns true if the packet has a non-null data pointer. |
function | data virtual const inline | The packet data pointer for buffered packets. |
function | constData virtual const inline | The const packet data pointer for buffered packets. |
function | className virtual const | Returns the class name of this packet type for logging and diagnostics. |
function | print virtual const inline | Prints a human-readable representation to the given stream. |
friend | operator<< inline | Stream insertion operator; delegates to print(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
size_t | numSamples | Number of audio samples per channel. |
AVPacket * | avpacket | Non-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
| Return | Name | Description |
|---|---|---|
AudioPacket inline | Construct 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 override | Returns 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
-
dataPointer to the interleaved sample buffer (may be null). -
sizeSize of the buffer in bytes. -
numSamplesNumber of samples per channel. -
timePresentation 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
-
dataArray of per-plane sample buffers (one per channel). -
channelsThe number of audio channels. -
numSamplesThe number of samples per channel. -
sampleFmtThe sample format name (e.g. "fltp"). -
timeThe timestamp in microseconds.
List of all members
| Name | Kind | Owner |
|---|---|---|
buffer | variable | Declared here |
linesize | variable | Declared here |
channels | variable | Declared here |
sampleFmt | variable | Declared here |
owns_buffer | variable | Declared here |
PlanarAudioPacket | function | Declared here |
PlanarAudioPacket | function | Declared here |
clone | function | Declared here |
className | function | Declared here |
numSamples | variable | Inherited from AudioPacket |
avpacket | variable | Inherited from AudioPacket |
AudioPacket | function | Inherited from AudioPacket |
clone | function | Inherited from AudioPacket |
samples | function | Inherited from AudioPacket |
className | function | Inherited from AudioPacket |
time | variable | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
MediaPacket | function | Inherited from MediaPacket |
clone | function | Inherited from MediaPacket |
className | function | Inherited from MediaPacket |
_data | variable | Inherited from RawPacket |
_size | variable | Inherited from RawPacket |
_owned | variable | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
RawPacket | function | Inherited from RawPacket |
~RawPacket | function | Inherited from RawPacket |
clone | function | Inherited from RawPacket |
copyData | function | Inherited from RawPacket |
read | function | Inherited from RawPacket |
write | function | Inherited from RawPacket |
data | function | Inherited from RawPacket |
size | function | Inherited from RawPacket |
className | function | Inherited from RawPacket |
ownsBuffer | function | Inherited from RawPacket |
opaque | variable | Inherited from IPacket |
info | variable | Inherited from IPacket |
flags | variable | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
IPacket | function | Inherited from IPacket |
operator= | function | Inherited from IPacket |
clone | function | Inherited from IPacket |
~IPacket | function | Inherited from IPacket |
read | function | Inherited from IPacket |
write | function | Inherited from IPacket |
size | function | Inherited from IPacket |
hasData | function | Inherited from IPacket |
data | function | Inherited from IPacket |
constData | function | Inherited from IPacket |
className | function | Inherited from IPacket |
print | function | Inherited from IPacket |
operator<< | friend | Inherited from IPacket |
Inherited from AudioPacket
| Kind | Name | Description |
|---|---|---|
variable | numSamples | Number of audio samples per channel. |
variable | avpacket | Non-owning pointer to the encoded AVPacket from FFmpeg. Set by AudioEncoder, read by MultiplexEncoder. |
function | AudioPacket inline | Construct an audio packet with an interleaved sample buffer. |
function | clone virtual const inline override | |
function | samples virtual const inline | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from MediaPacket
| Kind | Name | Description |
|---|---|---|
variable | time | Presentation timestamp in microseconds. |
function | MediaPacket inline | Construct with a non-owning or owning mutable buffer. |
function | MediaPacket inline | Construct with const data (copied, owning). |
function | MediaPacket inline | Copy constructor. |
function | clone virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
Inherited from RawPacket
| Kind | Name | Description |
|---|---|---|
variable | _data | |
variable | _size | |
variable | _owned | |
function | RawPacket inline | Construct with borrowed (non-owning) buffer. |
function | RawPacket inline | Construct with const data (copied, owning). |
function | RawPacket inline | Copy constructor (always copies data). |
function | ~RawPacket virtual | Defaulted destructor. |
function | clone virtual const inline override | |
function | copyData virtual inline | Copies data into an internally owned buffer, replacing any prior content. |
function | read virtual inline override | Reads from the buffer by copying its contents into an owned buffer. |
function | write virtual const inline override | Appends the packet data to the given output buffer. |
function | data virtual const inline override | |
function | size virtual const inline override | |
function | className virtual const inline override | Returns the class name of this packet type for logging and diagnostics. |
function | ownsBuffer const inline |
Inherited from IPacket
| Kind | Name | Description |
|---|---|---|
variable | opaque | Optional type-safe context data. Use std::any_cast to retrieve. Lifetime of the stored value is tied to the packet's lifetime. |
variable | info | Optional extra information about the packet. |
variable | flags | Provides basic information about the packet. |
function | IPacket inline | |
function | IPacket inline | Copy constructor; clones the info object if present. |
function | operator= inline | Copy assignment; clones the info object if present. |
function | clone virtual const | Returns a heap-allocated deep copy of this packet. |
function | ~IPacket virtual | Defaulted destructor. |
function | read virtual | Read/parse to the packet from the given input buffer. The number of bytes read is returned. |
function | write virtual const | Copy/generate to the packet given output buffer. The number of bytes written can be obtained from the buffer. |
function | size virtual const inline | The size of the packet in bytes. |
function | hasData virtual const inline | Returns true if the packet has a non-null data pointer. |
function | data virtual const inline | The packet data pointer for buffered packets. |
function | constData virtual const inline | The const packet data pointer for buffered packets. |
function | className virtual const | Returns the class name of this packet type for logging and diagnostics. |
function | print virtual const inline | Prints a human-readable representation to the given stream. |
friend | operator<< inline | Stream insertion operator; delegates to print(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
uint8_t * | buffer | |
int | linesize | |
int | channels | |
std::string | sampleFmt | |
bool | owns_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
| Return | Name | Description |
|---|---|---|
PlanarAudioPacket | Construct a planar audio packet, copying the plane pointers (not the sample data). | |
PlanarAudioPacket | Copy 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 override | Returns 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
-
dataArray of up to 4 per-channel sample buffers. -
channelsNumber of audio channels. -
numSamplesNumber of samples per channel. -
sampleFmtThe sample format string (e.g. "fltp"). -
timePresentation 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.