2004-01-20 14:09:42 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
* 2004 Thomas Vander Stichele <thomas@apestaart.org>
|
2018-10-27 17:06:20 +00:00
|
|
|
* 2018 Collabora Ltd.
|
2004-01-20 14:09:42 +00:00
|
|
|
*
|
|
|
|
* gst-inspect.c: tool to inspect the GStreamer registry
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2004-01-20 14:09:42 +00:00
|
|
|
*/
|
|
|
|
|
2003-06-29 14:05:49 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-09-25 19:21:09 +00:00
|
|
|
/* FIXME 2.0: suppress warnings for deprecated API such as GValueArray
|
2012-07-08 18:15:33 +00:00
|
|
|
* with newer GLib versions (>= 2.31.0) */
|
|
|
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
|
2006-05-05 17:07:42 +00:00
|
|
|
#include "tools.h"
|
2017-10-20 11:02:35 +00:00
|
|
|
#include <gst/gst_private.h> /* for internal Factories */
|
2004-02-03 11:23:59 +00:00
|
|
|
|
2001-01-04 10:47:39 +00:00
|
|
|
#include <string.h>
|
2004-02-03 11:23:59 +00:00
|
|
|
#include <locale.h>
|
2004-06-14 11:04:06 +00:00
|
|
|
#include <glib/gprintf.h>
|
2018-10-27 12:38:57 +00:00
|
|
|
#ifdef G_OS_UNIX
|
|
|
|
# include <unistd.h>
|
|
|
|
# include <sys/wait.h>
|
|
|
|
#endif
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2018-12-19 21:06:40 +00:00
|
|
|
#define DEFAULT_PAGER "less"
|
2018-11-22 22:01:38 +00:00
|
|
|
|
2019-01-24 18:52:46 +00:00
|
|
|
/* "R" : support color
|
|
|
|
* "X" : do not clear the screen when leaving the pager
|
|
|
|
* "F" : skip the pager if content fit into the screen
|
|
|
|
*/
|
|
|
|
#define DEFAULT_LESS_OPTS "RXF"
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
gboolean colored_output = TRUE;
|
|
|
|
|
2019-02-05 12:48:48 +00:00
|
|
|
#ifdef G_OS_UNIX
|
2019-01-08 12:23:44 +00:00
|
|
|
GPid child_pid = -1;
|
2019-02-05 12:48:48 +00:00
|
|
|
#endif
|
2019-01-08 12:23:44 +00:00
|
|
|
GMainLoop *loop = NULL;
|
|
|
|
|
2018-11-24 13:51:19 +00:00
|
|
|
/* Console colors */
|
|
|
|
|
|
|
|
/* Escape values for colors */
|
|
|
|
#define BLUE "\033[34m"
|
|
|
|
#define BRBLUE "\033[94m"
|
|
|
|
#define BRCYAN "\033[96m"
|
|
|
|
#define BRMAGENTA "\033[95m"
|
|
|
|
#define BRYELLOW "\033[33m"
|
|
|
|
#define CYAN "\033[36m"
|
|
|
|
#define GREEN "\033[32m"
|
|
|
|
#define MAGENTA "\033[35m"
|
|
|
|
#define YELLOW "\033[33m"
|
2018-10-27 17:06:20 +00:00
|
|
|
|
|
|
|
/* General colors */
|
|
|
|
#define RESET_COLOR (colored_output? "\033[0m": "")
|
2018-11-24 13:51:19 +00:00
|
|
|
#define HEADING_COLOR (colored_output? BRYELLOW : "")
|
2018-11-28 17:06:54 +00:00
|
|
|
#define PROP_NAME_COLOR (colored_output? BRBLUE : "")
|
2018-11-24 13:51:19 +00:00
|
|
|
#define PROP_VALUE_COLOR (colored_output? RESET_COLOR: "")
|
|
|
|
#define PROP_ATTR_NAME_COLOR (colored_output? BRYELLOW : "")
|
|
|
|
#define PROP_ATTR_VALUE_COLOR (colored_output? CYAN: "")
|
2018-10-27 17:06:20 +00:00
|
|
|
/* FIXME: find a good color that works on both dark & light bg. */
|
|
|
|
#define DESC_COLOR (colored_output? RESET_COLOR: "")
|
|
|
|
|
|
|
|
/* Datatype-related colors */
|
2018-11-24 13:51:19 +00:00
|
|
|
#define DATATYPE_COLOR (colored_output? GREEN : "")
|
2018-10-27 17:06:20 +00:00
|
|
|
#define CHILD_LINK_COLOR (colored_output? BRMAGENTA : "")
|
|
|
|
|
|
|
|
/* Caps colors */
|
2018-11-24 13:51:19 +00:00
|
|
|
#define FIELD_NAME_COLOR (colored_output? CYAN: "")
|
2018-11-28 17:06:54 +00:00
|
|
|
#define FIELD_VALUE_COLOR (colored_output? BRBLUE : "")
|
2018-10-27 17:06:20 +00:00
|
|
|
#define CAPS_TYPE_COLOR (colored_output? YELLOW : "")
|
|
|
|
#define STRUCT_NAME_COLOR (colored_output? YELLOW : "")
|
|
|
|
#define CAPS_FEATURE_COLOR (colored_output? GREEN : "")
|
|
|
|
|
|
|
|
/* Plugin listing colors */
|
2018-11-28 17:06:54 +00:00
|
|
|
#define PLUGIN_NAME_COLOR (colored_output? BRBLUE : "")
|
2018-11-24 13:51:19 +00:00
|
|
|
#define ELEMENT_NAME_COLOR (colored_output? GREEN : "")
|
|
|
|
/* FIXME: find a good color that works on both dark & light bg. */
|
|
|
|
#define ELEMENT_DETAIL_COLOR (colored_output? RESET_COLOR : "")
|
2018-10-27 17:06:20 +00:00
|
|
|
#define PLUGIN_FEATURE_COLOR (colored_output? BRBLUE: "")
|
|
|
|
|
|
|
|
/* Feature listing colors */
|
|
|
|
#define FEATURE_NAME_COLOR (colored_output? GREEN : "")
|
|
|
|
#define FEATURE_DIR_COLOR (colored_output? BRMAGENTA : "")
|
|
|
|
#define FEATURE_RANK_COLOR (colored_output? CYAN : "")
|
2018-11-24 13:51:19 +00:00
|
|
|
#define FEATURE_PROTO_COLOR (colored_output? BRYELLOW : "")
|
2018-10-27 17:06:20 +00:00
|
|
|
|
2007-10-15 07:11:04 +00:00
|
|
|
static char *_name = NULL;
|
2017-11-25 22:27:08 +00:00
|
|
|
static int indent = 0;
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2017-10-20 09:16:46 +00:00
|
|
|
static int print_element_info (GstPluginFeature * feature,
|
2004-06-14 11:04:06 +00:00
|
|
|
gboolean print_names);
|
2017-10-20 11:02:35 +00:00
|
|
|
static int print_typefind_info (GstPluginFeature * feature,
|
|
|
|
gboolean print_names);
|
|
|
|
static int print_tracer_info (GstPluginFeature * feature, gboolean print_names);
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
#define push_indent() push_indent_n(1)
|
|
|
|
#define pop_indent() push_indent_n(-1)
|
|
|
|
#define pop_indent_n(n) push_indent_n(-n)
|
|
|
|
|
|
|
|
static void
|
|
|
|
push_indent_n (int n)
|
|
|
|
{
|
|
|
|
g_assert (n > 0 || indent > 0);
|
|
|
|
indent += n;
|
|
|
|
}
|
|
|
|
|
2014-02-08 15:42:55 +00:00
|
|
|
/* *INDENT-OFF* */
|
|
|
|
G_GNUC_PRINTF (1, 2)
|
|
|
|
/* *INDENT-ON* */
|
2017-11-25 22:27:08 +00:00
|
|
|
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* gst/gstconfig.h.in:
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer):
* libs/gst/check/gstcheck.c: (gst_check_log_message_func),
(gst_check_log_critical_func), (gst_check_drop_buffers),
(gst_check_element_push_buffer_list):
* libs/gst/controller/gstcontroller.c: (gst_controller_get),
(gst_controller_get_type):
* libs/gst/controller/gsthelper.c: (gst_object_control_properties),
(gst_object_get_controller), (gst_object_get_control_source):
* libs/gst/controller/gstinterpolationcontrolsource.c:
(gst_interpolation_control_source_new):
* libs/gst/controller/gstlfocontrolsource.c:
(gst_lfo_control_source_new):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_event_from_packet_0_2):
* plugins/elements/gstfdsrc.c:
* plugins/elements/gstmultiqueue.c:
* plugins/elements/gsttee.c:
* plugins/elements/gsttypefindelement.c:
* plugins/indexers/gstfileindex.c: (_file_index_id_save_xml),
(gst_file_index_add_association):
* plugins/indexers/gstmemindex.c:
* tests/benchmarks/gstpollstress.c: (mess_some_more):
* tests/check/elements/queue.c: (setup_queue):
* tests/check/gst/gstpipeline.c:
* tests/check/libs/collectpads.c: (setup), (teardown),
(gst_collect_pads_suite):
* tests/examples/adapter/adapter_test.c:
* tests/examples/metadata/read-metadata.c: (make_pipeline):
* tests/examples/xml/createxml.c:
* tests/examples/xml/runxml.c:
* tools/gst-inspect.c:
* tools/gst-run.c:
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers, not using variable sized arrays
on the stack, moving variable declarations to the beginning of
a block and using "foo (void)" instead of "foo ()" for declarations.
2008-02-29 12:41:33 +00:00
|
|
|
static void
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print (const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
2017-11-25 22:27:08 +00:00
|
|
|
int i;
|
2004-06-14 11:04:06 +00:00
|
|
|
|
|
|
|
if (_name)
|
2008-05-04 19:07:21 +00:00
|
|
|
g_print ("%s", _name);
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
for (i = 0; i < indent; ++i)
|
|
|
|
g_print (" ");
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
va_start (args, format);
|
2009-10-19 11:29:40 +00:00
|
|
|
g_vprintf (format, args);
|
2004-06-14 11:04:06 +00:00
|
|
|
va_end (args);
|
|
|
|
}
|
2001-01-03 07:38:45 +00:00
|
|
|
|
2004-04-29 01:44:13 +00:00
|
|
|
static gboolean
|
2005-03-07 18:27:42 +00:00
|
|
|
print_field (GQuark field, const GValue * value, gpointer pfx)
|
2004-04-29 01:44:13 +00:00
|
|
|
{
|
|
|
|
gchar *str = gst_value_serialize (value);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s %s%15s%s: %s%s%s\n",
|
|
|
|
(gchar *) pfx, FIELD_NAME_COLOR, g_quark_to_string (field), RESET_COLOR,
|
|
|
|
FIELD_VALUE_COLOR, str, RESET_COLOR);
|
2004-04-29 01:44:13 +00:00
|
|
|
g_free (str);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-03-16 20:06:02 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
print_caps (const GstCaps * caps, const gchar * pfx)
|
2001-08-21 20:16:48 +00:00
|
|
|
{
|
2004-04-29 01:44:13 +00:00
|
|
|
guint i;
|
|
|
|
|
|
|
|
g_return_if_fail (caps != NULL);
|
|
|
|
|
|
|
|
if (gst_caps_is_any (caps)) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%sANY%s\n", CAPS_TYPE_COLOR, pfx, RESET_COLOR);
|
2004-04-29 01:44:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (gst_caps_is_empty (caps)) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%sEMPTY%s\n", CAPS_TYPE_COLOR, pfx, RESET_COLOR);
|
2004-04-29 01:44:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < gst_caps_get_size (caps); i++) {
|
|
|
|
GstStructure *structure = gst_caps_get_structure (caps, i);
|
2013-04-01 08:20:01 +00:00
|
|
|
GstCapsFeatures *features = gst_caps_get_features (caps, i);
|
|
|
|
|
2013-04-06 19:49:25 +00:00
|
|
|
if (features && (gst_caps_features_is_any (features) ||
|
|
|
|
!gst_caps_features_is_equal (features,
|
|
|
|
GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) {
|
2013-04-01 08:20:01 +00:00
|
|
|
gchar *features_string = gst_caps_features_to_string (features);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s%s(%s%s%s)\n", pfx, STRUCT_NAME_COLOR,
|
|
|
|
gst_structure_get_name (structure), RESET_COLOR,
|
|
|
|
CAPS_FEATURE_COLOR, features_string, RESET_COLOR);
|
2013-04-01 08:20:01 +00:00
|
|
|
g_free (features_string);
|
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s%s\n", pfx, STRUCT_NAME_COLOR,
|
|
|
|
gst_structure_get_name (structure), RESET_COLOR);
|
2013-04-01 08:20:01 +00:00
|
|
|
}
|
2004-04-29 01:44:13 +00:00
|
|
|
gst_structure_foreach (structure, print_field, (gpointer) pfx);
|
|
|
|
}
|
2002-09-17 21:32:26 +00:00
|
|
|
}
|
|
|
|
|
2010-03-03 10:45:38 +00:00
|
|
|
static const char *
|
2010-06-11 23:12:33 +00:00
|
|
|
get_rank_name (char *s, gint rank)
|
2004-05-23 17:52:54 +00:00
|
|
|
{
|
2010-06-11 23:12:33 +00:00
|
|
|
static const int ranks[4] = {
|
|
|
|
GST_RANK_NONE, GST_RANK_MARGINAL, GST_RANK_SECONDARY, GST_RANK_PRIMARY
|
|
|
|
};
|
|
|
|
static const char *rank_names[4] = { "none", "marginal", "secondary",
|
|
|
|
"primary"
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
int best_i;
|
|
|
|
|
|
|
|
best_i = 0;
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
if (rank == ranks[i])
|
|
|
|
return rank_names[i];
|
|
|
|
if (abs (rank - ranks[i]) < abs (rank - ranks[best_i])) {
|
|
|
|
best_i = i;
|
|
|
|
}
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2010-06-11 23:12:33 +00:00
|
|
|
|
|
|
|
sprintf (s, "%s %c %d", rank_names[best_i],
|
|
|
|
(rank - ranks[best_i] > 0) ? '+' : '-', abs (ranks[best_i] - rank));
|
|
|
|
|
|
|
|
return s;
|
2002-07-24 21:13:30 +00:00
|
|
|
}
|
|
|
|
|
2001-07-25 21:40:42 +00:00
|
|
|
static void
|
2004-05-23 17:52:54 +00:00
|
|
|
print_factory_details_info (GstElementFactory * factory)
|
|
|
|
{
|
2012-05-19 13:59:14 +00:00
|
|
|
gchar **keys, **k;
|
2012-05-19 16:23:43 +00:00
|
|
|
GstRank rank;
|
2010-06-11 23:12:33 +00:00
|
|
|
char s[20];
|
|
|
|
|
2012-05-19 16:23:43 +00:00
|
|
|
rank = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory));
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFactory Details:%s\n", HEADING_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-25s%s%s (%d)%s\n", PROP_NAME_COLOR, "Rank", PROP_VALUE_COLOR,
|
|
|
|
get_rank_name (s, rank), rank, RESET_COLOR);
|
2012-05-19 13:59:14 +00:00
|
|
|
|
|
|
|
keys = gst_element_factory_get_metadata_keys (factory);
|
|
|
|
if (keys != NULL) {
|
|
|
|
for (k = keys; *k != NULL; ++k) {
|
|
|
|
const gchar *val;
|
|
|
|
gchar *key = *k;
|
|
|
|
|
|
|
|
val = gst_element_factory_get_metadata (factory, key);
|
|
|
|
key[0] = g_ascii_toupper (key[0]);
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-25s%s%s%s\n", PROP_NAME_COLOR, key, PROP_VALUE_COLOR, val,
|
|
|
|
RESET_COLOR);
|
2012-05-19 13:59:14 +00:00
|
|
|
}
|
|
|
|
g_strfreev (keys);
|
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent ();
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_hierarchy (GType type, gint level, gint * maxlevel)
|
2001-07-25 21:40:42 +00:00
|
|
|
{
|
|
|
|
GType parent;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
parent = g_type_parent (type);
|
|
|
|
|
|
|
|
*maxlevel = *maxlevel + 1;
|
|
|
|
level++;
|
|
|
|
|
|
|
|
if (parent)
|
2004-05-23 17:52:54 +00:00
|
|
|
print_hierarchy (parent, level, maxlevel);
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
if (_name)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s", DATATYPE_COLOR, _name, RESET_COLOR);
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
for (i = 1; i < *maxlevel - level; i++)
|
|
|
|
g_print (" ");
|
|
|
|
if (*maxlevel - level)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (" %s+----%s", CHILD_LINK_COLOR, RESET_COLOR);
|
2001-07-25 21:40:42 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s\n", DATATYPE_COLOR, g_type_name (type), RESET_COLOR);
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2001-07-25 21:40:42 +00:00
|
|
|
if (level == 1)
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2001-07-25 21:40:42 +00:00
|
|
|
}
|
|
|
|
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
static void
|
|
|
|
print_interfaces (GType type)
|
|
|
|
{
|
|
|
|
guint n_ifaces;
|
|
|
|
GType *iface, *ifaces = g_type_interfaces (type, &n_ifaces);
|
|
|
|
|
|
|
|
if (ifaces) {
|
|
|
|
if (n_ifaces) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (_("%sImplemented Interfaces%s:\n"), HEADING_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent ();
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
iface = ifaces;
|
|
|
|
while (*iface) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s\n", DATATYPE_COLOR, g_type_name (*iface), RESET_COLOR);
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
iface++;
|
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent ();
|
|
|
|
n_print ("\n");
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
}
|
2008-02-02 06:48:37 +00:00
|
|
|
g_free (ifaces);
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-19 20:03:46 +00:00
|
|
|
static gchar *
|
|
|
|
flags_to_string (GFlagsValue * vals, guint flags)
|
|
|
|
{
|
|
|
|
GString *s = NULL;
|
|
|
|
guint flags_left, i;
|
|
|
|
|
|
|
|
/* first look for an exact match and count the number of values */
|
|
|
|
for (i = 0; vals[i].value_name != NULL; ++i) {
|
|
|
|
if (vals[i].value == flags)
|
|
|
|
return g_strdup (vals[i].value_nick);
|
|
|
|
}
|
|
|
|
|
|
|
|
s = g_string_new (NULL);
|
|
|
|
|
|
|
|
/* we assume the values are sorted from lowest to highest value */
|
|
|
|
flags_left = flags;
|
|
|
|
while (i > 0) {
|
|
|
|
--i;
|
|
|
|
if (vals[i].value != 0 && (flags_left & vals[i].value) == vals[i].value) {
|
|
|
|
if (s->len > 0)
|
2011-05-06 07:54:08 +00:00
|
|
|
g_string_append_c (s, '+');
|
2009-06-19 20:03:46 +00:00
|
|
|
g_string_append (s, vals[i].value_nick);
|
|
|
|
flags_left -= vals[i].value;
|
|
|
|
if (flags_left == 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (s->len == 0)
|
|
|
|
g_string_assign (s, "(none)");
|
|
|
|
|
|
|
|
return g_string_free (s, FALSE);
|
|
|
|
}
|
|
|
|
|
2010-09-23 19:48:25 +00:00
|
|
|
#define KNOWN_PARAM_FLAGS \
|
|
|
|
(G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY | \
|
|
|
|
G_PARAM_LAX_VALIDATION | G_PARAM_STATIC_STRINGS | \
|
2014-11-01 21:30:30 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_DEPRECATED | \
|
|
|
|
GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | \
|
|
|
|
GST_PARAM_MUTABLE_PAUSED | GST_PARAM_MUTABLE_READY)
|
2010-09-23 19:48:25 +00:00
|
|
|
|
2018-07-13 12:53:53 +00:00
|
|
|
static int
|
|
|
|
sort_gparamspecs (GParamSpec ** a, GParamSpec ** b)
|
|
|
|
{
|
|
|
|
return g_strcmp0 (g_param_spec_get_name (*a), g_param_spec_get_name (*b));
|
|
|
|
}
|
|
|
|
|
2017-11-25 23:43:56 +00:00
|
|
|
/* obj will be NULL if we're printing properties of pad template pads */
|
2002-05-08 20:40:48 +00:00
|
|
|
static void
|
2017-11-25 23:43:56 +00:00
|
|
|
print_object_properties_info (GObject * obj, GObjectClass * obj_class,
|
|
|
|
const gchar * desc)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
GParamSpec **property_specs;
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
guint num_properties, i;
|
2002-09-19 18:14:09 +00:00
|
|
|
gboolean readable;
|
2005-08-29 19:59:52 +00:00
|
|
|
gboolean first_flag;
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2017-11-25 23:43:56 +00:00
|
|
|
property_specs = g_object_class_list_properties (obj_class, &num_properties);
|
2018-07-13 12:53:53 +00:00
|
|
|
g_qsort_with_data (property_specs, num_properties, sizeof (gpointer),
|
|
|
|
(GCompareDataFunc) sort_gparamspecs, NULL);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s:\n", HEADING_COLOR, desc, RESET_COLOR);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent ();
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
for (i = 0; i < num_properties; i++) {
|
|
|
|
GValue value = { 0, };
|
|
|
|
GParamSpec *param = property_specs[i];
|
2017-11-25 23:43:56 +00:00
|
|
|
GType owner_type = param->owner_type;
|
|
|
|
|
|
|
|
/* We're printing pad properties */
|
|
|
|
if (obj == NULL && (owner_type == G_TYPE_OBJECT
|
|
|
|
|| owner_type == GST_TYPE_OBJECT || owner_type == GST_TYPE_PAD))
|
|
|
|
continue;
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2002-09-19 18:14:09 +00:00
|
|
|
g_value_init (&value, param->value_type);
|
2005-08-29 19:59:52 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-20s%s: %s%s%s\n", PROP_NAME_COLOR,
|
|
|
|
g_param_spec_get_name (param), RESET_COLOR, PROP_VALUE_COLOR,
|
|
|
|
g_param_spec_get_blurb (param), RESET_COLOR);
|
2005-08-29 19:59:52 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent_n (11);
|
|
|
|
|
2005-08-29 19:59:52 +00:00
|
|
|
first_flag = TRUE;
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sflags%s: ", PROP_ATTR_NAME_COLOR, RESET_COLOR);
|
2017-11-28 23:37:47 +00:00
|
|
|
readable = ! !(param->flags & G_PARAM_READABLE);
|
|
|
|
if (readable && obj != NULL) {
|
2017-11-25 23:43:56 +00:00
|
|
|
g_object_get_property (obj, param->name, &value);
|
2011-11-12 16:42:14 +00:00
|
|
|
} else {
|
|
|
|
/* if we can't read the property value, assume it's set to the default
|
|
|
|
* (which might not be entirely true for sub-classes, but that's an
|
|
|
|
* unlikely corner-case anyway) */
|
|
|
|
g_param_value_set_default (param, &value);
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2017-11-28 23:37:47 +00:00
|
|
|
if (readable) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s%s", (first_flag) ? "" : ", ", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("readable"), RESET_COLOR);
|
2017-11-28 23:37:47 +00:00
|
|
|
first_flag = FALSE;
|
|
|
|
}
|
2005-08-29 19:59:52 +00:00
|
|
|
if (param->flags & G_PARAM_WRITABLE) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s%s", (first_flag) ? "" : ", ", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("writable"), RESET_COLOR);
|
2010-09-23 19:48:25 +00:00
|
|
|
first_flag = FALSE;
|
2005-08-29 19:59:52 +00:00
|
|
|
}
|
2014-11-01 21:30:30 +00:00
|
|
|
if (param->flags & G_PARAM_DEPRECATED) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s%s", (first_flag) ? "" : ", ", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("deprecated"), RESET_COLOR);
|
2014-11-01 21:30:30 +00:00
|
|
|
first_flag = FALSE;
|
|
|
|
}
|
2005-08-29 19:59:52 +00:00
|
|
|
if (param->flags & GST_PARAM_CONTROLLABLE) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR, _("controllable"),
|
|
|
|
RESET_COLOR);
|
2010-09-23 19:48:25 +00:00
|
|
|
first_flag = FALSE;
|
|
|
|
}
|
|
|
|
if (param->flags & GST_PARAM_MUTABLE_PLAYING) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("changeable in NULL, READY, PAUSED or PLAYING state"), RESET_COLOR);
|
2010-09-23 19:48:25 +00:00
|
|
|
} else if (param->flags & GST_PARAM_MUTABLE_PAUSED) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("changeable only in NULL, READY or PAUSED state"), RESET_COLOR);
|
2010-09-23 19:48:25 +00:00
|
|
|
} else if (param->flags & GST_PARAM_MUTABLE_READY) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (", %s%s%s", PROP_ATTR_VALUE_COLOR,
|
|
|
|
_("changeable only in NULL or READY state"), RESET_COLOR);
|
2010-09-23 19:48:25 +00:00
|
|
|
}
|
|
|
|
if (param->flags & ~KNOWN_PARAM_FLAGS) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s0x%s%0x%s", (first_flag) ? "" : ", ", PROP_ATTR_VALUE_COLOR,
|
|
|
|
param->flags & ~KNOWN_PARAM_FLAGS, RESET_COLOR);
|
2005-08-29 19:59:52 +00:00
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
g_print ("\n");
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
switch (G_VALUE_TYPE (&value)) {
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_STRING:
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
{
|
2011-11-12 16:42:14 +00:00
|
|
|
const char *string_val = g_value_get_string (&value);
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sString%s. ", DATATYPE_COLOR, RESET_COLOR);
|
2005-10-08 11:16:03 +00:00
|
|
|
|
2011-11-12 16:42:14 +00:00
|
|
|
if (string_val == NULL)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%sDefault%s: %snull%s", PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, RESET_COLOR);
|
2005-10-08 11:16:03 +00:00
|
|
|
else
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%sDefault%s: %s\"%s\"%s", PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, string_val, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_BOOLEAN:
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
{
|
2011-11-12 16:42:14 +00:00
|
|
|
gboolean bool_val = g_value_get_boolean (&value);
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sBoolean%s. %sDefault%s: %s%s%s", DATATYPE_COLOR,
|
|
|
|
RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, bool_val ? "true" : "false", RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_ULONG:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print
|
|
|
|
("%sUnsigned Long%s. %sRange%s: %s%lu - %lu%s %sDefault%s: %s%lu%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, pulong->minimum, pulong->maximum,
|
|
|
|
RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, g_value_get_ulong (&value), RESET_COLOR);
|
2011-11-24 01:06:52 +00:00
|
|
|
|
2012-01-22 15:23:13 +00:00
|
|
|
GST_ERROR ("%s: property '%s' of type ulong: consider changing to "
|
2017-11-25 23:43:56 +00:00
|
|
|
"uint/uint64", G_OBJECT_CLASS_NAME (obj_class),
|
2011-11-24 01:06:52 +00:00
|
|
|
g_param_spec_get_name (param));
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_LONG:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sLong%s. %sRange%s: %s%ld - %ld%s %sDefault%s: %s%ld%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, plong->minimum, plong->maximum, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
g_value_get_long (&value), RESET_COLOR);
|
2011-11-24 01:06:52 +00:00
|
|
|
|
|
|
|
GST_ERROR ("%s: property '%s' of type long: consider changing to "
|
2017-11-25 23:43:56 +00:00
|
|
|
"int/int64", G_OBJECT_CLASS_NAME (obj_class),
|
2011-11-24 01:06:52 +00:00
|
|
|
g_param_spec_get_name (param));
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_UINT:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print
|
|
|
|
("%sUnsigned Integer%s. %sRange%s: %s%u - %u%s %sDefault%s: %s%u%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, puint->minimum, puint->maximum, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
g_value_get_uint (&value), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_INT:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sInteger%s. %sRange%s: %s%d - %d%s %sDefault%s: %s%d%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, pint->minimum, pint->maximum, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
g_value_get_int (&value), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_UINT64:
|
2002-05-14 00:45:10 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sUnsigned Integer64%s. %sRange%s: %s%" G_GUINT64_FORMAT " - "
|
|
|
|
"%" G_GUINT64_FORMAT "%s %sDefault%s: %s%" G_GUINT64_FORMAT "%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, puint64->minimum, puint64->maximum,
|
|
|
|
RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, g_value_get_uint64 (&value), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-14 00:45:10 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_INT64:
|
2002-05-14 00:45:10 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sInteger64%s. %sRange%s: %s%" G_GINT64_FORMAT " - %"
|
|
|
|
G_GINT64_FORMAT "%s %sDefault%s: %s%" G_GINT64_FORMAT "%s ",
|
|
|
|
DATATYPE_COLOR, RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, pint64->minimum, pint64->maximum,
|
|
|
|
RESET_COLOR, PROP_ATTR_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, g_value_get_int64 (&value), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-14 00:45:10 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_FLOAT:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFloat%s. %sRange%s: %s%15.7g - %15.7g%s "
|
|
|
|
"%sDefault%s: %s%15.7g%s ", DATATYPE_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
pfloat->minimum, pfloat->maximum, RESET_COLOR, PROP_ATTR_NAME_COLOR,
|
|
|
|
RESET_COLOR, PROP_ATTR_VALUE_COLOR, g_value_get_float (&value),
|
|
|
|
RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
case G_TYPE_DOUBLE:
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2004-03-15 19:27:17 +00:00
|
|
|
GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sDouble%s. %sRange%s: %s%15.7g - %15.7g%s "
|
|
|
|
"%sDefault%s: %s%15.7g%s ", DATATYPE_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
pdouble->minimum, pdouble->maximum, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
g_value_get_double (&value), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2011-11-24 01:06:52 +00:00
|
|
|
case G_TYPE_CHAR:
|
|
|
|
case G_TYPE_UCHAR:
|
|
|
|
GST_ERROR ("%s: property '%s' of type char: consider changing to "
|
2017-11-25 23:43:56 +00:00
|
|
|
"int/string", G_OBJECT_CLASS_NAME (obj_class),
|
2011-11-24 01:06:52 +00:00
|
|
|
g_param_spec_get_name (param));
|
|
|
|
/* fall through */
|
2002-05-08 20:40:48 +00:00
|
|
|
default:
|
2004-03-15 19:27:17 +00:00
|
|
|
if (param->value_type == GST_TYPE_CAPS) {
|
|
|
|
const GstCaps *caps = gst_value_get_caps (&value);
|
|
|
|
|
|
|
|
if (!caps)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sCaps%s (NULL)", DATATYPE_COLOR, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
else {
|
|
|
|
print_caps (caps, " ");
|
|
|
|
}
|
|
|
|
} else if (G_IS_PARAM_SPEC_ENUM (param)) {
|
|
|
|
GEnumValue *values;
|
|
|
|
guint j = 0;
|
|
|
|
gint enum_value;
|
2011-11-12 16:42:14 +00:00
|
|
|
const gchar *value_nick = "";
|
2004-03-15 19:27:17 +00:00
|
|
|
|
|
|
|
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
|
|
|
|
enum_value = g_value_get_enum (&value);
|
|
|
|
|
|
|
|
while (values[j].value_name) {
|
|
|
|
if (values[j].value == enum_value)
|
2011-11-12 16:42:14 +00:00
|
|
|
value_nick = values[j].value_nick;
|
2004-03-15 19:27:17 +00:00
|
|
|
j++;
|
|
|
|
}
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sEnum \"%s\"%s %sDefault%s: %s%d, \"%s\"%s",
|
|
|
|
DATATYPE_COLOR, g_type_name (G_VALUE_TYPE (&value)), RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
enum_value, value_nick, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
|
|
|
j = 0;
|
|
|
|
while (values[j].value_name) {
|
2007-10-15 07:11:04 +00:00
|
|
|
g_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s(%d)%s: %s%-16s%s - %s%s%s",
|
|
|
|
PROP_ATTR_NAME_COLOR, values[j].value, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, values[j].value_nick, RESET_COLOR,
|
|
|
|
DESC_COLOR, values[j].value_name, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
j++;
|
|
|
|
}
|
|
|
|
/* g_type_class_unref (ec); */
|
|
|
|
} else if (G_IS_PARAM_SPEC_FLAGS (param)) {
|
2007-11-22 21:32:09 +00:00
|
|
|
GParamSpecFlags *pflags = G_PARAM_SPEC_FLAGS (param);
|
2009-06-19 20:03:46 +00:00
|
|
|
GFlagsValue *vals;
|
2011-11-12 16:42:14 +00:00
|
|
|
gchar *cur;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2009-06-19 20:03:46 +00:00
|
|
|
vals = pflags->flags_class->values;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2009-06-19 20:03:46 +00:00
|
|
|
cur = flags_to_string (vals, g_value_get_flags (&value));
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFlags \"%s\"%s %sDefault%s: %s0x%08x, \"%s\"%s",
|
|
|
|
DATATYPE_COLOR, g_type_name (G_VALUE_TYPE (&value)), RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
g_value_get_flags (&value), cur, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2009-06-19 20:03:46 +00:00
|
|
|
while (vals[0].value_name) {
|
2007-10-15 07:11:04 +00:00
|
|
|
g_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s(0x%08x)%s: %s%-16s%s - %s%s%s",
|
|
|
|
PROP_ATTR_NAME_COLOR, vals[0].value, RESET_COLOR,
|
|
|
|
PROP_ATTR_VALUE_COLOR, vals[0].value_nick, RESET_COLOR,
|
|
|
|
DESC_COLOR, vals[0].value_name, RESET_COLOR);
|
2009-06-19 20:03:46 +00:00
|
|
|
++vals;
|
2004-03-15 19:27:17 +00:00
|
|
|
}
|
|
|
|
|
2009-06-19 20:03:46 +00:00
|
|
|
g_free (cur);
|
2004-03-15 19:27:17 +00:00
|
|
|
} else if (G_IS_PARAM_SPEC_OBJECT (param)) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sObject of type%s %s\"%s\"%s", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR, DATATYPE_COLOR,
|
|
|
|
g_type_name (param->value_type), RESET_COLOR);
|
2005-12-27 18:04:58 +00:00
|
|
|
} else if (G_IS_PARAM_SPEC_BOXED (param)) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sBoxed pointer of type%s %s\"%s\"%s", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR, DATATYPE_COLOR,
|
|
|
|
g_type_name (param->value_type), RESET_COLOR);
|
2014-04-12 05:13:02 +00:00
|
|
|
if (param->value_type == GST_TYPE_STRUCTURE) {
|
|
|
|
const GstStructure *s = gst_value_get_structure (&value);
|
|
|
|
if (s)
|
|
|
|
gst_structure_foreach (s, print_field,
|
|
|
|
(gpointer) " ");
|
|
|
|
}
|
2005-12-27 18:04:58 +00:00
|
|
|
} else if (G_IS_PARAM_SPEC_POINTER (param)) {
|
|
|
|
if (param->value_type != G_TYPE_POINTER) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPointer of type%s %s\"%s\"%s.", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR, DATATYPE_COLOR, g_type_name (param->value_type),
|
|
|
|
RESET_COLOR);
|
2005-12-27 18:04:58 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPointer.%s", PROP_VALUE_COLOR, RESET_COLOR);
|
2005-12-27 18:04:58 +00:00
|
|
|
}
|
2006-11-08 11:41:13 +00:00
|
|
|
} else if (param->value_type == G_TYPE_VALUE_ARRAY) {
|
2008-05-28 10:44:15 +00:00
|
|
|
GParamSpecValueArray *pvarray = G_PARAM_SPEC_VALUE_ARRAY (param);
|
|
|
|
|
|
|
|
if (pvarray->element_spec) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sArray of GValues of type%s %s\"%s\"%s",
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR, DATATYPE_COLOR,
|
|
|
|
g_type_name (pvarray->element_spec->value_type), RESET_COLOR);
|
2008-05-28 10:44:15 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sArray of GValues%s", PROP_VALUE_COLOR, RESET_COLOR);
|
2008-05-28 10:44:15 +00:00
|
|
|
}
|
2007-12-13 10:31:33 +00:00
|
|
|
} else if (GST_IS_PARAM_SPEC_FRACTION (param)) {
|
|
|
|
GstParamSpecFraction *pfraction = GST_PARAM_SPEC_FRACTION (param);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFraction%s. %sRange%s: %s%d/%d - %d/%d%s "
|
|
|
|
"%sDefault%s: %s%d/%d%s ", DATATYPE_COLOR, RESET_COLOR,
|
|
|
|
PROP_ATTR_NAME_COLOR, RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
|
|
|
pfraction->min_num, pfraction->min_den, pfraction->max_num,
|
|
|
|
pfraction->max_den, RESET_COLOR, PROP_ATTR_NAME_COLOR,
|
|
|
|
RESET_COLOR, PROP_ATTR_VALUE_COLOR,
|
2011-11-12 16:42:14 +00:00
|
|
|
gst_value_get_fraction_numerator (&value),
|
2018-10-27 17:06:20 +00:00
|
|
|
gst_value_get_fraction_denominator (&value), RESET_COLOR);
|
2017-09-19 21:58:26 +00:00
|
|
|
} else if (param->value_type == GST_TYPE_ARRAY) {
|
|
|
|
GstParamSpecArray *parray = GST_PARAM_SPEC_ARRAY_LIST (param);
|
|
|
|
|
|
|
|
if (parray->element_spec) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sGstValueArray of GValues of type%s %s\"%s\"%s",
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR, DATATYPE_COLOR,
|
|
|
|
g_type_name (parray->element_spec->value_type), RESET_COLOR);
|
2017-09-19 21:58:26 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sGstValueArray of GValues%s", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR);
|
2017-09-19 21:58:26 +00:00
|
|
|
}
|
2004-03-15 19:27:17 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sUnknown type %ld%s %s\"%s\"%s", PROP_VALUE_COLOR,
|
|
|
|
(glong) param->value_type, RESET_COLOR, DATATYPE_COLOR,
|
|
|
|
g_type_name (param->value_type), RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
if (!readable)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (" %sWrite only%s\n", PROP_VALUE_COLOR, RESET_COLOR);
|
2003-03-16 20:06:02 +00:00
|
|
|
else
|
2002-09-19 18:14:09 +00:00
|
|
|
g_print ("\n");
|
2008-02-02 06:48:37 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent_n (11);
|
|
|
|
|
2008-02-02 06:48:37 +00:00
|
|
|
g_value_reset (&value);
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
2003-03-16 20:06:02 +00:00
|
|
|
if (num_properties == 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%snone%s\n", PROP_VALUE_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
pop_indent ();
|
2005-08-24 13:04:31 +00:00
|
|
|
|
|
|
|
g_free (property_specs);
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
|
|
|
|
2017-11-25 23:43:56 +00:00
|
|
|
static void
|
|
|
|
print_element_properties_info (GstElement * element)
|
|
|
|
{
|
|
|
|
g_print ("\n");
|
|
|
|
print_object_properties_info (G_OBJECT (element),
|
|
|
|
G_OBJECT_GET_CLASS (element), "Element Properties");
|
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
static void
|
2004-06-14 11:04:06 +00:00
|
|
|
print_pad_templates_info (GstElement * element, GstElementFactory * factory)
|
2001-03-07 21:52:56 +00:00
|
|
|
{
|
2004-05-23 17:52:54 +00:00
|
|
|
const GList *pads;
|
Use libxml2 for registry parsing, use staticpadtemplates in elementfactories. Makes gst_init() +/- 10x faster.
Original commit message from CVS:
* docs/gst/tmpl/gstelementfactory.sgml:
* gst/gstelement.h:
* gst/gstelementfactory.c: (gst_element_factory_init),
(gst_element_factory_cleanup), (gst_element_register),
(__gst_element_factory_add_static_pad_template),
(gst_element_factory_get_static_pad_templates),
(gst_element_factory_can_src_caps),
(gst_element_factory_can_sink_caps):
* gst/registries/Makefile.am:
* gst/registries/gstlibxmlregistry.c: (gst_xml_registry_get_type),
(gst_xml_registry_class_init), (gst_xml_registry_init),
(gst_xml_registry_new), (gst_xml_registry_set_property),
(gst_xml_registry_get_property), (get_time), (make_dir),
(gst_xml_registry_get_perms_func),
(plugin_times_older_than_recurse), (plugin_times_older_than),
(gst_xml_registry_open_func), (gst_xml_registry_load_func),
(gst_xml_registry_save_func), (gst_xml_registry_close_func),
(add_to_char_array), (read_string), (read_uint), (read_enum),
(load_pad_template), (load_feature), (load_plugin), (load_paths),
(gst_xml_registry_load), (gst_xml_registry_load_plugin),
(gst_xml_registry_save_caps), (gst_xml_registry_save_pad_template),
(gst_xml_registry_save_feature), (gst_xml_registry_save_plugin),
(gst_xml_registry_save), (gst_xml_registry_rebuild_recurse),
(gst_xml_registry_rebuild):
* gst/registries/gstlibxmlregistry.h:
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_pad_templates_info):
* tools/gst-xmlinspect.c: (print_element_info):
Use libxml2 for registry parsing, use staticpadtemplates in
elementfactories. Makes gst_init() +/- 10x faster.
2005-04-12 15:00:30 +00:00
|
|
|
GstStaticPadTemplate *padtemplate;
|
2017-11-25 23:43:56 +00:00
|
|
|
GstPadTemplate *tmpl;
|
2004-05-23 17:52:54 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPad Templates%s:\n", HEADING_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
|
|
|
|
2012-05-19 13:59:14 +00:00
|
|
|
if (gst_element_factory_get_num_pad_templates (factory) == 0) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%snone%s\n", PROP_VALUE_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
goto done;
|
2001-01-03 20:21:22 +00:00
|
|
|
}
|
2001-01-29 00:06:02 +00:00
|
|
|
|
2012-05-19 13:59:14 +00:00
|
|
|
pads = gst_element_factory_get_static_pad_templates (factory);
|
2004-05-23 17:52:54 +00:00
|
|
|
while (pads) {
|
Use libxml2 for registry parsing, use staticpadtemplates in elementfactories. Makes gst_init() +/- 10x faster.
Original commit message from CVS:
* docs/gst/tmpl/gstelementfactory.sgml:
* gst/gstelement.h:
* gst/gstelementfactory.c: (gst_element_factory_init),
(gst_element_factory_cleanup), (gst_element_register),
(__gst_element_factory_add_static_pad_template),
(gst_element_factory_get_static_pad_templates),
(gst_element_factory_can_src_caps),
(gst_element_factory_can_sink_caps):
* gst/registries/Makefile.am:
* gst/registries/gstlibxmlregistry.c: (gst_xml_registry_get_type),
(gst_xml_registry_class_init), (gst_xml_registry_init),
(gst_xml_registry_new), (gst_xml_registry_set_property),
(gst_xml_registry_get_property), (get_time), (make_dir),
(gst_xml_registry_get_perms_func),
(plugin_times_older_than_recurse), (plugin_times_older_than),
(gst_xml_registry_open_func), (gst_xml_registry_load_func),
(gst_xml_registry_save_func), (gst_xml_registry_close_func),
(add_to_char_array), (read_string), (read_uint), (read_enum),
(load_pad_template), (load_feature), (load_plugin), (load_paths),
(gst_xml_registry_load), (gst_xml_registry_load_plugin),
(gst_xml_registry_save_caps), (gst_xml_registry_save_pad_template),
(gst_xml_registry_save_feature), (gst_xml_registry_save_plugin),
(gst_xml_registry_save), (gst_xml_registry_rebuild_recurse),
(gst_xml_registry_rebuild):
* gst/registries/gstlibxmlregistry.h:
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_pad_templates_info):
* tools/gst-xmlinspect.c: (print_element_info):
Use libxml2 for registry parsing, use staticpadtemplates in
elementfactories. Makes gst_init() +/- 10x faster.
2005-04-12 15:00:30 +00:00
|
|
|
padtemplate = (GstStaticPadTemplate *) (pads->data);
|
2004-05-23 17:52:54 +00:00
|
|
|
pads = g_list_next (pads);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
if (padtemplate->direction == GST_PAD_SRC)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sSRC template%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, padtemplate->name_template, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
else if (padtemplate->direction == GST_PAD_SINK)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sSINK template%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, padtemplate->name_template, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
else
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sUNKNOWN template%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, padtemplate->name_template, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
2004-05-23 17:52:54 +00:00
|
|
|
|
|
|
|
if (padtemplate->presence == GST_PAD_ALWAYS)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sAvailability%s: %sAlways%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
else if (padtemplate->presence == GST_PAD_SOMETIMES)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sAvailability%s: %sSometimes%s\n", PROP_NAME_COLOR,
|
|
|
|
RESET_COLOR, PROP_VALUE_COLOR, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
else if (padtemplate->presence == GST_PAD_REQUEST) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sAvailability%s: %sOn request%s\n", PROP_NAME_COLOR,
|
|
|
|
RESET_COLOR, PROP_VALUE_COLOR, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
} else
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sAvailability%s: %sUNKNOWN%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
|
Use libxml2 for registry parsing, use staticpadtemplates in elementfactories. Makes gst_init() +/- 10x faster.
Original commit message from CVS:
* docs/gst/tmpl/gstelementfactory.sgml:
* gst/gstelement.h:
* gst/gstelementfactory.c: (gst_element_factory_init),
(gst_element_factory_cleanup), (gst_element_register),
(__gst_element_factory_add_static_pad_template),
(gst_element_factory_get_static_pad_templates),
(gst_element_factory_can_src_caps),
(gst_element_factory_can_sink_caps):
* gst/registries/Makefile.am:
* gst/registries/gstlibxmlregistry.c: (gst_xml_registry_get_type),
(gst_xml_registry_class_init), (gst_xml_registry_init),
(gst_xml_registry_new), (gst_xml_registry_set_property),
(gst_xml_registry_get_property), (get_time), (make_dir),
(gst_xml_registry_get_perms_func),
(plugin_times_older_than_recurse), (plugin_times_older_than),
(gst_xml_registry_open_func), (gst_xml_registry_load_func),
(gst_xml_registry_save_func), (gst_xml_registry_close_func),
(add_to_char_array), (read_string), (read_uint), (read_enum),
(load_pad_template), (load_feature), (load_plugin), (load_paths),
(gst_xml_registry_load), (gst_xml_registry_load_plugin),
(gst_xml_registry_save_caps), (gst_xml_registry_save_pad_template),
(gst_xml_registry_save_feature), (gst_xml_registry_save_plugin),
(gst_xml_registry_save), (gst_xml_registry_rebuild_recurse),
(gst_xml_registry_rebuild):
* gst/registries/gstlibxmlregistry.h:
* tools/gst-compprep.c: (main):
* tools/gst-inspect.c: (print_pad_templates_info):
* tools/gst-xmlinspect.c: (print_element_info):
Use libxml2 for registry parsing, use staticpadtemplates in
elementfactories. Makes gst_init() +/- 10x faster.
2005-04-12 15:00:30 +00:00
|
|
|
if (padtemplate->static_caps.string) {
|
2017-06-28 23:30:50 +00:00
|
|
|
GstCaps *caps = gst_static_caps_get (&padtemplate->static_caps);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sCapabilities%s:\n", PROP_NAME_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
|
|
|
print_caps (caps, ""); // FIXME
|
|
|
|
pop_indent ();
|
|
|
|
|
2017-06-28 23:30:50 +00:00
|
|
|
gst_caps_unref (caps);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
}
|
|
|
|
|
2017-11-25 23:43:56 +00:00
|
|
|
tmpl = gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (element),
|
|
|
|
padtemplate->name_template);
|
|
|
|
if (tmpl != NULL) {
|
|
|
|
GType pad_type = GST_PAD_TEMPLATE_GTYPE (tmpl);
|
|
|
|
|
|
|
|
if (pad_type != G_TYPE_NONE && pad_type != GST_TYPE_PAD) {
|
|
|
|
gpointer pad_klass;
|
|
|
|
|
|
|
|
pad_klass = g_type_class_ref (pad_type);
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sType%s: %s%s%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
DATATYPE_COLOR, g_type_name (pad_type), RESET_COLOR);
|
2017-11-25 23:43:56 +00:00
|
|
|
print_object_properties_info (NULL, pad_klass, "Pad Properties");
|
|
|
|
g_type_class_unref (pad_klass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent ();
|
|
|
|
|
2017-11-17 00:14:35 +00:00
|
|
|
if (pads != NULL)
|
|
|
|
n_print ("\n");
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
pop_indent ();
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_clocking_info (GstElement * element)
|
|
|
|
{
|
2011-11-28 16:22:44 +00:00
|
|
|
gboolean requires_clock, provides_clock;
|
|
|
|
|
|
|
|
requires_clock =
|
|
|
|
GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_FLAG_REQUIRE_CLOCK);
|
|
|
|
provides_clock =
|
|
|
|
GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
|
|
|
|
|
|
|
|
if (!requires_clock && !provides_clock) {
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sElement has no clocking capabilities.%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
return;
|
|
|
|
}
|
2002-03-30 17:06:45 +00:00
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sClocking Interaction%s:\n", PROP_NAME_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
|
|
|
|
2011-11-28 16:22:44 +00:00
|
|
|
if (requires_clock) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%selement requires a clock%s\n", PROP_VALUE_COLOR, RESET_COLOR);
|
2002-03-30 17:06:45 +00:00
|
|
|
}
|
2004-05-23 17:52:54 +00:00
|
|
|
|
2011-11-28 16:22:44 +00:00
|
|
|
if (provides_clock) {
|
2002-03-30 17:06:45 +00:00
|
|
|
GstClock *clock;
|
|
|
|
|
|
|
|
clock = gst_element_get_clock (element);
|
2011-11-28 16:22:44 +00:00
|
|
|
if (clock) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%selement provides a clock%s: %s%s%s\n", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR, DATATYPE_COLOR, GST_OBJECT_NAME (clock), RESET_COLOR);
|
2011-11-28 16:22:44 +00:00
|
|
|
gst_object_unref (clock);
|
|
|
|
} else
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%selement is supposed to provide a clock but returned NULL%s\n",
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR);
|
2002-03-30 17:06:45 +00:00
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
pop_indent ();
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
2008-04-20 09:55:25 +00:00
|
|
|
static void
|
|
|
|
print_uri_handler_info (GstElement * element)
|
|
|
|
{
|
|
|
|
if (GST_IS_URI_HANDLER (element)) {
|
2011-11-13 23:25:23 +00:00
|
|
|
const gchar *const *uri_protocols;
|
2008-04-20 09:55:25 +00:00
|
|
|
const gchar *uri_type;
|
|
|
|
|
|
|
|
if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) == GST_URI_SRC)
|
|
|
|
uri_type = "source";
|
|
|
|
else if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) ==
|
|
|
|
GST_URI_SINK)
|
|
|
|
uri_type = "sink";
|
|
|
|
else
|
|
|
|
uri_type = "unknown";
|
|
|
|
|
|
|
|
uri_protocols = gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
|
|
|
|
|
|
|
|
n_print ("\n");
|
2018-11-29 11:54:46 +00:00
|
|
|
n_print ("%sURI handling capabilities:%s\n", HEADING_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
|
|
|
|
2018-11-29 11:54:46 +00:00
|
|
|
n_print ("%sElement can act as %s.%s\n", DESC_COLOR, uri_type, RESET_COLOR);
|
2008-04-20 09:55:25 +00:00
|
|
|
|
|
|
|
if (uri_protocols && *uri_protocols) {
|
2018-11-29 11:54:46 +00:00
|
|
|
n_print ("%sSupported URI protocols%s:\n", DESC_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent ();
|
2008-04-20 09:55:25 +00:00
|
|
|
for (; *uri_protocols != NULL; uri_protocols++)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s\n", PROP_ATTR_VALUE_COLOR, *uri_protocols,
|
|
|
|
RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent ();
|
2008-04-20 09:55:25 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sNo supported URI protocols%s\n", PROP_VALUE_COLOR,
|
|
|
|
RESET_COLOR);
|
2008-04-20 09:55:25 +00:00
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
pop_indent ();
|
2008-04-20 09:55:25 +00:00
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sElement has no URI handling capabilities.%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2008-04-20 09:55:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
static void
|
|
|
|
print_pad_info (GstElement * element)
|
|
|
|
{
|
|
|
|
const GList *pads;
|
|
|
|
GstPad *pad;
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPads:%s\n", HEADING_COLOR, RESET_COLOR);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent ();
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
if (!element->numpads) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%snone%s\n", PROP_VALUE_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
goto done;
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2002-07-24 21:13:30 +00:00
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
pads = element->pads;
|
2004-05-23 17:52:54 +00:00
|
|
|
while (pads) {
|
2008-02-02 06:48:37 +00:00
|
|
|
gchar *name;
|
2011-05-09 08:54:10 +00:00
|
|
|
GstCaps *caps;
|
2008-02-02 06:48:37 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
pad = GST_PAD (pads->data);
|
|
|
|
pads = g_list_next (pads);
|
2002-07-24 21:13:30 +00:00
|
|
|
|
2008-02-02 06:48:37 +00:00
|
|
|
name = gst_pad_get_name (pad);
|
gst/gstutils.c: RPAD fixes all around.
Original commit message from CVS:
2005-06-08 Andy Wingo <wingo@pobox.com>
* gst/gstutils.c: RPAD fixes all around.
(gst_element_link_pads): Refcounting fixes.
* tools/gst-inspect.c:
* tools/gst-xmlinspect.c:
* parse/grammar.y:
* gst/base/gsttypefindhelper.c:
* gst/base/gstbasesink.c:
* gst/gstqueue.c: RPAD fixes.
* gst/gstghostpad.h:
* gst/gstghostpad.c: New ghost pad implementation as full proxy
pads. The tricky thing is they provide both source and sink
interfaces, since they proxy the internal pad for the external
pad, and vice versa. Implement with lower-level ProxyPad objects,
with the interior proxy pad as a child of the exterior ghost pad.
Should write a doc on this.
* gst/gstpad.h: s/RPAD/PAD/, s/RealPad/Pad/.
(gst_pad_set_name, gst_pad_set_parent): Macros removed, use
gst_object API.
* gst/gstpad.c: Big changes. No more stub base GstPad, now all
pads are real pads. No ghost pads in this file. Not documenting
the myriad s/RPAD/PAD/ and REALIZE fixes.
(gst_pad_class_init): Add properties for "direction" and
"template". Both are construct-only, so they can't change during
the life of the pad. Fixes properly deriving from GstPad.
(gst_pad_custom_new, gst_pad_custom_new_from_template): Gone. For
derived objects, just set properties when creating the objects via
g_object_new.
(gst_pad_get_parent): Implement as a function, return NULL if the
parent is not an element.
(gst_pad_get_real_parent, gst_pad_add_ghost_pad)
(gst_pad_remove_ghost_pad, gst_pad_realize): Removed.
* gst/gstobject.c (gst_object_class_init): Make name a construct
property. Don't set it in the object init.
* gst/gstelement.c (gst_element_add_pad): Don't allow adding pads
with UNKNOWN direction.
(gst_element_add_ghost_pad): Remove non-orthogonal API. Replace
with gst_element_add_pad (e, gst_ghost_pad_new (name, pad)).
(gst_element_remove_pad): Remove ghost-pad special cases.
(gst_element_pads_activate): Remove rpad cruft.
* gst/gstbin.c (gst_bin_change_state): Use gst_pad_get_parent to
catch the pad's-parent-not-an-element case.
* gst/gst.h: Include gstghostpad.h.
* gst/gst.c (init_post): No more real, ghost pads.
* gst/Makefile.am: Add gstghostpad.[ch].
* check/Makefile.am:
* check/gst/gstbin.c:
* check/gst/gstghostpad.c (test_ghost_pads): Check that linking
into a bin creates ghost pads, and that the refcounts are right.
Partly moved from gstbin.c.
2005-06-08 22:16:27 +00:00
|
|
|
if (gst_pad_get_direction (pad) == GST_PAD_SRC)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sSRC%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, name, RESET_COLOR);
|
gst/gstutils.c: RPAD fixes all around.
Original commit message from CVS:
2005-06-08 Andy Wingo <wingo@pobox.com>
* gst/gstutils.c: RPAD fixes all around.
(gst_element_link_pads): Refcounting fixes.
* tools/gst-inspect.c:
* tools/gst-xmlinspect.c:
* parse/grammar.y:
* gst/base/gsttypefindhelper.c:
* gst/base/gstbasesink.c:
* gst/gstqueue.c: RPAD fixes.
* gst/gstghostpad.h:
* gst/gstghostpad.c: New ghost pad implementation as full proxy
pads. The tricky thing is they provide both source and sink
interfaces, since they proxy the internal pad for the external
pad, and vice versa. Implement with lower-level ProxyPad objects,
with the interior proxy pad as a child of the exterior ghost pad.
Should write a doc on this.
* gst/gstpad.h: s/RPAD/PAD/, s/RealPad/Pad/.
(gst_pad_set_name, gst_pad_set_parent): Macros removed, use
gst_object API.
* gst/gstpad.c: Big changes. No more stub base GstPad, now all
pads are real pads. No ghost pads in this file. Not documenting
the myriad s/RPAD/PAD/ and REALIZE fixes.
(gst_pad_class_init): Add properties for "direction" and
"template". Both are construct-only, so they can't change during
the life of the pad. Fixes properly deriving from GstPad.
(gst_pad_custom_new, gst_pad_custom_new_from_template): Gone. For
derived objects, just set properties when creating the objects via
g_object_new.
(gst_pad_get_parent): Implement as a function, return NULL if the
parent is not an element.
(gst_pad_get_real_parent, gst_pad_add_ghost_pad)
(gst_pad_remove_ghost_pad, gst_pad_realize): Removed.
* gst/gstobject.c (gst_object_class_init): Make name a construct
property. Don't set it in the object init.
* gst/gstelement.c (gst_element_add_pad): Don't allow adding pads
with UNKNOWN direction.
(gst_element_add_ghost_pad): Remove non-orthogonal API. Replace
with gst_element_add_pad (e, gst_ghost_pad_new (name, pad)).
(gst_element_remove_pad): Remove ghost-pad special cases.
(gst_element_pads_activate): Remove rpad cruft.
* gst/gstbin.c (gst_bin_change_state): Use gst_pad_get_parent to
catch the pad's-parent-not-an-element case.
* gst/gst.h: Include gstghostpad.h.
* gst/gst.c (init_post): No more real, ghost pads.
* gst/Makefile.am: Add gstghostpad.[ch].
* check/Makefile.am:
* check/gst/gstbin.c:
* check/gst/gstghostpad.c (test_ghost_pads): Check that linking
into a bin creates ghost pads, and that the refcounts are right.
Partly moved from gstbin.c.
2005-06-08 22:16:27 +00:00
|
|
|
else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sSINK%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, name, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
else
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sUNKNOWN%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, name, RESET_COLOR);
|
2008-02-02 06:48:37 +00:00
|
|
|
|
|
|
|
g_free (name);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
2017-11-25 22:27:08 +00:00
|
|
|
if (pad->padtemplate) {
|
|
|
|
push_indent ();
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPad Template%s: %s'%s'%s\n", PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, pad->padtemplate->name_template, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
pop_indent ();
|
|
|
|
}
|
2004-05-23 17:52:54 +00:00
|
|
|
|
2011-05-09 08:54:10 +00:00
|
|
|
caps = gst_pad_get_current_caps (pad);
|
|
|
|
if (caps) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sCapabilities:%s\n", PROP_NAME_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
push_indent ();
|
|
|
|
print_caps (caps, ""); // FIXME
|
|
|
|
pop_indent ();
|
2011-05-09 08:54:10 +00:00
|
|
|
gst_caps_unref (caps);
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
}
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
pop_indent ();
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
2011-02-28 14:56:23 +00:00
|
|
|
static gboolean
|
|
|
|
has_sometimes_template (GstElement * element)
|
2004-05-23 17:52:54 +00:00
|
|
|
{
|
2011-02-28 14:56:23 +00:00
|
|
|
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
for (l = klass->padtemplates; l != NULL; l = l->next) {
|
|
|
|
if (GST_PAD_TEMPLATE (l->data)->presence == GST_PAD_SOMETIMES)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
2016-09-04 19:39:31 +00:00
|
|
|
static gboolean
|
|
|
|
gtype_needs_ptr_marker (GType type)
|
|
|
|
{
|
|
|
|
if (type == G_TYPE_POINTER)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (G_TYPE_FUNDAMENTAL (type) == G_TYPE_POINTER || G_TYPE_IS_BOXED (type)
|
|
|
|
|| G_TYPE_IS_OBJECT (type))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
static void
|
|
|
|
print_signal_info (GstElement * element)
|
|
|
|
{
|
2003-03-16 20:06:02 +00:00
|
|
|
/* Signals/Actions Block */
|
2004-05-23 17:52:54 +00:00
|
|
|
guint *signals;
|
|
|
|
guint nsignals;
|
|
|
|
gint i = 0, j, k;
|
|
|
|
GSignalQuery *query = NULL;
|
|
|
|
GType type;
|
|
|
|
GSList *found_signals, *l;
|
|
|
|
|
|
|
|
for (k = 0; k < 2; k++) {
|
|
|
|
found_signals = NULL;
|
2011-02-28 14:56:23 +00:00
|
|
|
|
|
|
|
/* For elements that have sometimes pads, also list a few useful GstElement
|
|
|
|
* signals. Put these first, so element-specific ones come later. */
|
|
|
|
if (k == 0 && has_sometimes_template (element)) {
|
|
|
|
query = g_new0 (GSignalQuery, 1);
|
|
|
|
g_signal_query (g_signal_lookup ("pad-added", GST_TYPE_ELEMENT), query);
|
|
|
|
found_signals = g_slist_append (found_signals, query);
|
|
|
|
query = g_new0 (GSignalQuery, 1);
|
|
|
|
g_signal_query (g_signal_lookup ("pad-removed", GST_TYPE_ELEMENT), query);
|
|
|
|
found_signals = g_slist_append (found_signals, query);
|
|
|
|
query = g_new0 (GSignalQuery, 1);
|
|
|
|
g_signal_query (g_signal_lookup ("no-more-pads", GST_TYPE_ELEMENT),
|
|
|
|
query);
|
|
|
|
found_signals = g_slist_append (found_signals, query);
|
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
for (type = G_OBJECT_TYPE (element); type; type = g_type_parent (type)) {
|
|
|
|
if (type == GST_TYPE_ELEMENT || type == GST_TYPE_OBJECT)
|
|
|
|
break;
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
if (type == GST_TYPE_BIN && G_OBJECT_TYPE (element) != GST_TYPE_BIN)
|
|
|
|
continue;
|
2002-07-24 21:13:30 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
signals = g_signal_list_ids (type, &nsignals);
|
|
|
|
for (i = 0; i < nsignals; i++) {
|
|
|
|
query = g_new0 (GSignalQuery, 1);
|
|
|
|
g_signal_query (signals[i], query);
|
|
|
|
|
|
|
|
if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
|
|
|
|
(k == 1 && (query->signal_flags & G_SIGNAL_ACTION)))
|
|
|
|
found_signals = g_slist_append (found_signals, query);
|
2008-02-02 06:48:37 +00:00
|
|
|
else
|
|
|
|
g_free (query);
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2008-02-02 06:48:37 +00:00
|
|
|
g_free (signals);
|
|
|
|
signals = NULL;
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (found_signals) {
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2002-07-24 21:13:30 +00:00
|
|
|
if (k == 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sElement Signals%s:\n", HEADING_COLOR, RESET_COLOR);
|
2002-07-24 21:13:30 +00:00
|
|
|
else
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sElement Actions%s:\n", HEADING_COLOR, RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
2001-01-03 07:38:45 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
for (l = found_signals; l; l = l->next) {
|
|
|
|
gchar *indent;
|
2013-04-11 12:54:32 +00:00
|
|
|
const gchar *pmark;
|
2004-05-23 17:52:54 +00:00
|
|
|
int indent_len;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
query = (GSignalQuery *) l->data;
|
|
|
|
indent_len = strlen (query->signal_name) +
|
|
|
|
strlen (g_type_name (query->return_type)) + 24;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2016-09-04 19:39:31 +00:00
|
|
|
if (gtype_needs_ptr_marker (query->return_type)) {
|
2013-04-11 12:54:32 +00:00
|
|
|
pmark = "* ";
|
|
|
|
indent_len += 2;
|
|
|
|
} else {
|
2018-10-27 17:06:20 +00:00
|
|
|
pmark = " ";
|
2013-04-11 12:54:32 +00:00
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
indent = g_new0 (gchar, indent_len + 1);
|
|
|
|
memset (indent, ' ', indent_len);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s\"%s\"%s : %s%s%s%suser_function%s (%s%s%s* object%s",
|
|
|
|
PROP_NAME_COLOR, query->signal_name, RESET_COLOR,
|
|
|
|
DATATYPE_COLOR, g_type_name (query->return_type), PROP_VALUE_COLOR,
|
|
|
|
pmark, RESET_COLOR, DATATYPE_COLOR, g_type_name (type),
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2004-10-22 20:11:43 +00:00
|
|
|
for (j = 0; j < query->n_params; j++) {
|
2016-09-04 19:39:31 +00:00
|
|
|
const gchar *type_name, *asterisk;
|
|
|
|
|
|
|
|
type_name = g_type_name (query->param_types[j]);
|
|
|
|
asterisk = gtype_needs_ptr_marker (query->param_types[j]) ? "*" : "";
|
|
|
|
|
2012-04-16 21:14:02 +00:00
|
|
|
g_print (",\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s%s%s arg%d%s", indent, DATATYPE_COLOR, type_name,
|
|
|
|
PROP_VALUE_COLOR, asterisk, j, RESET_COLOR);
|
2004-10-22 20:11:43 +00:00
|
|
|
}
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2007-10-15 07:11:04 +00:00
|
|
|
if (k == 0) {
|
2012-04-16 21:14:02 +00:00
|
|
|
g_print (",\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%sgpointer %suser_data%s);\n", indent, DATATYPE_COLOR,
|
|
|
|
PROP_VALUE_COLOR, RESET_COLOR);
|
2007-10-15 07:11:04 +00:00
|
|
|
} else
|
2004-05-23 17:52:54 +00:00
|
|
|
g_print (");\n");
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
g_free (indent);
|
|
|
|
}
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
if (found_signals) {
|
|
|
|
g_slist_foreach (found_signals, (GFunc) g_free, NULL);
|
|
|
|
g_slist_free (found_signals);
|
2001-07-25 21:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2001-05-25 21:00:07 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
static void
|
|
|
|
print_children_info (GstElement * element)
|
|
|
|
{
|
|
|
|
GList *children;
|
|
|
|
|
|
|
|
if (!GST_IS_BIN (element))
|
|
|
|
return;
|
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
children = (GList *) GST_BIN (element)->children;
|
2004-06-14 11:04:06 +00:00
|
|
|
if (children) {
|
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sChildren%s:\n", HEADING_COLOR, RESET_COLOR);
|
2004-06-14 11:04:06 +00:00
|
|
|
}
|
2001-05-25 21:00:07 +00:00
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
while (children) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%s%s\n", DATATYPE_COLOR,
|
|
|
|
GST_ELEMENT_NAME (GST_ELEMENT (children->data)), RESET_COLOR);
|
2004-05-23 17:52:54 +00:00
|
|
|
children = g_list_next (children);
|
|
|
|
}
|
2001-01-03 07:38:45 +00:00
|
|
|
}
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2014-12-15 13:03:54 +00:00
|
|
|
static void
|
|
|
|
print_preset_list (GstElement * element)
|
|
|
|
{
|
|
|
|
gchar **presets, **preset;
|
|
|
|
|
|
|
|
if (!GST_IS_PRESET (element))
|
|
|
|
return;
|
|
|
|
|
|
|
|
presets = gst_preset_get_preset_names (GST_PRESET (element));
|
2015-01-04 22:08:47 +00:00
|
|
|
if (presets && *presets) {
|
2014-12-15 13:03:54 +00:00
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPresets%s:\n", HEADING_COLOR, RESET_COLOR);
|
2014-12-15 13:03:54 +00:00
|
|
|
for (preset = presets; *preset; preset++) {
|
|
|
|
n_print (" \"%s\"\n", *preset);
|
|
|
|
}
|
|
|
|
g_strfreev (presets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-23 21:15:43 +00:00
|
|
|
static void
|
2010-03-03 09:26:14 +00:00
|
|
|
print_blacklist (void)
|
2009-01-23 21:15:43 +00:00
|
|
|
{
|
|
|
|
GList *plugins, *cur;
|
|
|
|
gint count = 0;
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s\n", HEADING_COLOR, _("Blacklisted files:"), RESET_COLOR);
|
2009-01-23 21:15:43 +00:00
|
|
|
|
2012-01-02 02:22:51 +00:00
|
|
|
plugins = gst_registry_get_plugin_list (gst_registry_get ());
|
2009-01-23 21:15:43 +00:00
|
|
|
for (cur = plugins; cur != NULL; cur = g_list_next (cur)) {
|
|
|
|
GstPlugin *plugin = (GstPlugin *) (cur->data);
|
2012-04-29 16:46:32 +00:00
|
|
|
if (GST_OBJECT_FLAG_IS_SET (plugin, GST_PLUGIN_FLAG_BLACKLISTED)) {
|
2012-04-29 15:49:57 +00:00
|
|
|
g_print (" %s\n", gst_plugin_get_name (plugin));
|
2009-01-23 21:15:43 +00:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (_("%sTotal count%s: %s"), PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR);
|
2009-01-23 21:15:43 +00:00
|
|
|
g_print (ngettext ("%d blacklisted file", "%d blacklisted files", count),
|
|
|
|
count);
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s\n", RESET_COLOR);
|
2009-01-23 21:15:43 +00:00
|
|
|
gst_plugin_list_free (plugins);
|
|
|
|
}
|
|
|
|
|
2017-10-20 11:02:35 +00:00
|
|
|
static void
|
2018-10-27 17:06:20 +00:00
|
|
|
print_typefind_extensions (const gchar * const *extensions, const gchar * color)
|
2017-10-20 11:02:35 +00:00
|
|
|
{
|
|
|
|
guint i = 0;
|
|
|
|
|
|
|
|
while (extensions[i]) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s%s", i > 0 ? ", " : "", color, extensions[i], RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-16 20:06:02 +00:00
|
|
|
static void
|
2016-12-22 00:58:53 +00:00
|
|
|
print_element_list (gboolean print_all, gchar * ftypes)
|
2001-08-21 20:16:48 +00:00
|
|
|
{
|
2009-01-23 21:15:43 +00:00
|
|
|
int plugincount = 0, featurecount = 0, blacklistcount = 0;
|
2005-09-22 12:05:05 +00:00
|
|
|
GList *plugins, *orig_plugins;
|
2016-12-22 00:58:53 +00:00
|
|
|
gchar **types = NULL;
|
|
|
|
|
|
|
|
if (ftypes) {
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
types = g_strsplit (ftypes, "/", -1);
|
|
|
|
for (i = 0; types[i]; i++)
|
|
|
|
*types[i] = g_ascii_toupper (*types[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-01-02 02:22:51 +00:00
|
|
|
orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
|
2001-01-04 10:47:39 +00:00
|
|
|
while (plugins) {
|
2005-09-22 12:05:05 +00:00
|
|
|
GList *features, *orig_features;
|
2001-08-21 20:16:48 +00:00
|
|
|
GstPlugin *plugin;
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
plugin = (GstPlugin *) (plugins->data);
|
2001-01-04 10:47:39 +00:00
|
|
|
plugins = g_list_next (plugins);
|
2005-10-07 10:32:24 +00:00
|
|
|
plugincount++;
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2012-04-29 16:46:32 +00:00
|
|
|
if (GST_OBJECT_FLAG_IS_SET (plugin, GST_PLUGIN_FLAG_BLACKLISTED)) {
|
2009-01-23 21:15:43 +00:00
|
|
|
blacklistcount++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2005-09-22 12:05:05 +00:00
|
|
|
orig_features = features =
|
2012-01-02 02:22:51 +00:00
|
|
|
gst_registry_get_feature_list_by_plugin (gst_registry_get (),
|
2012-04-29 15:49:57 +00:00
|
|
|
gst_plugin_get_name (plugin));
|
2001-08-21 20:16:48 +00:00
|
|
|
while (features) {
|
|
|
|
GstPluginFeature *feature;
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2009-10-19 11:30:10 +00:00
|
|
|
if (G_UNLIKELY (features->data == NULL))
|
|
|
|
goto next;
|
2001-08-21 20:16:48 +00:00
|
|
|
feature = GST_PLUGIN_FEATURE (features->data);
|
2005-10-07 10:32:24 +00:00
|
|
|
featurecount++;
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
if (GST_IS_ELEMENT_FACTORY (feature)) {
|
2016-12-22 00:58:53 +00:00
|
|
|
const gchar *klass;
|
2004-03-15 19:27:17 +00:00
|
|
|
GstElementFactory *factory;
|
2001-08-21 20:16:48 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
factory = GST_ELEMENT_FACTORY (feature);
|
2016-12-22 00:58:53 +00:00
|
|
|
if (types) {
|
|
|
|
gint i;
|
|
|
|
gboolean all_found = TRUE;
|
|
|
|
|
|
|
|
klass =
|
|
|
|
gst_element_factory_get_metadata (factory,
|
|
|
|
GST_ELEMENT_METADATA_KLASS);
|
|
|
|
for (i = 0; types[i]; i++) {
|
|
|
|
if (!strstr (klass, types[i])) {
|
|
|
|
all_found = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!all_found)
|
|
|
|
goto next;
|
|
|
|
}
|
2004-06-14 11:04:06 +00:00
|
|
|
if (print_all)
|
2017-10-20 09:16:46 +00:00
|
|
|
print_element_info (feature, TRUE);
|
2004-06-14 11:04:06 +00:00
|
|
|
else
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s: %s%s%s: %s%s%s\n", PLUGIN_NAME_COLOR,
|
|
|
|
gst_plugin_get_name (plugin), RESET_COLOR, ELEMENT_NAME_COLOR,
|
|
|
|
GST_OBJECT_NAME (factory), RESET_COLOR, ELEMENT_DETAIL_COLOR,
|
2012-09-15 16:43:39 +00:00
|
|
|
gst_element_factory_get_metadata (factory,
|
2018-10-27 17:06:20 +00:00
|
|
|
GST_ELEMENT_METADATA_LONGNAME), RESET_COLOR);
|
Remove GST_DISABLE_(ENUMTYPES|INDEX|URI) everywhere.
Original commit message from CVS:
* configure.ac:
* docs/gst/gstreamer-sections.txt:
* docs/gst/gstreamer.types:
* docs/gst/gstreamer.types.in:
* gst/Makefile.am:
* gst/gst.c:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_index_func):
* gst/gstconfig.h.in:
* gst/gstelement.c: (gst_element_get_index):
* gst/gstregistrybinary.c: (gst_registry_binary_save_feature),
(gst_registry_binary_load_feature),
(gst_registry_binary_read_cache):
* gst/gstregistryxml.c: (load_feature),
(gst_registry_xml_read_cache), (gst_registry_xml_save_feature):
* plugins/Makefile.am:
* tools/gst-indent:
* tools/gst-inspect.c: (print_index_info), (print_element_list),
(print_plugin_features), (print_element_features):
* tools/gst-xmlinspect.c: (print_event_masks),
(print_element_info):
* win32/common/gstconfig.h:
Remove GST_DISABLE_(ENUMTYPES|INDEX|URI) everywhere.
Disabling the indexers and URI handler code will only reduce the
required amount of memory by a very small amount but on the other hand
requires much more maintaince work. Apart from that many places of
code are broken when disabling them.
Disabling the enum types doesn't reduce the required amount of memory
by more than a few bytes and makes it hard to fix bugs like #539772,
i.e. use the enums as GObject properties.
2008-07-31 15:20:32 +00:00
|
|
|
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
|
2004-03-15 19:27:17 +00:00
|
|
|
GstTypeFindFactory *factory;
|
2012-05-01 21:28:11 +00:00
|
|
|
const gchar *const *extensions;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2016-12-22 00:58:53 +00:00
|
|
|
if (types)
|
|
|
|
goto next;
|
2004-03-15 19:27:17 +00:00
|
|
|
factory = GST_TYPE_FIND_FACTORY (feature);
|
2004-06-14 11:04:06 +00:00
|
|
|
if (!print_all)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s: %s%s%s: ", PLUGIN_NAME_COLOR,
|
|
|
|
gst_plugin_get_name (plugin), RESET_COLOR, ELEMENT_NAME_COLOR,
|
|
|
|
gst_plugin_feature_get_name (feature), RESET_COLOR);
|
2012-05-01 21:28:11 +00:00
|
|
|
|
|
|
|
extensions = gst_type_find_factory_get_extensions (factory);
|
|
|
|
if (extensions != NULL) {
|
2017-10-20 11:02:35 +00:00
|
|
|
if (!print_all) {
|
2018-10-27 17:06:20 +00:00
|
|
|
print_typefind_extensions (extensions, ELEMENT_DETAIL_COLOR);
|
2004-06-14 11:04:06 +00:00
|
|
|
g_print ("\n");
|
2017-10-20 11:02:35 +00:00
|
|
|
}
|
2004-03-15 19:27:17 +00:00
|
|
|
} else {
|
2004-06-14 11:04:06 +00:00
|
|
|
if (!print_all)
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%sno extensions%s\n", ELEMENT_DETAIL_COLOR, RESET_COLOR);
|
2004-03-15 19:27:17 +00:00
|
|
|
}
|
2004-03-13 15:27:01 +00:00
|
|
|
} else {
|
2016-12-22 00:58:53 +00:00
|
|
|
if (types)
|
|
|
|
goto next;
|
2004-06-14 11:04:06 +00:00
|
|
|
if (!print_all)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%s%s: %s%s%s (%s%s%s)\n", PLUGIN_NAME_COLOR,
|
|
|
|
gst_plugin_get_name (plugin), RESET_COLOR, ELEMENT_NAME_COLOR,
|
|
|
|
GST_OBJECT_NAME (feature), RESET_COLOR, ELEMENT_DETAIL_COLOR,
|
|
|
|
g_type_name (G_OBJECT_TYPE (feature)), RESET_COLOR);
|
2001-08-21 20:16:48 +00:00
|
|
|
}
|
|
|
|
|
2009-10-19 11:30:10 +00:00
|
|
|
next:
|
2001-08-21 20:16:48 +00:00
|
|
|
features = g_list_next (features);
|
|
|
|
}
|
2005-09-22 12:05:05 +00:00
|
|
|
|
|
|
|
gst_plugin_feature_list_free (orig_features);
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|
2005-09-22 12:05:05 +00:00
|
|
|
|
2006-04-04 17:54:30 +00:00
|
|
|
gst_plugin_list_free (orig_plugins);
|
2016-12-22 00:58:53 +00:00
|
|
|
g_strfreev (types);
|
2005-10-07 10:32:24 +00:00
|
|
|
|
2006-05-24 09:00:10 +00:00
|
|
|
g_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (_("%sTotal count%s: %s"), PROP_NAME_COLOR, RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR);
|
2006-05-24 09:00:10 +00:00
|
|
|
g_print (ngettext ("%d plugin", "%d plugins", plugincount), plugincount);
|
2009-01-23 21:15:43 +00:00
|
|
|
if (blacklistcount) {
|
|
|
|
g_print (" (");
|
|
|
|
g_print (ngettext ("%d blacklist entry", "%d blacklist entries",
|
|
|
|
blacklistcount), blacklistcount);
|
|
|
|
g_print (" not shown)");
|
|
|
|
}
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s, %s", RESET_COLOR, PROP_VALUE_COLOR);
|
2006-05-24 09:00:10 +00:00
|
|
|
g_print (ngettext ("%d feature", "%d features", featurecount), featurecount);
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s\n", RESET_COLOR);
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|
|
|
|
|
2008-11-17 15:48:14 +00:00
|
|
|
static void
|
|
|
|
print_all_uri_handlers (void)
|
|
|
|
{
|
|
|
|
GList *plugins, *p, *features, *f;
|
|
|
|
|
2012-01-02 02:22:51 +00:00
|
|
|
plugins = gst_registry_get_plugin_list (gst_registry_get ());
|
2008-11-17 15:48:14 +00:00
|
|
|
|
|
|
|
for (p = plugins; p; p = p->next) {
|
|
|
|
GstPlugin *plugin = (GstPlugin *) (p->data);
|
|
|
|
|
|
|
|
features =
|
2012-01-02 02:22:51 +00:00
|
|
|
gst_registry_get_feature_list_by_plugin (gst_registry_get (),
|
2012-04-29 15:49:57 +00:00
|
|
|
gst_plugin_get_name (plugin));
|
2008-11-17 15:48:14 +00:00
|
|
|
|
|
|
|
for (f = features; f; f = f->next) {
|
2009-02-23 14:24:00 +00:00
|
|
|
GstPluginFeature *feature = GST_PLUGIN_FEATURE (f->data);
|
2008-11-17 15:48:14 +00:00
|
|
|
|
|
|
|
if (GST_IS_ELEMENT_FACTORY (feature)) {
|
|
|
|
GstElementFactory *factory;
|
|
|
|
GstElement *element;
|
|
|
|
|
|
|
|
factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (feature));
|
|
|
|
if (!factory) {
|
2012-04-29 15:49:57 +00:00
|
|
|
g_print ("element plugin %s couldn't be loaded\n",
|
|
|
|
gst_plugin_get_name (plugin));
|
2008-11-17 15:48:14 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
element = gst_element_factory_create (factory, NULL);
|
|
|
|
if (!element) {
|
|
|
|
g_print ("couldn't construct element for %s for some reason\n",
|
|
|
|
GST_OBJECT_NAME (factory));
|
2012-01-27 18:00:03 +00:00
|
|
|
gst_object_unref (factory);
|
2008-11-17 15:48:14 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GST_IS_URI_HANDLER (element)) {
|
2011-11-13 23:25:23 +00:00
|
|
|
const gchar *const *uri_protocols;
|
2018-10-27 17:06:20 +00:00
|
|
|
const gchar *const *protocol;
|
2008-11-17 15:48:14 +00:00
|
|
|
const gchar *dir;
|
|
|
|
|
|
|
|
switch (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element))) {
|
|
|
|
case GST_URI_SRC:
|
|
|
|
dir = "read";
|
|
|
|
break;
|
|
|
|
case GST_URI_SINK:
|
|
|
|
dir = "write";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
dir = "unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%s%s%s (%s%s%s, %srank %u%s): ",
|
|
|
|
FEATURE_NAME_COLOR,
|
|
|
|
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)),
|
|
|
|
RESET_COLOR, FEATURE_DIR_COLOR, dir, RESET_COLOR,
|
|
|
|
FEATURE_RANK_COLOR,
|
2008-11-17 15:48:14 +00:00
|
|
|
gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory)),
|
2018-10-27 17:06:20 +00:00
|
|
|
RESET_COLOR);
|
2008-11-17 15:48:14 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
uri_protocols =
|
|
|
|
gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
|
|
|
|
for (protocol = uri_protocols; *protocol != NULL; protocol++) {
|
|
|
|
if (protocol != uri_protocols)
|
|
|
|
g_print (", ");
|
|
|
|
g_print ("%s%s%s", FEATURE_PROTO_COLOR, *protocol, RESET_COLOR);
|
|
|
|
}
|
|
|
|
g_print ("\n");
|
2008-11-17 15:48:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gst_object_unref (element);
|
2012-01-27 18:00:03 +00:00
|
|
|
gst_object_unref (factory);
|
2008-11-17 15:48:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_plugin_feature_list_free (features);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_plugin_list_free (plugins);
|
|
|
|
}
|
|
|
|
|
2001-08-21 20:16:48 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
print_plugin_info (GstPlugin * plugin)
|
2001-03-07 21:52:56 +00:00
|
|
|
{
|
2012-04-29 15:49:57 +00:00
|
|
|
const gchar *release_date = gst_plugin_get_release_date_string (plugin);
|
|
|
|
const gchar *filename = gst_plugin_get_filename (plugin);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sPlugin Details%s:\n", HEADING_COLOR, RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
push_indent ();
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Name", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_name (plugin), RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Description", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_description (plugin), RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Filename", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, (filename != NULL) ? filename : "(null)", RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Version", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_version (plugin), RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "License", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_license (plugin), RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Source module", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_source (plugin), RESET_COLOR);
|
2012-04-29 15:49:57 +00:00
|
|
|
|
|
|
|
if (release_date != NULL) {
|
2010-07-23 19:46:10 +00:00
|
|
|
const gchar *tz = "(UTC)";
|
|
|
|
gchar *str, *sep;
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
/* may be: YYYY-MM-DD or YYYY-MM-DDTHH:MMZ */
|
|
|
|
/* YYYY-MM-DDTHH:MMZ => YYYY-MM-DD HH:MM (UTC) */
|
2012-04-29 15:49:57 +00:00
|
|
|
str = g_strdup (release_date);
|
2010-07-23 19:46:10 +00:00
|
|
|
sep = strstr (str, "T");
|
|
|
|
if (sep != NULL) {
|
|
|
|
*sep = ' ';
|
|
|
|
sep = strstr (sep + 1, "Z");
|
|
|
|
if (sep != NULL)
|
|
|
|
*sep = ' ';
|
|
|
|
} else {
|
|
|
|
tz = "";
|
|
|
|
}
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-25s%s%s%s%s%s\n", PROP_NAME_COLOR, "Source release date",
|
|
|
|
RESET_COLOR, PROP_VALUE_COLOR, str, tz, RESET_COLOR);
|
2010-07-23 19:46:10 +00:00
|
|
|
g_free (str);
|
|
|
|
}
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Binary package", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_package (plugin), RESET_COLOR);
|
|
|
|
n_print ("%s%-25s%s%s%s%s\n", PROP_NAME_COLOR, "Origin URL", RESET_COLOR,
|
|
|
|
PROP_VALUE_COLOR, gst_plugin_get_origin (plugin), RESET_COLOR);
|
2017-11-25 22:27:08 +00:00
|
|
|
|
|
|
|
pop_indent ();
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2004-08-12 11:50:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_plugin_features (GstPlugin * plugin)
|
|
|
|
{
|
2011-10-14 07:27:38 +00:00
|
|
|
GList *features, *origlist;
|
2004-08-12 11:50:31 +00:00
|
|
|
gint num_features = 0;
|
|
|
|
gint num_elements = 0;
|
2013-10-26 20:05:13 +00:00
|
|
|
gint num_tracers = 0;
|
2009-07-10 18:27:21 +00:00
|
|
|
gint num_typefinders = 0;
|
2014-06-26 18:28:09 +00:00
|
|
|
gint num_devproviders = 0;
|
2004-08-12 11:50:31 +00:00
|
|
|
gint num_other = 0;
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2011-10-14 07:27:38 +00:00
|
|
|
origlist = features =
|
2012-01-02 02:22:51 +00:00
|
|
|
gst_registry_get_feature_list_by_plugin (gst_registry_get (),
|
2012-04-29 15:49:57 +00:00
|
|
|
gst_plugin_get_name (plugin));
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2001-08-21 20:16:48 +00:00
|
|
|
while (features) {
|
|
|
|
GstPluginFeature *feature;
|
2001-03-07 21:52:56 +00:00
|
|
|
|
2001-08-21 20:16:48 +00:00
|
|
|
feature = GST_PLUGIN_FEATURE (features->data);
|
2001-03-07 21:52:56 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
if (GST_IS_ELEMENT_FACTORY (feature)) {
|
2001-08-21 20:16:48 +00:00
|
|
|
GstElementFactory *factory;
|
2001-03-07 21:52:56 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
factory = GST_ELEMENT_FACTORY (feature);
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%s%s: %s%s%s\n", ELEMENT_NAME_COLOR,
|
|
|
|
GST_OBJECT_NAME (factory), RESET_COLOR, ELEMENT_DETAIL_COLOR,
|
2012-09-15 16:43:39 +00:00
|
|
|
gst_element_factory_get_metadata (factory,
|
2018-10-27 17:06:20 +00:00
|
|
|
GST_ELEMENT_METADATA_LONGNAME), RESET_COLOR);
|
2002-11-27 20:47:39 +00:00
|
|
|
num_elements++;
|
Remove GST_DISABLE_(ENUMTYPES|INDEX|URI) everywhere.
Original commit message from CVS:
* configure.ac:
* docs/gst/gstreamer-sections.txt:
* docs/gst/gstreamer.types:
* docs/gst/gstreamer.types.in:
* gst/Makefile.am:
* gst/gst.c:
* gst/gstbin.c: (gst_bin_class_init), (gst_bin_set_index_func):
* gst/gstconfig.h.in:
* gst/gstelement.c: (gst_element_get_index):
* gst/gstregistrybinary.c: (gst_registry_binary_save_feature),
(gst_registry_binary_load_feature),
(gst_registry_binary_read_cache):
* gst/gstregistryxml.c: (load_feature),
(gst_registry_xml_read_cache), (gst_registry_xml_save_feature):
* plugins/Makefile.am:
* tools/gst-indent:
* tools/gst-inspect.c: (print_index_info), (print_element_list),
(print_plugin_features), (print_element_features):
* tools/gst-xmlinspect.c: (print_event_masks),
(print_element_info):
* win32/common/gstconfig.h:
Remove GST_DISABLE_(ENUMTYPES|INDEX|URI) everywhere.
Disabling the indexers and URI handler code will only reduce the
required amount of memory by a very small amount but on the other hand
requires much more maintaince work. Apart from that many places of
code are broken when disabling them.
Disabling the enum types doesn't reduce the required amount of memory
by more than a few bytes and makes it hard to fix bugs like #539772,
i.e. use the enums as GObject properties.
2008-07-31 15:20:32 +00:00
|
|
|
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
|
2003-10-28 20:25:30 +00:00
|
|
|
GstTypeFindFactory *factory;
|
2012-05-01 21:28:11 +00:00
|
|
|
const gchar *const *extensions;
|
2003-10-28 20:25:30 +00:00
|
|
|
|
|
|
|
factory = GST_TYPE_FIND_FACTORY (feature);
|
2012-05-01 21:28:11 +00:00
|
|
|
extensions = gst_type_find_factory_get_extensions (factory);
|
|
|
|
if (extensions) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (" %s%s%s: ", ELEMENT_NAME_COLOR,
|
|
|
|
gst_plugin_feature_get_name (feature), RESET_COLOR);
|
|
|
|
print_typefind_extensions (extensions, ELEMENT_DETAIL_COLOR);
|
2004-10-19 09:33:58 +00:00
|
|
|
g_print ("\n");
|
2003-10-28 20:25:30 +00:00
|
|
|
} else
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print (" %s%s%s: %sno extensions%s\n", ELEMENT_NAME_COLOR,
|
|
|
|
gst_plugin_feature_get_name (feature), RESET_COLOR,
|
|
|
|
ELEMENT_DETAIL_COLOR, RESET_COLOR);
|
2001-08-21 20:16:48 +00:00
|
|
|
|
2009-07-10 18:27:21 +00:00
|
|
|
num_typefinders++;
|
2014-06-26 18:28:09 +00:00
|
|
|
} else if (GST_IS_DEVICE_PROVIDER_FACTORY (feature)) {
|
|
|
|
GstDeviceProviderFactory *factory;
|
2014-03-17 00:50:53 +00:00
|
|
|
|
2014-06-26 18:28:09 +00:00
|
|
|
factory = GST_DEVICE_PROVIDER_FACTORY (feature);
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%s%s: %s%s%s\n", ELEMENT_NAME_COLOR,
|
|
|
|
GST_OBJECT_NAME (factory), RESET_COLOR, ELEMENT_DETAIL_COLOR,
|
2014-06-26 18:28:09 +00:00
|
|
|
gst_device_provider_factory_get_metadata (factory,
|
2018-10-27 17:06:20 +00:00
|
|
|
GST_ELEMENT_METADATA_LONGNAME), RESET_COLOR);
|
2014-06-26 18:28:09 +00:00
|
|
|
num_devproviders++;
|
2013-10-26 20:05:13 +00:00
|
|
|
} else if (GST_IS_TRACER_FACTORY (feature)) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%s%s (%s%s%s)\n", ELEMENT_NAME_COLOR,
|
|
|
|
gst_object_get_name (GST_OBJECT (feature)), RESET_COLOR,
|
|
|
|
DATATYPE_COLOR, g_type_name (G_OBJECT_TYPE (feature)), RESET_COLOR);
|
2013-10-26 20:05:13 +00:00
|
|
|
num_tracers++;
|
2009-10-19 11:30:10 +00:00
|
|
|
} else if (feature) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%s%s (%s%s%s)\n", ELEMENT_NAME_COLOR,
|
|
|
|
gst_object_get_name (GST_OBJECT (feature)), RESET_COLOR,
|
|
|
|
DATATYPE_COLOR, g_type_name (G_OBJECT_TYPE (feature)), RESET_COLOR);
|
2002-11-27 20:47:39 +00:00
|
|
|
num_other++;
|
2001-08-21 20:16:48 +00:00
|
|
|
}
|
2002-11-27 20:47:39 +00:00
|
|
|
num_features++;
|
2001-08-21 20:16:48 +00:00
|
|
|
features = g_list_next (features);
|
2001-03-07 21:52:56 +00:00
|
|
|
}
|
2011-10-14 07:27:38 +00:00
|
|
|
|
|
|
|
gst_plugin_feature_list_free (origlist);
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%d features%s:\n", HEADING_COLOR, num_features, RESET_COLOR);
|
2002-11-27 20:47:39 +00:00
|
|
|
if (num_elements > 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s+--%s %s%d elements%s\n", CHILD_LINK_COLOR, RESET_COLOR,
|
|
|
|
PLUGIN_FEATURE_COLOR, num_elements, RESET_COLOR);
|
2009-07-10 18:27:21 +00:00
|
|
|
if (num_typefinders > 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s+--%s %s%d typefinders%s\n", CHILD_LINK_COLOR, RESET_COLOR,
|
|
|
|
PLUGIN_FEATURE_COLOR, num_typefinders, RESET_COLOR);
|
2014-06-26 18:28:09 +00:00
|
|
|
if (num_devproviders > 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s+--%s %s%d device providers%s\n", CHILD_LINK_COLOR,
|
|
|
|
RESET_COLOR, PLUGIN_FEATURE_COLOR, num_devproviders, RESET_COLOR);
|
2013-10-26 20:05:13 +00:00
|
|
|
if (num_tracers > 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s+--%s %s%d tracers%s\n", CHILD_LINK_COLOR, RESET_COLOR,
|
|
|
|
PLUGIN_FEATURE_COLOR, num_tracers, RESET_COLOR);
|
2002-11-27 20:47:39 +00:00
|
|
|
if (num_other > 0)
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s+--%s %s%d other objects%s\n", CHILD_LINK_COLOR, RESET_COLOR,
|
|
|
|
PLUGIN_FEATURE_COLOR, num_other, RESET_COLOR);
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
n_print ("\n");
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|
|
|
|
|
2004-05-23 17:52:54 +00:00
|
|
|
static int
|
2017-10-20 09:08:14 +00:00
|
|
|
print_feature_info (const gchar * feature_name, gboolean print_all)
|
2004-05-23 17:52:54 +00:00
|
|
|
{
|
|
|
|
GstPluginFeature *feature;
|
2017-10-20 09:08:14 +00:00
|
|
|
GstRegistry *registry = gst_registry_get ();
|
2017-10-20 11:02:35 +00:00
|
|
|
int ret;
|
2004-05-23 17:52:54 +00:00
|
|
|
|
2017-10-20 11:02:35 +00:00
|
|
|
if ((feature = gst_registry_find_feature (registry, feature_name,
|
|
|
|
GST_TYPE_ELEMENT_FACTORY))) {
|
|
|
|
ret = print_element_info (feature, print_all);
|
|
|
|
goto handled;
|
2017-10-20 09:08:14 +00:00
|
|
|
}
|
2017-10-20 11:02:35 +00:00
|
|
|
if ((feature = gst_registry_find_feature (registry, feature_name,
|
|
|
|
GST_TYPE_TYPE_FIND_FACTORY))) {
|
|
|
|
ret = print_typefind_info (feature, print_all);
|
|
|
|
goto handled;
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
2017-10-20 11:02:35 +00:00
|
|
|
if ((feature = gst_registry_find_feature (registry, feature_name,
|
|
|
|
GST_TYPE_TRACER_FACTORY))) {
|
|
|
|
ret = print_tracer_info (feature, print_all);
|
|
|
|
goto handled;
|
2013-10-26 20:05:13 +00:00
|
|
|
}
|
2004-05-23 18:41:25 +00:00
|
|
|
|
2017-10-20 11:02:35 +00:00
|
|
|
/* TODO: handle DEVICE_PROVIDER_FACTORY */
|
|
|
|
|
2004-05-23 18:41:25 +00:00
|
|
|
return -1;
|
2017-10-20 11:02:35 +00:00
|
|
|
|
|
|
|
handled:
|
|
|
|
gst_object_unref (feature);
|
|
|
|
return ret;
|
2004-05-23 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
static int
|
2017-10-20 09:16:46 +00:00
|
|
|
print_element_info (GstPluginFeature * feature, gboolean print_names)
|
2004-06-14 11:04:06 +00:00
|
|
|
{
|
2017-10-20 09:16:46 +00:00
|
|
|
GstElementFactory *factory;
|
2004-06-14 11:04:06 +00:00
|
|
|
GstElement *element;
|
2012-05-19 16:23:43 +00:00
|
|
|
GstPlugin *plugin;
|
2004-06-14 11:04:06 +00:00
|
|
|
gint maxlevel = 0;
|
|
|
|
|
2017-10-20 09:16:46 +00:00
|
|
|
factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (feature));
|
2005-10-04 11:10:04 +00:00
|
|
|
if (!factory) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%selement plugin couldn't be loaded%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2005-10-04 11:10:04 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2004-06-14 11:04:06 +00:00
|
|
|
element = gst_element_factory_create (factory, NULL);
|
|
|
|
if (!element) {
|
2012-01-13 10:43:12 +00:00
|
|
|
gst_object_unref (factory);
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%scouldn't construct element for some reason%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2004-06-14 11:04:06 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (print_names)
|
2018-10-27 17:06:20 +00:00
|
|
|
_name =
|
|
|
|
g_strdup_printf ("%s%s%s: ", DATATYPE_COLOR, GST_OBJECT_NAME (factory),
|
|
|
|
RESET_COLOR);
|
2004-06-14 11:04:06 +00:00
|
|
|
else
|
2007-10-15 07:11:04 +00:00
|
|
|
_name = NULL;
|
2004-06-14 11:04:06 +00:00
|
|
|
|
|
|
|
print_factory_details_info (factory);
|
2004-08-12 11:50:31 +00:00
|
|
|
|
2012-05-19 16:23:43 +00:00
|
|
|
plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
|
|
|
|
if (plugin) {
|
|
|
|
print_plugin_info (plugin);
|
|
|
|
gst_object_unref (plugin);
|
2004-08-12 11:50:31 +00:00
|
|
|
}
|
2004-06-14 11:04:06 +00:00
|
|
|
|
|
|
|
print_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
|
ported gstchildproxy over from 0.8 ported gst-inspect fixes and enhancements over from 0.8
Original commit message from CVS:
* docs/gst/gstreamer-docs.sgml:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstbin.c: (gst_bin_get_type),
(gst_bin_child_proxy_get_child_by_index),
(gst_bin_child_proxy_get_children_count),
(gst_bin_child_proxy_init):
* gst/gstchildproxy.c: (gst_child_proxy_get_child_by_name),
(gst_child_proxy_get_child_by_index),
(gst_child_proxy_get_children_count), (gst_child_proxy_lookup),
(gst_child_proxy_get_property), (gst_child_proxy_get_valist),
(gst_child_proxy_get), (gst_child_proxy_set_property),
(gst_child_proxy_set_valist), (gst_child_proxy_set),
(gst_child_proxy_child_added), (gst_child_proxy_child_removed),
(gst_child_proxy_base_init), (gst_child_proxy_get_type):
* gst/gstchildproxy.h:
* gst/parse/grammar.y:
* tools/gst-inspect.c: (print_interfaces),
(print_element_properties_info), (print_element_info):
ported gstchildproxy over from 0.8
ported gst-inspect fixes and enhancements over from 0.8
2005-08-22 21:03:33 +00:00
|
|
|
print_interfaces (G_OBJECT_TYPE (element));
|
2004-06-14 11:04:06 +00:00
|
|
|
|
|
|
|
print_pad_templates_info (element, factory);
|
|
|
|
print_clocking_info (element);
|
2008-04-20 09:55:25 +00:00
|
|
|
print_uri_handler_info (element);
|
2004-06-14 11:04:06 +00:00
|
|
|
print_pad_info (element);
|
|
|
|
print_element_properties_info (element);
|
|
|
|
print_signal_info (element);
|
|
|
|
print_children_info (element);
|
2014-12-15 13:03:54 +00:00
|
|
|
print_preset_list (element);
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2008-02-02 06:48:37 +00:00
|
|
|
gst_object_unref (element);
|
2006-12-07 12:11:14 +00:00
|
|
|
gst_object_unref (factory);
|
2007-10-15 14:33:16 +00:00
|
|
|
g_free (_name);
|
2017-10-20 11:02:35 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
print_typefind_info (GstPluginFeature * feature, gboolean print_names)
|
|
|
|
{
|
|
|
|
GstTypeFindFactory *factory;
|
|
|
|
GstPlugin *plugin;
|
|
|
|
GstCaps *caps;
|
|
|
|
GstRank rank;
|
|
|
|
char s[20];
|
|
|
|
const gchar *const *extensions;
|
|
|
|
|
|
|
|
factory = GST_TYPE_FIND_FACTORY (gst_plugin_feature_load (feature));
|
|
|
|
if (!factory) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%stypefind plugin couldn't be loaded%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (print_names)
|
2018-10-27 17:06:20 +00:00
|
|
|
_name =
|
|
|
|
g_strdup_printf ("%s%s%s: ", DATATYPE_COLOR, GST_OBJECT_NAME (factory),
|
|
|
|
RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
else
|
|
|
|
_name = NULL;
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFactory Details%s:\n", HEADING_COLOR, RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
rank = gst_plugin_feature_get_rank (feature);
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%-25s%s%s (%d)%s\n", PROP_NAME_COLOR, "Rank", PROP_VALUE_COLOR,
|
|
|
|
get_rank_name (s, rank), rank, RESET_COLOR);
|
|
|
|
n_print (" %s%-25s%s%s%s\n", PROP_NAME_COLOR, "Name", PROP_VALUE_COLOR,
|
|
|
|
GST_OBJECT_NAME (factory), RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
caps = gst_type_find_factory_get_caps (factory);
|
|
|
|
if (caps) {
|
|
|
|
gchar *caps_str = gst_caps_to_string (factory->caps);
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%-25s%s%s%s\n", PROP_NAME_COLOR, "Caps", PROP_VALUE_COLOR,
|
|
|
|
caps_str, RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
g_free (caps_str);
|
|
|
|
}
|
|
|
|
extensions = gst_type_find_factory_get_extensions (factory);
|
|
|
|
if (extensions) {
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print (" %s%-25s%s", PROP_NAME_COLOR, "Extensions", RESET_COLOR);
|
|
|
|
print_typefind_extensions (extensions, PROP_VALUE_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
n_print ("\n");
|
|
|
|
}
|
|
|
|
n_print ("\n");
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2017-10-20 11:02:35 +00:00
|
|
|
plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
|
|
|
|
if (plugin) {
|
|
|
|
print_plugin_info (plugin);
|
|
|
|
gst_object_unref (plugin);
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_object_unref (factory);
|
|
|
|
g_free (_name);
|
2004-06-14 11:04:06 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2017-10-20 11:02:35 +00:00
|
|
|
static int
|
|
|
|
print_tracer_info (GstPluginFeature * feature, gboolean print_names)
|
|
|
|
{
|
|
|
|
GstTracerFactory *factory;
|
|
|
|
GstTracer *tracer;
|
|
|
|
GstPlugin *plugin;
|
|
|
|
gint maxlevel = 0;
|
|
|
|
|
|
|
|
factory = GST_TRACER_FACTORY (gst_plugin_feature_load (feature));
|
|
|
|
if (!factory) {
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%stracer plugin couldn't be loaded%s\n", DESC_COLOR, RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
tracer = (GstTracer *) g_object_new (factory->type, NULL);
|
|
|
|
if (!tracer) {
|
|
|
|
gst_object_unref (factory);
|
2018-10-27 17:06:20 +00:00
|
|
|
g_print ("%scouldn't construct tracer for some reason%s\n", DESC_COLOR,
|
|
|
|
RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (print_names)
|
2018-10-27 17:06:20 +00:00
|
|
|
_name =
|
|
|
|
g_strdup_printf ("%s%s%s: ", DATATYPE_COLOR, GST_OBJECT_NAME (factory),
|
|
|
|
RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
else
|
|
|
|
_name = NULL;
|
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
n_print ("%sFactory Details%s:\n", HEADING_COLOR, RESET_COLOR);
|
|
|
|
n_print (" %s%-25s%s%s%s\n", PROP_NAME_COLOR, "Name", PROP_VALUE_COLOR,
|
|
|
|
GST_OBJECT_NAME (factory), RESET_COLOR);
|
2017-10-20 11:02:35 +00:00
|
|
|
n_print ("\n");
|
|
|
|
|
|
|
|
plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
|
|
|
|
if (plugin) {
|
|
|
|
print_plugin_info (plugin);
|
|
|
|
gst_object_unref (plugin);
|
|
|
|
}
|
|
|
|
|
|
|
|
print_hierarchy (G_OBJECT_TYPE (tracer), 0, &maxlevel);
|
|
|
|
print_interfaces (G_OBJECT_TYPE (tracer));
|
|
|
|
|
|
|
|
/* TODO: list what hooks it registers
|
|
|
|
* - the data is available in gsttracerutils, we need to iterate the
|
|
|
|
* _priv_tracers hashtable for each probe and then check the list of hooks
|
|
|
|
* for each probe whether hook->tracer == tracer :/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* TODO: list what records it emits
|
|
|
|
* - in class_init tracers can create GstTracerRecord instances
|
|
|
|
* - those only get logged right now and there is no association with the
|
|
|
|
* tracer that created them
|
|
|
|
* - we'd need to add them to GstTracerFactory
|
|
|
|
* gst_tracer_class_add_record (klass, record);
|
2017-12-26 11:17:53 +00:00
|
|
|
* - needs work in gstregistrychunks to (de)serialize specs
|
|
|
|
* - gst_tracer_register() would need to iterate the list of records and
|
|
|
|
* copy the record->spec into the factory
|
2017-10-20 11:02:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
gst_object_unref (tracer);
|
|
|
|
gst_object_unref (factory);
|
|
|
|
g_free (_name);
|
|
|
|
return 0;
|
|
|
|
}
|
2007-01-11 14:16:23 +00:00
|
|
|
|
2018-10-27 17:06:20 +00:00
|
|
|
/* NOTE: Not coloring output from automatic install functions, as their output
|
|
|
|
* is meant for machines, not humans.
|
|
|
|
*/
|
2007-01-11 14:16:23 +00:00
|
|
|
static void
|
|
|
|
print_plugin_automatic_install_info_codecs (GstElementFactory * factory)
|
|
|
|
{
|
|
|
|
GstPadDirection direction;
|
|
|
|
const gchar *type_name;
|
|
|
|
const gchar *klass;
|
|
|
|
const GList *static_templates, *l;
|
|
|
|
GstCaps *caps = NULL;
|
|
|
|
guint i, num;
|
|
|
|
|
2012-09-15 16:43:39 +00:00
|
|
|
klass =
|
|
|
|
gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
|
2007-01-11 14:16:23 +00:00
|
|
|
g_return_if_fail (klass != NULL);
|
|
|
|
|
|
|
|
if (strstr (klass, "Demuxer") ||
|
|
|
|
strstr (klass, "Decoder") ||
|
|
|
|
strstr (klass, "Depay") || strstr (klass, "Parser")) {
|
|
|
|
type_name = "decoder";
|
|
|
|
direction = GST_PAD_SINK;
|
|
|
|
} else if (strstr (klass, "Muxer") ||
|
|
|
|
strstr (klass, "Encoder") || strstr (klass, "Pay")) {
|
|
|
|
type_name = "encoder";
|
|
|
|
direction = GST_PAD_SRC;
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* decoder/demuxer sink pads should always be static and there should only
|
|
|
|
* be one, the same applies to encoders/muxers and source pads */
|
|
|
|
static_templates = gst_element_factory_get_static_pad_templates (factory);
|
|
|
|
for (l = static_templates; l != NULL; l = l->next) {
|
|
|
|
GstStaticPadTemplate *tmpl = NULL;
|
|
|
|
|
|
|
|
tmpl = (GstStaticPadTemplate *) l->data;
|
|
|
|
if (tmpl->direction == direction) {
|
|
|
|
caps = gst_static_pad_template_get_caps (tmpl);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (caps == NULL) {
|
|
|
|
g_printerr ("Couldn't find static pad template for %s '%s'\n",
|
2011-05-24 16:17:24 +00:00
|
|
|
type_name, GST_OBJECT_NAME (factory));
|
2007-01-11 14:16:23 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
caps = gst_caps_make_writable (caps);
|
|
|
|
num = gst_caps_get_size (caps);
|
|
|
|
for (i = 0; i < num; ++i) {
|
|
|
|
GstStructure *s;
|
|
|
|
gchar *s_str;
|
|
|
|
|
|
|
|
s = gst_caps_get_structure (caps, i);
|
|
|
|
/* remove fields that are almost always just MIN-MAX of some sort
|
|
|
|
* in order to make the caps look less messy */
|
|
|
|
gst_structure_remove_field (s, "pixel-aspect-ratio");
|
|
|
|
gst_structure_remove_field (s, "framerate");
|
|
|
|
gst_structure_remove_field (s, "channels");
|
|
|
|
gst_structure_remove_field (s, "width");
|
|
|
|
gst_structure_remove_field (s, "height");
|
|
|
|
gst_structure_remove_field (s, "rate");
|
|
|
|
gst_structure_remove_field (s, "depth");
|
|
|
|
gst_structure_remove_field (s, "clock-rate");
|
|
|
|
s_str = gst_structure_to_string (s);
|
|
|
|
g_print ("%s-%s\n", type_name, s_str);
|
|
|
|
g_free (s_str);
|
|
|
|
}
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_plugin_automatic_install_info_protocols (GstElementFactory * factory)
|
|
|
|
{
|
2011-11-13 23:25:23 +00:00
|
|
|
const gchar *const *protocols;
|
2007-01-11 14:16:23 +00:00
|
|
|
|
|
|
|
protocols = gst_element_factory_get_uri_protocols (factory);
|
|
|
|
if (protocols != NULL && *protocols != NULL) {
|
|
|
|
switch (gst_element_factory_get_uri_type (factory)) {
|
|
|
|
case GST_URI_SINK:
|
2011-11-13 23:25:23 +00:00
|
|
|
while (*protocols != NULL) {
|
|
|
|
g_print ("urisink-%s\n", *protocols);
|
|
|
|
++protocols;
|
|
|
|
}
|
2007-01-11 14:16:23 +00:00
|
|
|
break;
|
|
|
|
case GST_URI_SRC:
|
2011-11-13 23:25:23 +00:00
|
|
|
while (*protocols != NULL) {
|
|
|
|
g_print ("urisource-%s\n", *protocols);
|
|
|
|
++protocols;
|
|
|
|
}
|
2007-01-11 14:16:23 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
print_plugin_automatic_install_info (GstPlugin * plugin)
|
|
|
|
{
|
|
|
|
GList *features, *l;
|
|
|
|
|
|
|
|
/* not interested in typefind factories, only element factories */
|
2012-01-02 02:22:51 +00:00
|
|
|
features = gst_registry_get_feature_list (gst_registry_get (),
|
2007-01-11 14:16:23 +00:00
|
|
|
GST_TYPE_ELEMENT_FACTORY);
|
|
|
|
|
|
|
|
for (l = features; l != NULL; l = l->next) {
|
|
|
|
GstPluginFeature *feature;
|
2012-05-19 16:23:43 +00:00
|
|
|
GstPlugin *feature_plugin;
|
2007-01-11 14:16:23 +00:00
|
|
|
|
|
|
|
feature = GST_PLUGIN_FEATURE (l->data);
|
|
|
|
|
|
|
|
/* only interested in the ones that are in the plugin we just loaded */
|
2012-05-19 16:23:43 +00:00
|
|
|
feature_plugin = gst_plugin_feature_get_plugin (feature);
|
|
|
|
if (feature_plugin == plugin) {
|
2007-01-11 14:16:23 +00:00
|
|
|
GstElementFactory *factory;
|
|
|
|
|
|
|
|
g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
|
|
|
|
|
|
|
|
factory = GST_ELEMENT_FACTORY (feature);
|
|
|
|
print_plugin_automatic_install_info_protocols (factory);
|
|
|
|
print_plugin_automatic_install_info_codecs (factory);
|
|
|
|
}
|
2012-05-19 16:23:43 +00:00
|
|
|
if (feature_plugin)
|
|
|
|
gst_object_unref (feature_plugin);
|
2007-01-11 14:16:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_list_foreach (features, (GFunc) gst_object_unref, NULL);
|
|
|
|
g_list_free (features);
|
|
|
|
}
|
|
|
|
|
2009-11-09 12:55:54 +00:00
|
|
|
static void
|
|
|
|
print_all_plugin_automatic_install_info (void)
|
|
|
|
{
|
|
|
|
GList *plugins, *orig_plugins;
|
|
|
|
|
2012-01-02 02:22:51 +00:00
|
|
|
orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
|
2009-11-09 12:55:54 +00:00
|
|
|
while (plugins) {
|
|
|
|
GstPlugin *plugin;
|
|
|
|
|
|
|
|
plugin = (GstPlugin *) (plugins->data);
|
|
|
|
plugins = g_list_next (plugins);
|
|
|
|
|
|
|
|
print_plugin_automatic_install_info (plugin);
|
|
|
|
}
|
|
|
|
gst_plugin_list_free (orig_plugins);
|
|
|
|
}
|
|
|
|
|
2018-10-27 12:38:57 +00:00
|
|
|
#ifdef G_OS_UNIX
|
2019-01-08 12:23:44 +00:00
|
|
|
static gboolean
|
2018-10-27 12:38:57 +00:00
|
|
|
redirect_stdout (void)
|
|
|
|
{
|
2019-01-08 12:23:44 +00:00
|
|
|
GError *error = NULL;
|
|
|
|
gchar **argv;
|
|
|
|
const gchar *pager;
|
|
|
|
gint stdin_fd;
|
|
|
|
gchar **envp;
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
pager = g_getenv ("PAGER");
|
|
|
|
if (pager == NULL)
|
|
|
|
pager = DEFAULT_PAGER;
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
argv = g_strsplit (pager, " ", 0);
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
envp = g_get_environ ();
|
2019-01-24 18:52:46 +00:00
|
|
|
envp = g_environ_setenv (envp, "LESS", DEFAULT_LESS_OPTS, TRUE);
|
2019-01-08 12:23:44 +00:00
|
|
|
|
|
|
|
if (!g_spawn_async_with_pipes (NULL, argv, envp,
|
|
|
|
G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
|
|
|
|
NULL, NULL, &child_pid, &stdin_fd,
|
|
|
|
/* pass null stdout/stderr to inherit our fds */
|
|
|
|
NULL, NULL, &error)) {
|
|
|
|
g_warning ("g_spawn_async_with_pipes() failed: %s\n",
|
|
|
|
GST_STR_NULL (error->message));
|
2018-10-27 12:38:57 +00:00
|
|
|
g_strfreev (argv);
|
2019-01-08 12:23:44 +00:00
|
|
|
g_strfreev (envp);
|
|
|
|
g_clear_error (&error);
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
/* redirect our stdout to child stdin */
|
|
|
|
dup2 (stdin_fd, STDOUT_FILENO);
|
|
|
|
if (isatty (STDERR_FILENO))
|
|
|
|
dup2 (stdin_fd, STDERR_FILENO);
|
|
|
|
close (stdin_fd);
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
g_strfreev (argv);
|
|
|
|
g_strfreev (envp);
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2018-10-27 12:38:57 +00:00
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
static void
|
|
|
|
child_exit_cb (GPid child_pid, gint status, gpointer user_data)
|
|
|
|
{
|
|
|
|
g_spawn_close_pid (child_pid);
|
|
|
|
g_main_loop_quit (loop);
|
2018-10-27 12:38:57 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-03-16 20:06:02 +00:00
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
2001-08-21 20:16:48 +00:00
|
|
|
{
|
2005-09-18 07:41:28 +00:00
|
|
|
gboolean print_all = FALSE;
|
2009-01-23 21:15:43 +00:00
|
|
|
gboolean do_print_blacklist = FALSE;
|
2008-11-12 16:55:00 +00:00
|
|
|
gboolean plugin_name = FALSE;
|
2007-01-11 14:16:23 +00:00
|
|
|
gboolean print_aii = FALSE;
|
2008-11-17 15:48:14 +00:00
|
|
|
gboolean uri_handlers = FALSE;
|
2012-09-01 16:47:58 +00:00
|
|
|
gboolean check_exists = FALSE;
|
|
|
|
gchar *min_version = NULL;
|
|
|
|
guint minver_maj = GST_VERSION_MAJOR;
|
|
|
|
guint minver_min = GST_VERSION_MINOR;
|
|
|
|
guint minver_micro = 0;
|
2016-12-22 00:58:53 +00:00
|
|
|
gchar *types = NULL;
|
2018-11-24 13:51:19 +00:00
|
|
|
const gchar *no_colors;
|
2019-01-08 12:23:44 +00:00
|
|
|
int exit_code = 0;
|
2009-07-08 13:15:04 +00:00
|
|
|
#ifndef GST_DISABLE_OPTION_PARSING
|
Merged in popt removal + GOption addition patch from Ronald, bug #169772.
Original commit message from CVS:
2005-10-10 Andy Wingo <wingo@pobox.com>
Merged in popt removal + GOption addition patch from Ronald, bug
#169772.
* docs/gst/gstreamer-sections.txt: Add STATE_(UN)LOCK_FULL, move
GstElement macros around, remove popt-related symbols, add goption
stuff.
* configure.ac: Remove popt checks, require GLib 2.6 for GOption.
* docs/gst/Makefile.am:
* docs/libs/Makefile.am: No POPT_CFLAGS.
* examples/manual/Makefile.am:
* docs/manual/basics-init.xml: Doc updates with an example.
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(gst_init), (parse_one_option), (parse_goption_arg):
* gst/gst.h: Removed gst_init_with_popt_table and friends. Took a
bit of hand merging and debugging to get the GOption stuff working
tho.
* tests/Makefile.am:
* tools/Makefile.am:
* tools/gst-inspect.c: (main):
* tools/gst-launch.c: (main):
* tools/gst-run.c: (main):
* tools/gst-xmlinspect.c: (main): Thanks Ronald!
2005-10-10 15:53:59 +00:00
|
|
|
GOptionEntry options[] = {
|
|
|
|
{"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
|
2005-09-18 07:41:28 +00:00
|
|
|
N_("Print all elements"), NULL},
|
2009-01-23 21:15:43 +00:00
|
|
|
{"print-blacklist", 'b', 0, G_OPTION_ARG_NONE, &do_print_blacklist,
|
|
|
|
N_("Print list of blacklisted files"), NULL},
|
2007-01-11 14:16:23 +00:00
|
|
|
{"print-plugin-auto-install-info", '\0', 0, G_OPTION_ARG_NONE, &print_aii,
|
|
|
|
N_("Print a machine-parsable list of features the specified plugin "
|
2009-11-09 12:55:54 +00:00
|
|
|
"or all plugins provide.\n "
|
2007-01-11 14:16:23 +00:00
|
|
|
"Useful in connection with external automatic plugin "
|
|
|
|
"installation mechanisms"), NULL},
|
2008-11-12 16:55:00 +00:00
|
|
|
{"plugin", '\0', 0, G_OPTION_ARG_NONE, &plugin_name,
|
|
|
|
N_("List the plugin contents"), NULL},
|
2016-12-22 00:58:53 +00:00
|
|
|
{"types", 't', 0, G_OPTION_ARG_STRING, &types,
|
|
|
|
N_("A slashes ('/') separated list of types of elements (also known "
|
|
|
|
"as klass) to list. (unordered)"), NULL},
|
2012-09-01 16:47:58 +00:00
|
|
|
{"exists", '\0', 0, G_OPTION_ARG_NONE, &check_exists,
|
|
|
|
N_("Check if the specified element or plugin exists"), NULL},
|
|
|
|
{"atleast-version", '\0', 0, G_OPTION_ARG_STRING, &min_version,
|
|
|
|
N_
|
|
|
|
("When checking if an element or plugin exists, also check that its "
|
|
|
|
"version is at least the version specified"), NULL},
|
2008-11-17 15:48:14 +00:00
|
|
|
{"uri-handlers", 'u', 0, G_OPTION_ARG_NONE, &uri_handlers,
|
|
|
|
N_
|
|
|
|
("Print supported URI schemes, with the elements that implement them"),
|
|
|
|
NULL},
|
2018-10-27 17:06:20 +00:00
|
|
|
{"no-colors", '\0', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE,
|
|
|
|
&colored_output,
|
|
|
|
N_
|
|
|
|
("Disable colors in output. You can also achieve the same by setting"
|
|
|
|
"'GST_INSPECT_NO_COLORS' environment variable to any value."),
|
|
|
|
NULL},
|
2006-05-05 17:07:42 +00:00
|
|
|
GST_TOOLS_GOPTION_VERSION,
|
Merged in popt removal + GOption addition patch from Ronald, bug #169772.
Original commit message from CVS:
2005-10-10 Andy Wingo <wingo@pobox.com>
Merged in popt removal + GOption addition patch from Ronald, bug
#169772.
* docs/gst/gstreamer-sections.txt: Add STATE_(UN)LOCK_FULL, move
GstElement macros around, remove popt-related symbols, add goption
stuff.
* configure.ac: Remove popt checks, require GLib 2.6 for GOption.
* docs/gst/Makefile.am:
* docs/libs/Makefile.am: No POPT_CFLAGS.
* examples/manual/Makefile.am:
* docs/manual/basics-init.xml: Doc updates with an example.
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(gst_init), (parse_one_option), (parse_goption_arg):
* gst/gst.h: Removed gst_init_with_popt_table and friends. Took a
bit of hand merging and debugging to get the GOption stuff working
tho.
* tests/Makefile.am:
* tools/Makefile.am:
* tools/gst-inspect.c: (main):
* tools/gst-launch.c: (main):
* tools/gst-run.c: (main):
* tools/gst-xmlinspect.c: (main): Thanks Ronald!
2005-10-10 15:53:59 +00:00
|
|
|
{NULL}
|
2005-09-18 07:41:28 +00:00
|
|
|
};
|
Merged in popt removal + GOption addition patch from Ronald, bug #169772.
Original commit message from CVS:
2005-10-10 Andy Wingo <wingo@pobox.com>
Merged in popt removal + GOption addition patch from Ronald, bug
#169772.
* docs/gst/gstreamer-sections.txt: Add STATE_(UN)LOCK_FULL, move
GstElement macros around, remove popt-related symbols, add goption
stuff.
* configure.ac: Remove popt checks, require GLib 2.6 for GOption.
* docs/gst/Makefile.am:
* docs/libs/Makefile.am: No POPT_CFLAGS.
* examples/manual/Makefile.am:
* docs/manual/basics-init.xml: Doc updates with an example.
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(gst_init), (parse_one_option), (parse_goption_arg):
* gst/gst.h: Removed gst_init_with_popt_table and friends. Took a
bit of hand merging and debugging to get the GOption stuff working
tho.
* tests/Makefile.am:
* tools/Makefile.am:
* tools/gst-inspect.c: (main):
* tools/gst-launch.c: (main):
* tools/gst-run.c: (main):
* tools/gst-xmlinspect.c: (main): Thanks Ronald!
2005-10-10 15:53:59 +00:00
|
|
|
GOptionContext *ctx;
|
|
|
|
GError *err = NULL;
|
2009-07-08 13:15:04 +00:00
|
|
|
#endif
|
2002-09-15 18:59:27 +00:00
|
|
|
|
2014-01-30 20:24:21 +00:00
|
|
|
setlocale (LC_ALL, "");
|
|
|
|
|
2005-10-11 16:05:16 +00:00
|
|
|
#ifdef ENABLE_NLS
|
2004-02-03 11:23:59 +00:00
|
|
|
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
2004-03-13 15:27:01 +00:00
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
2004-02-03 11:23:59 +00:00
|
|
|
textdomain (GETTEXT_PACKAGE);
|
2004-05-07 02:36:28 +00:00
|
|
|
#endif
|
2004-02-03 11:23:59 +00:00
|
|
|
|
2014-07-04 18:40:28 +00:00
|
|
|
/* avoid glib warnings when inspecting deprecated properties */
|
|
|
|
g_setenv ("G_ENABLE_DIAGNOSTIC", "0", FALSE);
|
|
|
|
|
2012-06-26 16:04:01 +00:00
|
|
|
g_set_prgname ("gst-inspect-" GST_API_VERSION);
|
2010-02-16 11:30:35 +00:00
|
|
|
|
2009-07-08 13:15:04 +00:00
|
|
|
#ifndef GST_DISABLE_OPTION_PARSING
|
2006-05-05 17:45:41 +00:00
|
|
|
ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
|
Merged in popt removal + GOption addition patch from Ronald, bug #169772.
Original commit message from CVS:
2005-10-10 Andy Wingo <wingo@pobox.com>
Merged in popt removal + GOption addition patch from Ronald, bug
#169772.
* docs/gst/gstreamer-sections.txt: Add STATE_(UN)LOCK_FULL, move
GstElement macros around, remove popt-related symbols, add goption
stuff.
* configure.ac: Remove popt checks, require GLib 2.6 for GOption.
* docs/gst/Makefile.am:
* docs/libs/Makefile.am: No POPT_CFLAGS.
* examples/manual/Makefile.am:
* docs/manual/basics-init.xml: Doc updates with an example.
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(gst_init), (parse_one_option), (parse_goption_arg):
* gst/gst.h: Removed gst_init_with_popt_table and friends. Took a
bit of hand merging and debugging to get the GOption stuff working
tho.
* tests/Makefile.am:
* tools/Makefile.am:
* tools/gst-inspect.c: (main):
* tools/gst-launch.c: (main):
* tools/gst-run.c: (main):
* tools/gst-xmlinspect.c: (main): Thanks Ronald!
2005-10-10 15:53:59 +00:00
|
|
|
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
|
|
|
|
g_option_context_add_group (ctx, gst_init_get_option_group ());
|
|
|
|
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
|
2012-08-29 21:57:02 +00:00
|
|
|
g_printerr ("Error initializing: %s\n", err->message);
|
2015-08-20 07:21:59 +00:00
|
|
|
g_clear_error (&err);
|
|
|
|
g_option_context_free (ctx);
|
2012-09-01 16:47:58 +00:00
|
|
|
return -1;
|
Merged in popt removal + GOption addition patch from Ronald, bug #169772.
Original commit message from CVS:
2005-10-10 Andy Wingo <wingo@pobox.com>
Merged in popt removal + GOption addition patch from Ronald, bug
#169772.
* docs/gst/gstreamer-sections.txt: Add STATE_(UN)LOCK_FULL, move
GstElement macros around, remove popt-related symbols, add goption
stuff.
* configure.ac: Remove popt checks, require GLib 2.6 for GOption.
* docs/gst/Makefile.am:
* docs/libs/Makefile.am: No POPT_CFLAGS.
* examples/manual/Makefile.am:
* docs/manual/basics-init.xml: Doc updates with an example.
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(gst_init), (parse_one_option), (parse_goption_arg):
* gst/gst.h: Removed gst_init_with_popt_table and friends. Took a
bit of hand merging and debugging to get the GOption stuff working
tho.
* tests/Makefile.am:
* tools/Makefile.am:
* tools/gst-inspect.c: (main):
* tools/gst-launch.c: (main):
* tools/gst-run.c: (main):
* tools/gst-xmlinspect.c: (main): Thanks Ronald!
2005-10-10 15:53:59 +00:00
|
|
|
}
|
2005-10-13 09:57:15 +00:00
|
|
|
g_option_context_free (ctx);
|
2009-07-08 13:15:04 +00:00
|
|
|
#else
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
#endif
|
2003-03-16 20:06:02 +00:00
|
|
|
|
2012-06-26 16:27:31 +00:00
|
|
|
gst_tools_print_version ();
|
2010-02-16 11:24:33 +00:00
|
|
|
|
2008-11-17 15:48:14 +00:00
|
|
|
if (print_all && argc > 1) {
|
2012-08-29 21:57:02 +00:00
|
|
|
g_printerr ("-a requires no extra arguments\n");
|
2012-09-01 16:47:58 +00:00
|
|
|
return -1;
|
2004-06-14 11:04:06 +00:00
|
|
|
}
|
|
|
|
|
2008-11-17 15:48:14 +00:00
|
|
|
if (uri_handlers && argc > 1) {
|
2012-08-29 21:57:02 +00:00
|
|
|
g_printerr ("-u requires no extra arguments\n");
|
2012-09-01 16:47:58 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* --atleast-version implies --exists */
|
|
|
|
if (min_version != NULL) {
|
|
|
|
if (sscanf (min_version, "%u.%u.%u", &minver_maj, &minver_min,
|
|
|
|
&minver_micro) < 2) {
|
|
|
|
g_printerr ("Can't parse version '%s' passed to --atleast-version\n",
|
|
|
|
min_version);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
check_exists = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (check_exists) {
|
|
|
|
if (argc == 1) {
|
|
|
|
g_printerr ("--exists requires an extra command line argument\n");
|
|
|
|
exit_code = -1;
|
|
|
|
} else {
|
|
|
|
if (!plugin_name) {
|
|
|
|
GstPluginFeature *feature;
|
|
|
|
|
|
|
|
feature = gst_registry_lookup_feature (gst_registry_get (), argv[1]);
|
|
|
|
if (feature != NULL && gst_plugin_feature_check_version (feature,
|
|
|
|
minver_maj, minver_min, minver_micro)) {
|
|
|
|
exit_code = 0;
|
|
|
|
} else {
|
|
|
|
exit_code = 1;
|
|
|
|
}
|
2016-05-02 15:35:29 +00:00
|
|
|
|
|
|
|
if (feature)
|
|
|
|
gst_object_unref (feature);
|
2012-09-01 16:47:58 +00:00
|
|
|
} else {
|
|
|
|
/* FIXME: support checking for plugins too */
|
|
|
|
g_printerr ("Checking for plugins is not supported yet\n");
|
|
|
|
exit_code = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return exit_code;
|
2008-11-17 15:48:14 +00:00
|
|
|
}
|
|
|
|
|
2019-01-17 02:22:27 +00:00
|
|
|
no_colors = g_getenv ("GST_INSPECT_NO_COLORS");
|
|
|
|
/* We only support truecolor */
|
|
|
|
colored_output &= (no_colors == NULL);
|
|
|
|
|
|
|
|
#ifdef G_OS_UNIX
|
|
|
|
if (isatty (STDOUT_FILENO)) {
|
|
|
|
if (redirect_stdout ())
|
|
|
|
loop = g_main_loop_new (NULL, FALSE);
|
|
|
|
} else {
|
|
|
|
colored_output = FALSE;
|
|
|
|
}
|
|
|
|
#elif defined(G_OS_WIN32)
|
|
|
|
{
|
|
|
|
gint fd = _fileno (stdout);
|
|
|
|
/* On Windows 10, g_log_writer_supports_color will also setup the console
|
|
|
|
* so that it correctly interprets ANSI VT sequences if it's supported */
|
|
|
|
if (!_isatty (fd) || !g_log_writer_supports_color (fd))
|
|
|
|
colored_output = FALSE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-12-14 20:56:51 +00:00
|
|
|
/* if no arguments, print out list of elements */
|
2008-11-17 15:48:14 +00:00
|
|
|
if (uri_handlers) {
|
|
|
|
print_all_uri_handlers ();
|
|
|
|
} else if (argc == 1 || print_all) {
|
2009-01-23 21:15:43 +00:00
|
|
|
if (do_print_blacklist)
|
|
|
|
print_blacklist ();
|
2009-11-09 12:55:54 +00:00
|
|
|
else {
|
|
|
|
if (print_aii)
|
|
|
|
print_all_plugin_automatic_install_info ();
|
|
|
|
else
|
2016-12-22 00:58:53 +00:00
|
|
|
print_element_list (print_all, types);
|
2009-11-09 12:55:54 +00:00
|
|
|
}
|
2001-01-04 10:47:39 +00:00
|
|
|
} else {
|
2008-11-17 15:48:14 +00:00
|
|
|
/* else we try to get a factory */
|
2004-06-14 11:04:06 +00:00
|
|
|
const char *arg = argv[argc - 1];
|
2017-10-20 09:08:14 +00:00
|
|
|
int retval = -1;
|
2004-06-14 11:04:06 +00:00
|
|
|
|
2008-11-12 16:55:00 +00:00
|
|
|
if (!plugin_name) {
|
2017-10-20 09:08:14 +00:00
|
|
|
retval = print_feature_info (arg, print_all);
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|
|
|
|
|
2004-06-15 14:17:55 +00:00
|
|
|
/* otherwise check if it's a plugin */
|
|
|
|
if (retval) {
|
2017-10-20 09:08:14 +00:00
|
|
|
GstPlugin *plugin = gst_registry_find_plugin (gst_registry_get (), arg);
|
2001-01-04 10:47:39 +00:00
|
|
|
|
2004-06-15 14:17:55 +00:00
|
|
|
/* if there is such a plugin, print out info */
|
|
|
|
if (plugin) {
|
2007-01-11 14:16:23 +00:00
|
|
|
if (print_aii) {
|
|
|
|
print_plugin_automatic_install_info (plugin);
|
|
|
|
} else {
|
|
|
|
print_plugin_info (plugin);
|
|
|
|
print_plugin_features (plugin);
|
|
|
|
}
|
2004-06-15 14:17:55 +00:00
|
|
|
} else {
|
2005-09-29 19:45:27 +00:00
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
if (g_file_test (arg, G_FILE_TEST_EXISTS)) {
|
|
|
|
plugin = gst_plugin_load_file (arg, &error);
|
|
|
|
|
|
|
|
if (plugin) {
|
2007-01-11 14:16:23 +00:00
|
|
|
if (print_aii) {
|
|
|
|
print_plugin_automatic_install_info (plugin);
|
|
|
|
} else {
|
|
|
|
print_plugin_info (plugin);
|
|
|
|
print_plugin_features (plugin);
|
|
|
|
}
|
2005-09-29 19:45:27 +00:00
|
|
|
} else {
|
2012-08-29 21:57:02 +00:00
|
|
|
g_printerr (_("Could not load plugin file: %s\n"), error->message);
|
2015-08-20 07:21:59 +00:00
|
|
|
g_clear_error (&error);
|
2019-01-08 12:23:44 +00:00
|
|
|
exit_code = -1;
|
|
|
|
goto done;
|
2005-09-29 19:45:27 +00:00
|
|
|
}
|
|
|
|
} else {
|
2012-08-29 21:57:02 +00:00
|
|
|
g_printerr (_("No such element or plugin '%s'\n"), arg);
|
2019-01-08 12:23:44 +00:00
|
|
|
exit_code = -1;
|
|
|
|
goto done;
|
2005-09-29 19:45:27 +00:00
|
|
|
}
|
2004-06-15 14:17:55 +00:00
|
|
|
}
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
done:
|
|
|
|
|
2018-10-27 12:38:57 +00:00
|
|
|
#ifdef G_OS_UNIX
|
2019-01-08 12:23:44 +00:00
|
|
|
if (loop) {
|
|
|
|
fflush (stdout);
|
|
|
|
fflush (stderr);
|
|
|
|
/* So that the pipe we create in redirect_stdout() is closed */
|
|
|
|
close (STDOUT_FILENO);
|
|
|
|
close (STDERR_FILENO);
|
|
|
|
g_child_watch_add (child_pid, child_exit_cb, NULL);
|
|
|
|
g_main_loop_run (loop);
|
|
|
|
g_main_loop_unref (loop);
|
|
|
|
}
|
2018-10-27 12:38:57 +00:00
|
|
|
#endif
|
|
|
|
|
2019-01-08 12:23:44 +00:00
|
|
|
return exit_code;
|
2001-01-04 10:47:39 +00:00
|
|
|
}
|