GStreamer Daemon - Flush start/Flush stop

From RidgeRun Developer Wiki



Previous: Seek Index Next: Receiving Signals




This wiki shows how to send a flush event to a given pipeline. Sometimes it is important to flush a current pipeline and then restart the flushing pipeline.

Sending an flush start event

Elements should unlock functions when some function is blocked once the event is received with a success code. This event flush all queued data in the pipeline for new media play.

A new flush start event is sent to a pipeline using the command shown below.

event_flush_start pipeline 
       Creates a new flush start event and sends it to pipeline.

Sending an flush stop event

Allocate a new flush stop event. This event should send after a flush start event, to able the pad and receives data. When this event is completed sends a seek and resume dataflow.

A new flush stop event is sent to a pipeline using the command shown below.

event_flush_stop pipeline reset=true 
       Creates a new flush stop event and sends it to pipeline.


For example:
Gstd Commands:

pipeline_create p1 videotestsrc ! autovideosink
pipeline_play p1
event_flush_start p1 
event_flush_stop p1 true 
pipeline_stop p1
pipeline_play p1

will respectively

  1. Create a pipeline p1
  2. Put it to playing
  3. Send a flush start event to it
  4. Send a flush stop event to it
  5. Put it to stop p1
  6. Put it to playing

The event_flush command will typically fail for any of the following:

  • No pipeline was given
  • The given pipeline doesn't exist
  • Wrong flush event property

Alternatively, a pipeline can be created using the low level CRUD syntax:
Gstd Commands:

create /pipelines/p1/event flush_start 
create /pipelines/p1/event flush_stop true



API Summary

High Level Command Low Level CRUD Description
event_flush_start <pipeline> create /pipelines/<name>/event flush_start Put the pipeline in flushing mode
event_flush_stop <pipeline> <reset=true> create /pipelines/<name>/event flush_stop <reset=true> Take the pipeline out of flushing mode


Previous: Seek Index Next: Receiving Signals