#include <BufferForwarder.hpp>
Public Member Functions | |
BufferForwarder () noexcept | |
bool | start () override |
bool | stop () override |
void | forward (Vsdk::Audio::Buffer buffer, bool last) |
Dumps the buffer into the pipeline. | |
void | stream (Vsdk::Audio::Buffer buffer, bool last, std::size_t bufferSize) |
Synchronously streams the buffer into the pipeline at a rate of sample rate × channel count bytes per second. | |
void | setAccelerationRate (double rate) |
Sets acceleration rate. Cannot be less than 1.0 . | |
Public Member Functions inherited from Vsdk::Audio::ProducerModule | |
virtual | ~ProducerModule ()=0 |
auto | subscribeFirst (AudioCallback c) -> Iterator |
Subscribes as first in the list of audio buffer receivers for this producer. | |
auto | subscribeLast (AudioCallback c) -> Iterator |
Subscribes as last in the list of audio buffer receivers for this producer. | |
void | unsubscribe (Iterator it) |
Unsubscribes from this producer audio buffer dispatch list. | |
virtual bool | open () |
virtual bool | run () |
virtual bool | start () |
virtual bool | stop () |
virtual bool | resume () |
Non-blocking call. | |
virtual bool | close () |
auto | lastError () const -> std::string const & |
Additional Inherited Members | |
Public Types inherited from Vsdk::Audio::ProducerModule | |
using | Iterator = details::Iterator< decltype(_subscribers)> |
Iterator pointing to a subscriber of this producer. | |
Static Public Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< BufferForwarder > | |
static auto | make (Args &&... args) -> std::shared_ptr< BufferForwarder > |
Protected Member Functions inherited from Vsdk::Audio::ProducerModuleImpl< BufferForwarder > | |
ProducerModuleImpl ()=default | |
Protected Member Functions inherited from Vsdk::Audio::ProducerModule | |
ProducerModule ()=default | |
template<typename... Args> | |
void | setLastError (char const *fmt, Args &&... args) |
void | setLastError (std::string error) |
void | dispatchBuffer (Buffer buffer, bool last) |
template<typename T > | |
void | dispatchAudio (T &&data, int sampleRate, int channelCount, bool isLast) |
|
noexcept |
|
overridevirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
|
overridevirtual |
Reimplemented from Vsdk::Audio::ProducerModule.
void BufferForwarder::forward | ( | Vsdk::Audio::Buffer | buffer, |
bool | last | ||
) |
Dumps the buffer
into the pipeline.
void BufferForwarder::stream | ( | Vsdk::Audio::Buffer | buffer, |
bool | last, | ||
std::size_t | bufferSize | ||
) |
Synchronously streams the buffer
into the pipeline at a rate of sample rate × channel count
bytes per second.
buffer | If zero or >= buffer.size() , is equivalent to a call to forward(). If its value is >= sample rate × channel count , more than a second will be spent sleeping before the next audio dispatch is done |
void BufferForwarder::setAccelerationRate | ( | double | rate | ) |
Sets acceleration rate. Cannot be less than 1.0
.