Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::AudioStream Class Reference

#include <audiostream.h>

Collaboration diagram for jami::AudioStream:
Collaboration graph

Public Types

using OnData = std::function< void(size_t)>
 
using OnReady = std::function< void()>
 

Public Member Functions

 AudioStream (pa_context *, pa_threaded_mainloop *, const char *, AudioDeviceType, unsigned, pa_sample_format_t, const PaDeviceInfos &, bool, OnReady onReady, OnData onData)
 Constructor.
 
uint8_t channels () const
 
AudioFormat format () const
 
size_t frameSize () const
 
std::string getDeviceName () const
 
bool isReady ()
 
size_t sampleSize () const
 
const pa_sample_specsampleSpec () const
 
void setEchoCancelCb (std::function< void(bool)> &&cb)
 
void start ()
 
void stop ()
 
pa_streamstream ()
 Accessor: Get the pulseaudio stream object.
 
 ~AudioStream ()
 

Detailed Description

Definition at line 60 of file audiostream.h.

Member Typedef Documentation

◆ OnData

Definition at line 64 of file audiostream.h.

◆ OnReady

Definition at line 63 of file audiostream.h.

Constructor & Destructor Documentation

◆ AudioStream()

jami::AudioStream::AudioStream ( pa_context c,
pa_threaded_mainloop m,
const char desc,
AudioDeviceType  type,
unsigned  samplrate,
pa_sample_format_t  format,
const PaDeviceInfos infos,
bool  ec,
OnReady  onReady,
OnData  onData 
)

Constructor.

Parameters
contextpulseaudio's application context.
mainlooppulseaudio's main loop
description
types
audiosampling rate
pointerto pa_source_info or pa_sink_info (depending on type).
trueif echo cancelling should be used with this stream

Definition at line 30 of file audiostream.cpp.

References jami::CAPTURE, jami::PaDeviceInfos::channel_map, jami::emitSignal(), format(), JAMI_DEBUG, JAMI_ERR, jami::PaDeviceInfos::name, jami::PLAYBACK, and jami::RINGTONE.

Here is the call graph for this function:

◆ ~AudioStream()

jami::AudioStream::~AudioStream ( )

Definition at line 153 of file audiostream.cpp.

References stop().

Here is the call graph for this function:

Member Function Documentation

◆ channels()

uint8_t jami::AudioStream::channels ( ) const
inline

Definition at line 104 of file audiostream.h.

References sampleSpec().

Here is the call graph for this function:

◆ format()

AudioFormat jami::AudioStream::format ( ) const
inline

Definition at line 106 of file audiostream.h.

References jami::sampleFormatFromPulse(), and sampleSpec().

Referenced by AudioStream().

Here is the call graph for this function:

◆ frameSize()

size_t jami::AudioStream::frameSize ( ) const
inline

Definition at line 102 of file audiostream.h.

References jami::emitSignal(), and sampleSpec().

Here is the call graph for this function:

◆ getDeviceName()

std::string jami::AudioStream::getDeviceName ( ) const
inline

Definition at line 112 of file audiostream.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ isReady()

bool jami::AudioStream::isReady ( )

Definition at line 284 of file audiostream.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ sampleSize()

size_t jami::AudioStream::sampleSize ( ) const
inline

Definition at line 101 of file audiostream.h.

References jami::emitSignal(), and sampleSpec().

Here is the call graph for this function:

◆ sampleSpec()

const pa_sample_spec * jami::AudioStream::sampleSpec ( ) const
inline

Definition at line 99 of file audiostream.h.

References jami::emitSignal().

Referenced by channels(), format(), frameSize(), and sampleSize().

Here is the call graph for this function:

◆ setEchoCancelCb()

void jami::AudioStream::setEchoCancelCb ( std::function< void(bool)> &&  cb)
inline

Definition at line 122 of file audiostream.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ start()

void jami::AudioStream::start ( )

Definition at line 159 of file audiostream.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ stop()

void jami::AudioStream::stop ( )

Definition at line 168 of file audiostream.cpp.

References jami::destroyStream(), jami::disconnectStream(), jami::emitSignal(), and JAMI_DBG.

Referenced by ~AudioStream().

Here is the call graph for this function:

◆ stream()

pa_stream * jami::AudioStream::stream ( )
inline

Accessor: Get the pulseaudio stream object.

Returns
pa_stream* The stream

Definition at line 97 of file audiostream.h.


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