pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Private Attributes | List of all members
Audio::GstreamerOutput Class Reference

Audio output class utilizing gstreamer for output. More...

#include <gstreamplayer.h>

Inheritance diagram for Audio::GstreamerOutput:
Inheritance graph
[legend]
Collaboration diagram for Audio::GstreamerOutput:
Collaboration graph
[legend]

Public Member Functions

 GstreamerOutput (const AudioSettings &settings, const AudioFormat &format)
 
virtual bool play (void *buffer, unsigned numberOfBytes) override
 Play output. More...
 
- Public Member Functions inherited from Audio::Output
virtual ~Output ()
 
char bytesPerSample ()
 
- Public Member Functions inherited from Audio::GstreamerSimplePipeline
 GstreamerSimplePipeline ()
 
virtual ~GstreamerSimplePipeline ()
 

Private Attributes

AudioSettings audio
 Output settings. More...
 
GstElement * application_source = nullptr
 Element for application to push data into. More...
 
GstElement * format_converter = nullptr
 Convert audio to required format for output. More...
 
GstElement * output_device = nullptr
 Send audio to somewhere. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Audio::Output
static bool isValidOutput (const AudioSettings &settings)
 Check if audio settings are valid. More...
 
static bool outputCanCrossfade (const AudioSettings &settings)
 Check if audio settings are valid. More...
 
static OutputgetOutput (const AudioSettings &settings, const AudioFormat &format)
 Factory gets whatever kind of output is best, or requested by the audio settings. More...
 
static void reportLibrariesAndVersions (int verbose)
 Report audio libraries in use, and their versions. More...
 
- Protected Member Functions inherited from Audio::GstreamerSimplePipeline
void add (GstElement *element)
 
void throwDeferredException (const GstreamerAudioException &exception, bool asynchronously=false) const
 "Throw" an exception from an asyncrhonous player thread. More...
 
void throwAsyncException (const GstreamerAudioException &exception)
 
void push (GstElement *item)
 Wire an item to the pipeline/filter graph. More...
 
GstElement * createElement (const char *name, const std::string &overrides="")
 Create a gstreamer element and add it to the pipeline/bin, unwired. More...
 
GstState currentPipelineState () const
 Query the pipeline's current state. More...
 
void setPipelineState (GstState state)
 Set the pipeline's state. More...
 
- Protected Attributes inherited from Audio::Output
char bytes_per_sample_set
 
- Protected Attributes inherited from Audio::GstreamerSimplePipeline
GstElement * pipeline
 Filter graph for elements. More...
 
GstElement * chain_start = nullptr
 First item pushed on the stream after setup. More...
 
GstElement * pipeline_last = nullptr
 Last item pushed on the stream. More...
 
std::recursive_mutex state_mutex
 
std::unique_ptr< GstreamerAudioExceptionpipeline_exception
 Asynchronous exception. More...
 

Detailed Description

Audio output class utilizing gstreamer for output.

Constructor & Destructor Documentation

◆ GstreamerOutput()

Audio::GstreamerOutput::GstreamerOutput ( const AudioSettings settings,
const AudioFormat format 
)
Here is the call graph for this function:

Member Function Documentation

◆ play()

bool Audio::GstreamerOutput::play ( void *  buffer,
unsigned  number_of_bytes 
)
overridevirtual

Play output.

Parameters
bufferThe samples, in packed (interleaved) format if multichannel.
number_of_bytesSize of the buffer; number of samples is determined by the audio format set when opening the channel.

Implements Audio::Output.

Here is the call graph for this function:

Member Data Documentation

◆ application_source

GstElement* Audio::GstreamerOutput::application_source = nullptr
private

Element for application to push data into.

◆ audio

AudioSettings Audio::GstreamerOutput::audio
private

Output settings.

◆ format_converter

GstElement* Audio::GstreamerOutput::format_converter = nullptr
private

Convert audio to required format for output.

◆ output_device

GstElement* Audio::GstreamerOutput::output_device = nullptr
private

Send audio to somewhere.


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