|
pianod2
multisource multiuser scriptable networked music player
|
Play media or a stream using gstreamer. More...
#include <gstreamplayer.h>


Public Member Functions | |
| GstreamerPlayer (const AudioSettings &audio_settings, const std::string &media_url, float initial_audio_gain) | |
| Play a media file or URL using gstreamer. More... | |
| virtual | ~GstreamerPlayer () |
Public Member Functions inherited from Audio::GstreamerReaderWithBus | |
| GstreamerReaderWithBus (const std::string &media_url, int timeout) | |
| virtual | ~GstreamerReaderWithBus () |
Public Member Functions inherited from Audio::GstreamerMediaReader | |
| GstreamerMediaReader (const std::string &media_url, int timeout=15) | |
| Base abstract class for reading a media file or URL using gstreamer. More... | |
Public Member Functions inherited from Audio::GstreamerDoublePipeline | |
| GstreamerDoublePipeline ()=default | |
| virtual | ~GstreamerDoublePipeline ()=default |
Public Member Functions inherited from Audio::GstreamerSimplePipeline | |
| GstreamerSimplePipeline () | |
| virtual | ~GstreamerSimplePipeline () |
Public Member Functions inherited from Media::Player | |
| virtual | ~Player (void) |
| virtual float | playRemaining (void) const |
| Seconds left in playback, or a negative number if unknown. More... | |
| bool | ready (void) const |
| Indicate if player has finished initializing. More... | |
| bool | playbackComplete (void) const |
| Indicate if playback is complete and ready for cleanup. More... | |
| virtual time_t | getPauseTimeout (void) |
| When paused, get the time at which the song will expire. More... | |
Private Member Functions | |
| virtual void | pause (void) override |
| Pause playback. If already paused, do nothing. More... | |
| virtual void | abort (void) override |
| Don't play the rest of the song. More... | |
| virtual void | cue (void) override |
| Starts thread in paused mode. More... | |
| virtual void | play (void) override |
| Start playback or resume playback if paused. If already playing, continue. More... | |
| virtual RESPONSE_CODE | completionStatus (void) override |
| virtual void | setVolume (float volume) override |
| Adjust volume in decibels. More... | |
| virtual State | currentState (void) const override |
| virtual float | trackDuration (void) const override |
| Length of track in seconds, or a negative number if unknown. More... | |
| virtual float | playPoint (void) const override |
| Seconds from start, or a negative value if unknown. More... | |
Private Attributes | |
| AudioSettings | audio |
| Output settings. More... | |
| GstElement * | replay_gainer = nullptr |
| Apply replay gain as necessary. More... | |
| GstElement * | volume_filter = nullptr |
| Make volume adjustments. 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 | |
Public Types inherited from Media::Player | |
| enum | State { DoesNotExist , Initializing , Cueing , Playing , Done } |
Static Public Member Functions inherited from Media::Player | |
| static Media::Player * | getPlayer (const AudioSettings &settings, const std::string &media_url, float initial_gain) |
| Get the a media player currently compiled in the code. More... | |
Protected Member Functions inherited from Audio::GstreamerReaderWithBus | |
| virtual bool | notification (GstMessage *message) |
Protected Member Functions inherited from Audio::GstreamerDoublePipeline | |
| void | push (GstElement *item) |
| Push an output element into the filter graph. More... | |
| void | pushSource (GstElement *item) |
| Wire an element to the end of the source pipeline/filter graph. 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::GstreamerMediaReader | |
| const bool | is_network = false |
| True if media is network streaming. More... | |
| const std::string | url |
| Media URL or filename. More... | |
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< GstreamerAudioException > | pipeline_exception |
| Asynchronous exception. More... | |
Play media or a stream using gstreamer.
| Audio::GstreamerPlayer::GstreamerPlayer | ( | const AudioSettings & | audio_settings, |
| const std::string & | media_url, | ||
| float | initial_audio_gain | ||
| ) |
Play a media file or URL using gstreamer.
| audio_settings | Describe the output device. |
| media_url | The filename or URL of the media. |
| initial_audio_gain | Gain to apply when playing file, in decibels. If ReplayGain is encountered during playback, that is preferred over this value. |

|
virtual |
|
overrideprivatevirtual |
Don't play the rest of the song.
Implements Media::Player.

|
overrideprivatevirtual |
Implements Media::Player.
|
overrideprivatevirtual |
|
overrideprivatevirtual |
|
overrideprivatevirtual |
Pause playback. If already paused, do nothing.
Implements Media::Player.

|
overrideprivatevirtual |
Start playback or resume playback if paused. If already playing, continue.
Implements Media::Player.

|
overrideprivatevirtual |
Seconds from start, or a negative value if unknown.
Implements Media::Player.

|
overrideprivatevirtual |
Adjust volume in decibels.
Implements Media::Player.
|
overrideprivatevirtual |
Length of track in seconds, or a negative number if unknown.
Implements Media::Player.

|
private |
Output settings.
|
private |
Convert audio to required format for output.
|
private |
Send audio to somewhere.
|
private |
Apply replay gain as necessary.
|
private |
Make volume adjustments.