| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
RtpAudioFile Class Reference

A QIODevice subclass that handles reading and writing of RTP audio files and frames. More...

`#include <rtp_audio_file.h>`

Inheritance diagram for RtpAudioFile:

## Public Member Functions
| RtpAudioFile (bool use_disk_for_temp, bool use_disk_for_frames)
| Constructs an RtpAudioFile object.
| ~RtpAudioFile ()
| Destroys the RtpAudioFile object.
void | setFrameWriteStage ()
| Sets the file to the frame write stage.
void | frameWriteSilence (uint32_t frame_num, qint64 samples)
| Writes a silence frame.
qint64 | frameWriteSamples (uint32_t frame_num, const char *data, qint64 max_size)
| Writes actual audio sample data for a frame.
void | setFrameReadStage (qint64 prepend_samples)
| Sets the file to the frame read stage.
bool | readFrameSamples (int32_t *read_buff_bytes, SAMPLE **read_buff, uint32_t *read_len, uint32_t *frame_num, rtp_frame_type *type)
| Reads samples for a single frame.
void | setDataReadStage ()
| Sets the file to the data read stage for playback.
bool | open (QIODevice::OpenMode mode) override
| Opens the device with the specified mode.
qint64 | size () const override
| Gets the size of the file.
qint64 | pos () const override
| Gets the current byte position in the file.
bool | seek (qint64 off) override
| Seeks to a specific byte offset.
qint64 | sampleFileSize ()
| Retrieves the underlying sample file size.
void | seekSample (qint64 samples)
| Seeks to a specific sample position.
qint64 | readSample (SAMPLE *sample)
| Reads a single sample.
qint64 | getTotalSamples ()
| Gets the total number of samples.
qint64 | getEndOfSilenceSample ()
| Gets the sample index at the end of inserted silence.

## Protected Member Functions
qint64 | readData (char *data, qint64 maxSize) override
| Reads up to maxSize bytes of data into the given buffer.
qint64 | writeData (const char *data, qint64 maxSize) override
| Writes up to maxSize bytes of data from the given buffer.

## Detailed Description

A QIODevice subclass that handles reading and writing of RTP audio files and frames.

## Constructor & Destructor Documentation

## ◆ RtpAudioFile()

RtpAudioFile::RtpAudioFile | ( | bool | use_disk_for_temp,
|  | bool | use_disk_for_frames )
| explicit

Constructs an RtpAudioFile object.

Parameters

  use_disk_for_temp | Indicates whether to use disk for temporary files.
  use_disk_for_frames | Indicates whether to use disk for storing frame data.

## Member Function Documentation

## ◆ frameWriteSamples()

qint64 RtpAudioFile::frameWriteSamples | ( | uint32_t | frame_num,
|  | const char * | data,
|  | qint64 | max_size )

Writes actual audio sample data for a frame.

Parameters

  frame_num | The frame number.
  data | Pointer to the audio data to write.
  max_size | The maximum size of the data to write.

Returns
  The number of bytes successfully written.

## ◆ frameWriteSilence()

void RtpAudioFile::frameWriteSilence | ( | uint32_t | frame_num,
|  | qint64 | samples )

Writes a silence frame.

Parameters

  frame_num | The frame number.
  samples | The number of silence samples.

## ◆ getEndOfSilenceSample()

qint64 RtpAudioFile::getEndOfSilenceSample | ( |  | ) |

Gets the sample index at the end of inserted silence.

Returns
  The sample index.

## ◆ getTotalSamples()

qint64 RtpAudioFile::getTotalSamples | ( |  | ) |

Gets the total number of samples.

Returns
  The total sample count.

## ◆ open()

bool RtpAudioFile::open | ( | QIODevice::OpenMode | mode | ) |
| override

Opens the device with the specified mode.

Parameters

  mode | The mode to open the device in.

Returns
  True if successfully opened, false otherwise.

## ◆ pos()

qint64 RtpAudioFile::pos | ( |  | ) | const
| override

Gets the current byte position in the file.

Returns
  The current position in bytes.

## ◆ readData()

qint64 RtpAudioFile::readData | ( | char * | data,
|  | qint64 | maxSize )
| override protected

Reads up to maxSize bytes of data into the given buffer.

Parameters

  data | Pointer to the buffer to store read data.
  maxSize | Maximum number of bytes to read.

Returns
  The number of bytes read.

## ◆ readFrameSamples()

bool RtpAudioFile::readFrameSamples | ( | int32_t * | read_buff_bytes,
|  | SAMPLE ** | read_buff,
|  | uint32_t * | read_len,
|  | uint32_t * | frame_num,
|  | rtp_frame_type * | type )

Reads samples for a single frame.

Parameters

  read_buff_bytes | Pointer to store the number of bytes read into the buffer.
  read_buff | Pointer to the buffer containing the read samples.
  read_len | Pointer to store the number of samples read.
  frame_num | Pointer to store the frame number.
  type | Pointer to store the type of the frame.

Returns
  True if successful, false otherwise.

## ◆ readSample()

qint64 RtpAudioFile::readSample | ( | SAMPLE * | sample | ) |

Reads a single sample.

Parameters

  sample | Pointer to store the read sample.

Returns
  The number of bytes read.

## ◆ sampleFileSize()

qint64 RtpAudioFile::sampleFileSize | ( |  | ) |

Retrieves the underlying sample file size.

Returns
  The sample file size in bytes.

## ◆ seek()

bool RtpAudioFile::seek | ( | qint64 | off | ) |
| override

Seeks to a specific byte offset.

Parameters

  off | The byte offset to seek to.

Returns
  True if successful, false otherwise.

## ◆ seekSample()

void RtpAudioFile::seekSample | ( | qint64 | samples | ) |

Seeks to a specific sample position.

Parameters

  samples | The sample index to seek to.

## ◆ setFrameReadStage()

void RtpAudioFile::setFrameReadStage | ( | qint64 | prepend_samples | ) |

Sets the file to the frame read stage.

Parameters

  prepend_samples | Number of samples to prepend.

## ◆ size()

qint64 RtpAudioFile::size | ( |  | ) | const
| override

Gets the size of the file.

Returns
  The size in bytes.

## ◆ writeData()

qint64 RtpAudioFile::writeData | ( | const char * | data,
|  | qint64 | maxSize )
| override protected

Writes up to maxSize bytes of data from the given buffer.

Parameters

  data | Pointer to the data to write.
  maxSize | Maximum number of bytes to write.

Returns
  The number of bytes written.

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

- /builds/wireshark/wireshark/ui/qt/utils/rtp_audio_file.h
- /builds/wireshark/wireshark/ui/qt/utils/rtp_audio_file.cpp