![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <types.h>

Classes | |
| struct | channel |
Public Member Functions | |
| audio_frame2 ()=default | |
| audio_frame2 (audio_frame2 &&)=default | |
| audio_frame2 (audio_frame2 const &)=delete | |
| audio_frame2 (const struct audio_frame *) | |
| creates audio_frame2 from POD audio_frame | |
| ~audio_frame2 ()=default | |
| void | append (audio_frame2 const &frame) |
| void | append (int channel, const char *data, size_t length) |
| void | change_bps (int new_bps) |
| int | get_bps () const |
| int | get_channel_count () const |
| audio_codec_t | get_codec () const |
| char * | get_data (int channel) |
| const char * | get_data (int channel) const |
| size_t | get_data_len () const |
| size_t | get_data_len (int channel) const |
| struct audio_desc | get_desc () const |
| double | get_duration () const |
| fec_desc const & | get_fec_params (int channel) const |
| int | get_sample_count () const |
| int | get_sample_rate () const |
| int64_t | get_timestamp () const |
| bool | has_same_prop_as (audio_frame2 const &frame) const |
| void | init (int nr_channels, audio_codec_t codec, int bps, int sample_rate) |
| Initializes audio_frame2 for use. If already initialized, data are dropped. | |
| operator bool () const | |
| audio_frame2 & | operator= (audio_frame2 &&)=default |
| audio_frame2 & | operator= (audio_frame2 const &)=delete |
| void | replace (int channel, size_t offset, const char *data, size_t length) |
| replaces portion of data of specified channel. If the size of the channel is not sufficient, it is extended and old data are copied. | |
| bool | resample (audio_frame2_resampler &resampler_state, int new_sample_rate) |
| std::tuple< bool, audio_frame2 > | resample_fake (audio_frame2_resampler &resampler_state, int new_sample_rate_num, int new_sample_rate_den) |
| @ resamples to new sample rate while keeping nominal sample rate intact | |
| void | reserve (size_t len) |
| void | reset () |
| void | resize (int channel, size_t len) |
| void | set_duration (double duration) |
| void | set_fec_params (int channel, fec_desc const &) |
| void | set_timestamp (int64_t ts) |
Static Public Member Functions | |
| static audio_frame2 | copy_with_bps_change (audio_frame2 const &frame, int new_bps) |
Private Member Functions | |
| void | reserve (int channel, size_t len) |
Private Attributes | |
| std::vector< channel > | channels |
| struct audio_desc | desc = {} |
| desc.ch_count not set, use channels.size() instead | |
| double | duration = 0.0 |
| for compressed formats where this cannot be directly determined from samples/sample_rate | |
| int64_t | timestamp = -1 |
Friends | |
| class | audio_frame2_resampler |
| class | soxr_resampler |
| class | speex_resampler |
More versatile than audio_frame
Can hold also compressed audio data. Audio channels are non-interleaved.
|
default |
|
default |
|
delete |
|
default |
|
explicit |
creates audio_frame2 from POD audio_frame
Definition at line 87 of file types.cpp.
References AC_PCM, audio_desc::bps, audio_frame::bps, audio_frame::ch_count, channels, audio_desc::codec, audio_frame::data, audio_frame::data_len, demux_channel(), desc, audio_frame::flags, resize(), audio_desc::sample_rate, audio_frame::sample_rate, and TIMESTAMP_VALID.

| void audio_frame2::append | ( | audio_frame2 const & | frame | ) |
Definition at line 125 of file types.cpp.
References append(), audio_desc::bps, channels, desc, get_data(), get_data_len(), and audio_desc::sample_rate.
Referenced by append(), audio_codec_compress(), audio_codec_decompress(), decode_audio_frame(), decode_audio_frame_mulaw(), rs::encode(), and process_statistics().

| void audio_frame2::append | ( | int | channel, |
| const char * | data, | ||
| size_t | length ) |
| void audio_frame2::change_bps | ( | int | new_bps | ) |
Definition at line 313 of file types.cpp.
References audio_desc::bps, change_bps(), channels, desc, get_bps(), get_data(), and get_data_len().
Referenced by audio_sender_thread(), change_bps(), copy_with_bps_change(), and decode_audio_frame().

|
staticnodiscard |
Definition at line 298 of file types.cpp.
References change_bps(), channels, frame, and init().

|
nodiscard |
Definition at line 200 of file types.cpp.
References audio_desc::bps, and desc.
Referenced by audio_codec_compress(), audio_codec_decompress(), audio_sender_thread(), change_bps(), decode_audio_frame(), decode_audio_frame_mulaw(), rs::encode(), get_sample_count(), and process_statistics().
|
nodiscard |
Definition at line 260 of file types.cpp.
References channels.
Referenced by audio_tx_send(), audio_tx_send_standard(), decode_audio_frame(), decode_audio_frame_mulaw(), rs::encode(), get_data_len(), process_statistics(), and validate_std_audio().
|
nodiscard |
Definition at line 213 of file types.cpp.
References audio_desc::codec, and desc.
Referenced by audio_tx_send_standard(), decode_audio_frame(), rs::encode(), process_statistics(), and validate_std_audio().
|
nodiscard |
Definition at line 218 of file types.cpp.
References channels.
Referenced by append(), audio_codec_decompress(), audio_tx_send_chan(), audio_tx_send_standard(), change_bps(), decode_audio_frame(), and rs::encode().
|
nodiscard |
|
nodiscard |
Returns length of all channels in bytes
Definition at line 236 of file types.cpp.
References get_channel_count(), get_data_len(), and len.
Referenced by change_bps(), and get_data_len().

|
nodiscard |
Definition at line 228 of file types.cpp.
References channels.
Referenced by append(), audio_codec_decompress(), audio_tx_send_chan(), audio_tx_send_standard(), decode_audio_frame(), rs::encode(), and validate_std_audio().
| struct audio_desc audio_frame2::get_desc | ( | ) | const |
Definition at line 205 of file types.cpp.
References audio_desc::ch_count, and desc.
Referenced by set_audio_spec_to_vrxtx().
|
nodiscard |
Definition at line 246 of file types.cpp.
References AC_PCM, audio_desc::codec, desc, duration, get_sample_count(), and get_sample_rate().
Referenced by audio_tx_send_standard().

|
nodiscard |
|
nodiscard |
Definition at line 265 of file types.cpp.
References AC_PCM, channels, audio_desc::codec, desc, and get_bps().
Referenced by get_duration().

|
nodiscard |
Definition at line 275 of file types.cpp.
References desc, and audio_desc::sample_rate.
Referenced by audio_codec_compress(), audio_codec_decompress(), audio_sender_thread(), audio_tx_send_standard(), decode_audio_frame(), rs::encode(), get_duration(), and process_statistics().
|
nodiscard |
Definition at line 340 of file types.cpp.
References timestamp.
Referenced by audio_tx_send(), and decode_audio_frame().
|
nodiscard |
Definition at line 280 of file types.cpp.
References audio_desc::bps, channels, audio_desc::codec, desc, frame, and audio_desc::sample_rate.
Referenced by process_statistics().
| void audio_frame2::init | ( | int | nr_channels, |
| audio_codec_t | codec, | ||
| int | bps, | ||
| int | sample_rate ) |
Initializes audio_frame2 for use. If already initialized, data are dropped.
Definition at line 115 of file types.cpp.
References audio_desc::bps, channels, audio_desc::codec, desc, and audio_desc::sample_rate.
Referenced by audio_codec_compress(), audio_codec_decompress(), audio_decoder_reconfigure(), copy_with_bps_change(), decode_audio_frame(), decode_audio_frame_mulaw(), rs::encode(), and process_statistics().
|
explicit |
|
default |
|
delete |
| void audio_frame2::replace | ( | int | channel, |
| size_t | offset, | ||
| const char * | data, | ||
| size_t | length ) |
replaces portion of data of specified channel. If the size of the channel is not sufficient, it is extended and old data are copied.
Definition at line 152 of file types.cpp.
References channels, offset, and resize().
Referenced by audio_fec_decode(), and decode_audio_frame().

| bool audio_frame2::resample | ( | audio_frame2_resampler & | resampler_state, |
| int | new_sample_rate ) |
| resampler_state | opaque state that can holds resampler that dosn't need to be reinitalized during calls on various audio frames. It reinitializes itself when needed (when source or new sample rate changes). Therefore, it is very recommended to use it only in a stream that may change sometimes but do not eg. share it between two streams that has different properties. |
| false | if SpeexDSP was not compiled in |
Definition at line 361 of file types.cpp.
References desc, LOG, LOG_LEVEL_WARNING, resample_fake(), and audio_desc::sample_rate.
Referenced by audio_sender_thread(), and decode_audio_frame().

| tuple< bool, audio_frame2 > audio_frame2::resample_fake | ( | audio_frame2_resampler & | resampler_state, |
| int | new_sample_rate_num, | ||
| int | new_sample_rate_den ) |
@ resamples to new sample rate while keeping nominal sample rate intact
Definition at line 342 of file types.cpp.
References audio_desc::bps, channels, desc, len, audio_frame2_resampler::resample(), and audio_desc::sample_rate.
Referenced by decode_audio_frame(), and resample().

|
private |
| void audio_frame2::reserve | ( | size_t | length | ) |
Reserves data for every channel with the specified length.
Definition at line 161 of file types.cpp.
References channels, and reserve().
Referenced by append(), audio_decoder_reconfigure(), rs::encode(), reserve(), and resize().

| void audio_frame2::reset | ( | ) |
| void audio_frame2::resize | ( | int | channel, |
| size_t | length ) |
Changes actual size of channel.
Definition at line 183 of file types.cpp.
References channels, and reserve().
Referenced by audio_frame2(), audio_codec_decompress(), decode_audio_frame(), rs::encode(), and replace().

| void audio_frame2::set_duration | ( | double | duration | ) |
Definition at line 288 of file types.cpp.
Referenced by audio_codec_compress().
| void audio_frame2::set_fec_params | ( | int | channel, |
| fec_desc const & | fec_params ) |
Definition at line 293 of file types.cpp.
References channels, and video_frame::fec_params.
Referenced by rs::encode().
| void audio_frame2::set_timestamp | ( | int64_t | ts | ) |
Definition at line 335 of file types.cpp.
Referenced by audio_codec_compress(), audio_codec_decompress(), and decode_audio_frame().
|
friend |
|
private |
Definition at line 208 of file types.h.
Referenced by audio_frame2(), append(), append(), change_bps(), copy_with_bps_change(), get_channel_count(), get_data(), get_data(), get_data_len(), get_fec_params(), get_sample_count(), has_same_prop_as(), init(), replace(), resample_fake(), reserve(), reserve(), reset(), resize(), and set_fec_params().
|
private |
desc.ch_count not set, use channels.size() instead
Definition at line 207 of file types.h.
Referenced by audio_frame2(), append(), change_bps(), get_bps(), get_codec(), get_duration(), get_sample_count(), get_sample_rate(), has_same_prop_as(), init(), resample(), and resample_fake().
|
private |
for compressed formats where this cannot be directly determined from samples/sample_rate
Definition at line 209 of file types.h.
Referenced by get_duration().
|
private |
Definition at line 210 of file types.h.
Referenced by get_timestamp(), and set_timestamp().