mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-04 23:51:17 +00:00
sip: media-pipeline: Debug pipeline graph on SIGUSR2
Ust GST_DEBUG_BIN_TO_DOT_FILE to generate a dot graph of a pipeline for debugging purposes when SIGUSR2 is received. Note the same signal is also used within the dummy plugin to simulate an incoming call from an unknown number, so when testing you probably want either the sip plugin or the dummy plugin, but not both.
This commit is contained in:
parent
58f9f5cb62
commit
5d0ae4a6fa
1 changed files with 28 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "calls-sip-media-pipeline.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <glib-unix.h>
|
||||
#include <gst/gst.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
@ -842,11 +843,38 @@ calls_sip_media_pipeline_class_init (CallsSipMediaPipelineClass *klass)
|
|||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
usr2_handler (CallsSipMediaPipeline *self)
|
||||
{
|
||||
g_print ("playing: %d\n"
|
||||
"paused: %d\n"
|
||||
"stopped: %d\n"
|
||||
"target map: %d\n"
|
||||
"current state: %d\n",
|
||||
self->element_map_playing,
|
||||
self->element_map_paused,
|
||||
self->element_map_stopped,
|
||||
EL_ALL_RTP,
|
||||
self->state);
|
||||
|
||||
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (self->pipeline),
|
||||
GST_DEBUG_GRAPH_SHOW_ALL,
|
||||
"usr2-debug");
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_sip_media_pipeline_init (CallsSipMediaPipeline *self)
|
||||
{
|
||||
if (!gst_is_initialized ())
|
||||
gst_init (NULL, NULL);
|
||||
|
||||
/* Pipeline debugging */
|
||||
g_unix_signal_add (SIGUSR2,
|
||||
(GSourceFunc) usr2_handler,
|
||||
self);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue