AudioCapture
AudioCapture
#include <icy/av/audiocapture.h>class AudioCaptureDefined 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 |
~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 |
operator= | function | Inherited from MediaCapture |
MediaCapture | function | Inherited from MediaCapture |
operator= | 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 |
~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 |
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 |
_emitter | variable | 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 |
~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 noexcept override | |
function | MediaCapture | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | MediaCapture | Deleted constructor. |
function | operator= | Deleted assignment operator. |
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](icy-av-VideoPacket.html#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 | ~ICapture virtual | Defaulted destructor. |
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 |
|---|---|---|
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 | 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. |
variable | _emitter | |
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 | ~Runnable virtual | Defaulted destructor. |
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
AudioCapture()Defined in src/av/include/icy/av/audiocapture.h:32
Construct without opening a device. Call openAudio() before start().
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
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
virtual override
virtual void openAudio(const std::string & device, const av::AudioCodec & params) overrideDefined 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
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
using Ptr = std::shared_ptr< AudioCapture >