mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
sip: media-pipeline: Allow pausing pipeline
We want to pause a pipeline in the multi call scenario.
This commit is contained in:
parent
3523403a0c
commit
86e76380c2
2 changed files with 18 additions and 4 deletions
|
@ -822,11 +822,24 @@ calls_sip_media_pipeline_stop (CallsSipMediaPipeline *self)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
calls_sip_media_pipeline_pause (CallsSipMediaPipeline *self)
|
calls_sip_media_pipeline_pause (CallsSipMediaPipeline *self,
|
||||||
|
gboolean pause)
|
||||||
{
|
{
|
||||||
g_return_if_fail (CALLS_IS_SIP_MEDIA_PIPELINE (self));
|
g_return_if_fail (CALLS_IS_SIP_MEDIA_PIPELINE (self));
|
||||||
|
|
||||||
g_debug ("Pause/unpause media pipeline");
|
if (self->is_running != pause)
|
||||||
self->is_running = FALSE;
|
return;
|
||||||
|
|
||||||
|
g_debug ("%s media pipeline", self->is_running ?
|
||||||
|
"Pausing" :
|
||||||
|
"Unpausing");
|
||||||
|
gst_element_set_state (self->recv_pipeline, self->is_running ?
|
||||||
|
GST_STATE_PAUSED :
|
||||||
|
GST_STATE_PLAYING);
|
||||||
|
gst_element_set_state (self->send_pipeline, self->is_running ?
|
||||||
|
GST_STATE_PAUSED :
|
||||||
|
GST_STATE_PLAYING);
|
||||||
|
|
||||||
|
self->is_running = !self->is_running;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ G_DECLARE_FINAL_TYPE (CallsSipMediaPipeline, calls_sip_media_pipeline, CALLS, SI
|
||||||
CallsSipMediaPipeline* calls_sip_media_pipeline_new (MediaCodecInfo *codec);
|
CallsSipMediaPipeline* calls_sip_media_pipeline_new (MediaCodecInfo *codec);
|
||||||
void calls_sip_media_pipeline_start (CallsSipMediaPipeline *self);
|
void calls_sip_media_pipeline_start (CallsSipMediaPipeline *self);
|
||||||
void calls_sip_media_pipeline_stop (CallsSipMediaPipeline *self);
|
void calls_sip_media_pipeline_stop (CallsSipMediaPipeline *self);
|
||||||
void calls_sip_media_pipeline_pause (CallsSipMediaPipeline *self);
|
void calls_sip_media_pipeline_pause (CallsSipMediaPipeline *self,
|
||||||
|
gboolean pause);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Reference in a new issue