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

A QIODevice that produces an infinite stream of silence (zero-valued PCM samples). More...

#include <rtp_audio_silence_generator.h>

Inheritance diagram for AudioSilenceGenerator:

Public Member Functions

 AudioSilenceGenerator (QObject *parent=nullptr)
 Construct an AudioSilenceGenerator.
 
 ~AudioSilenceGenerator ()
 Destroy the generator. No resources are released.
 
qint64 size () const override
 Return the logical size of the silence stream.
 
qint64 pos () const override
 Return the current read position within the silence stream.
 
bool seek (qint64 off) override
 Seek to an absolute byte offset within the silence stream.
 

Protected Member Functions

qint64 readData (char *data, qint64 maxSize) override
 Fill data with up to maxSize zero-valued (silent) bytes.
 
qint64 writeData (const char *data, qint64 maxSize) override
 Not supported — this device is read-only.
 

Detailed Description

A QIODevice that produces an infinite stream of silence (zero-valued PCM samples).

Constructor & Destructor Documentation

◆ AudioSilenceGenerator()

AudioSilenceGenerator::AudioSilenceGenerator ( QObject *  parent = nullptr)
explicit

Construct an AudioSilenceGenerator.

Parameters
parentThe parent QObject; may be nullptr.

Member Function Documentation

◆ pos()

qint64 AudioSilenceGenerator::pos ( ) const
override

Return the current read position within the silence stream.

Returns
The number of bytes that have been read since construction or the last seek().

◆ readData()

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

Fill data with up to maxSize zero-valued (silent) bytes.

Parameters
dataOutput buffer to fill with silence.
maxSizeNumber of bytes the caller has requested.
Returns
maxSize — the number of bytes written into data.

◆ seek()

bool AudioSilenceGenerator::seek ( qint64  off)
override

Seek to an absolute byte offset within the silence stream.

Parameters
offThe target byte offset. Must be non-negative.
Returns
true unconditionally; seeking always succeeds.

◆ size()

qint64 AudioSilenceGenerator::size ( ) const
override

Return the logical size of the silence stream.

Returns
std::numeric_limits<qint64>::max() (or equivalent).

◆ writeData()

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

Not supported — this device is read-only.

Parameters
dataIgnored.
maxSizeIgnored.
Returns
-1 unconditionally.

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