A QIODevice that produces an infinite stream of silence (zero-valued PCM samples).
More...
#include <rtp_audio_silence_generator.h>
|
| | 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.
|
| |
|
| 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.
|
| |
A QIODevice that produces an infinite stream of silence (zero-valued PCM samples).
◆ AudioSilenceGenerator()
| AudioSilenceGenerator::AudioSilenceGenerator |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ 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
-
| data | Output buffer to fill with silence. |
| maxSize | Number 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
-
| off | The 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
-
| data | Ignored. |
| maxSize | Ignored. |
- Returns
- -1 unconditionally.
The documentation for this class was generated from the following files: