Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
AudioRoutingFilter Class Reference

A QIODevice filter that applies audio routing to a raw PCM stream. More...

#include <rtp_audio_routing_filter.h>

Inheritance diagram for AudioRoutingFilter:

Public Member Functions

 AudioRoutingFilter (QIODevice *input, bool stereo_required, AudioRouting audio_routing)
 Construct an AudioRoutingFilter.
 
 ~AudioRoutingFilter ()
 Destroy the filter. The upstream device is not closed or deleted.
 
void close () override
 Close this filter device.
 
qint64 size () const override
 Return the total byte size of the audio stream.
 
qint64 pos () const override
 Return the current read position within the stream.
 
bool seek (qint64 off) override
 Seek to an absolute byte offset in the stream.
 

Protected Member Functions

qint64 readData (char *data, qint64 maxSize) override
 Read and route up to maxSize bytes from the upstream device.
 
qint64 writeData (const char *data, qint64 maxSize) override
 Not supported — this filter is read-only.
 

Detailed Description

A QIODevice filter that applies audio routing to a raw PCM stream.

Constructor & Destructor Documentation

◆ AudioRoutingFilter()

AudioRoutingFilter::AudioRoutingFilter ( QIODevice *  input,
bool  stereo_required,
AudioRouting  audio_routing 
)
explicit

Construct an AudioRoutingFilter.

Parameters
inputThe upstream PCM device to read raw audio from. Must outlive this filter. The filter does not take ownership of the pointer.
stereo_requiredtrue if the downstream audio output expects interleaved stereo (two-channel) PCM; false if it expects mono (single-channel) PCM. This controls how the routing transformation maps input samples to output samples.
audio_routingThe initial mute state and channel assignment to apply to the stream.

Member Function Documentation

◆ pos()

qint64 AudioRoutingFilter::pos ( ) const
override

Return the current read position within the stream.

Returns
The current byte offset from the start of the stream.

◆ readData()

qint64 AudioRoutingFilter::readData ( char *  data,
qint64  maxSize 
)
overrideprotected

Read and route up to maxSize bytes from the upstream device.

Parameters
dataOutput buffer to write transformed PCM into.
maxSizeMaximum number of bytes to write into data.
Returns
The number of bytes written, or -1 on error.

◆ seek()

bool AudioRoutingFilter::seek ( qint64  off)
override

Seek to an absolute byte offset in the stream.

Parameters
offThe target byte offset from the start of the stream.
Returns
true if the upstream device accepted the seek; false otherwise.

◆ size()

qint64 AudioRoutingFilter::size ( ) const
override

Return the total byte size of the audio stream.

Returns
The number of bytes available in the upstream device, or -1 if the size is not known.

◆ writeData()

qint64 AudioRoutingFilter::writeData ( const char *  data,
qint64  maxSize 
)
overrideprotected

Not supported — this filter is read-only.

Parameters
dataIgnored.
maxSizeIgnored.
Returns
-1 unconditionally.

The documentation for this class was generated from the following files: