Base class for gstreamer pipelines.
More...
#include <gstreamplayer.h>
Base class for gstreamer pipelines.
◆ GstreamerSimplePipeline()
| Audio::GstreamerSimplePipeline::GstreamerSimplePipeline |
( |
| ) |
|
◆ ~GstreamerSimplePipeline()
| Audio::GstreamerSimplePipeline::~GstreamerSimplePipeline |
( |
| ) |
|
|
virtual |
◆ add()
| void Audio::GstreamerSimplePipeline::add |
( |
GstElement * |
element | ) |
|
|
protected |
◆ createElement()
| GstElement * Audio::GstreamerSimplePipeline::createElement |
( |
const char * |
name, |
|
|
const std::string & |
overrides = "" |
|
) |
| |
|
protected |
Create a gstreamer element and add it to the pipeline/bin, unwired.
- Parameters
-
| name | The name of the element. |
| overrides | A user-specified alternate element to use. |
- Returns
- Reference with constructed element.
- Exceptions
-
◆ currentPipelineState()
| GstState Audio::GstreamerSimplePipeline::currentPipelineState |
( |
| ) |
const |
|
protected |
Query the pipeline's current state.
◆ push()
| void Audio::GstreamerSimplePipeline::push |
( |
GstElement * |
item | ) |
|
|
protected |
Wire an item to the pipeline/filter graph.
Items are wired in the order they are pushed.
- Parameters
-
| item | The item to insert into to the pipeline. |
- Exceptions
-
◆ setPipelineState()
| void Audio::GstreamerSimplePipeline::setPipelineState |
( |
GstState |
state | ) |
|
|
protected |
Set the pipeline's state.
We need locking at this point, because the state may be set by a bus message or the pianod main thread. This creates a race condition where an error shuts it down, then pianod requests playback start/resume.
Furthermore, hammering state changes causes Gstreamer to become deranged and deadlock waiting on a condition variable. To avoid this, give the prior state transition a chance to complete.
But as a bonus, some elements only get to READY state; perhaps they need stream data to move on, but we're done and need to tear them down and move on. Whatever, the case, we occasionally need to go ahead with a state change, even if the last one is unfinished. Hence, we have a 1-second timeout for the last state change to finish, before proceeding recklessly with a state change.
- Parameters
-
◆ throwAsyncException()
◆ throwDeferredException()
| void Audio::GstreamerSimplePipeline::throwDeferredException |
( |
const GstreamerAudioException & |
exception, |
|
|
bool |
asynchronously = false |
|
) |
| const |
|
protected |
"Throw" an exception from an asyncrhonous player thread.
This stores a copy of the exception for throwing later, when getting the thread's completion status.
◆ chain_start
| GstElement* Audio::GstreamerSimplePipeline::chain_start = nullptr |
|
protected |
First item pushed on the stream after setup.
◆ pipeline
| GstElement* Audio::GstreamerSimplePipeline::pipeline |
|
protected |
◆ pipeline_exception
◆ pipeline_last
| GstElement* Audio::GstreamerSimplePipeline::pipeline_last = nullptr |
|
protected |
Last item pushed on the stream.
◆ state_mutex
| std::recursive_mutex Audio::GstreamerSimplePipeline::state_mutex |
|
mutableprotected |
The documentation for this class was generated from the following files: