From 1eea63076c9c2b7e2529fd262665cd6a4b884e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sun, 17 Nov 2024 11:30:47 +0100 Subject: [PATCH] clapper: Add a function to get pipeline graph data --- src/lib/clapper/clapper-player.c | 22 ++++++++++++++++++++++ src/lib/clapper/clapper-player.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/src/lib/clapper/clapper-player.c b/src/lib/clapper/clapper-player.c index 52f4e22c..25dd952b 100644 --- a/src/lib/clapper/clapper-player.c +++ b/src/lib/clapper/clapper-player.c @@ -2186,6 +2186,28 @@ clapper_player_add_feature (ClapperPlayer *self, ClapperFeature *feature) clapper_features_manager_add_feature (self->features_manager, feature, GST_OBJECT (self)); } +/** + * clapper_player_make_pipeline_graph: + * @player: a #ClapperPlayer + * @details: a #GstDebugGraphDetails level + * + * Make current #GStreamer pipeline graph in `graphviz` dot format. + * + * Applications can use tools like `graphviz` to display returned + * data or just save it to a file as-is for the user to do it manually. + * + * Returns: (transfer full): current pipeline description in dot format. + * + * Since: 0.8 + */ +gchar * +clapper_player_make_pipeline_graph (ClapperPlayer *self, GstDebugGraphDetails details) +{ + g_return_val_if_fail (CLAPPER_IS_PLAYER (self), NULL); + + return gst_debug_bin_to_dot_data (GST_BIN (self->playbin), details); +} + static void clapper_player_thread_start (ClapperThreadedObject *threaded_object) { diff --git a/src/lib/clapper/clapper-player.h b/src/lib/clapper/clapper-player.h index c47b1a78..48547168 100644 --- a/src/lib/clapper/clapper-player.h +++ b/src/lib/clapper/clapper-player.h @@ -204,4 +204,7 @@ void clapper_player_seek_custom (ClapperPlayer *player, gdouble position, Clappe CLAPPER_API void clapper_player_add_feature (ClapperPlayer *player, ClapperFeature *feature); +CLAPPER_API +gchar * clapper_player_make_pipeline_graph (ClapperPlayer *player, GstDebugGraphDetails details); + G_END_DECLS