Commit graph

277 commits

Author SHA1 Message Date
Nirbheek Chauhan
7d2938ddca gst-inspect: Fix ANSI escape sequence usage on Windows
Either disable it when it's not supported, or setup the console to
interpret them correctly when it's supported.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/351
2019-01-17 01:34:53 +05:30
Nicolas Dufresne
01ecc85983 gst-inspect: Disable colors when piped
This follows what git and systemd tools would do.
2018-12-19 16:55:57 -05:00
Nicolas Dufresne
8f136e8d9f gst-inspect: Fix pager color with less
Fixes #341
2018-12-19 16:06:40 -05:00
Edward Hervey
e4c07997d1 gst-inspect: Remove dead assignment
readable is set just after before usage since 906bbd3817
2018-12-15 10:53:55 +01:00
Zeeshan Ali
5dba53a6f9 gst-inspect: Fix colors for "URI handling" section
They seemed incompatible with other colors.
2018-11-29 12:54:46 +01:00
Zeeshan Ali
d3fa67c08e gst-inspect: Avoid use of non-bright blue color
Simple blue doesn't work on Linux console, which also happens to be a
gnome-terminal theme. Use bright-blue instead.
2018-11-28 18:10:06 +01:00
Zeeshan Ali
c45b386b54 gst-inspect: Use only original 16 colors
Not only this will make colored output work on old terminals and console
as well, terminals can theme the actual colors this way to make it fit
with their different themes this way.
2018-11-27 02:25:49 +00:00
Zeeshan Ali
ed4f8e368a gst-inspect: Tell less to parse color codes
This change was originally part of 2cf16838c5 (gst-inspect: Colored
output) but got lost during the recent rebase.
2018-11-24 12:06:38 +01:00
Zeeshan Ali
2cf16838c5 gst-inspect: Colored output
Let's make the output a bit pretty to read. The colored output can be
disabled with `--no-colors` option or by setting `GST_INSPECT_NO_COLORS'
env (to any value).

The chosen colors are based on the popular Solarized theme, which is
targeted for both dark and light backgrounds.

Note:

* We only support true colors. If the terminal doesn't signal support for
  that via 'COLORTERM' env, we disable colored output.

* We don't add colors to --print-plugin-auto-install-info output, as
  that's meant for machines, not humans. Not only machines don't care
  about beauty, the existing ones will likely not expect colors and choke
  on it and we'll get angry mob at our doors.

[1] https://ethanschoonover.com/solarized
2018-11-23 16:15:19 +01:00
Zeeshan Ali
d3811ca5cd gst-inspect: Remove redundant plugin name from output
When printing info about a specific plugin, there is no need to prefix
some of the details with plugin's name. It's not only redundant but also
inconsistent and makes the task of adding consistent coloring to the
output (which we'll do in a follow patch), harder.
2018-11-23 16:14:06 +01:00
Nirbheek Chauhan
a3abe8b9ae gst-inspect: Use less -F -X everywhere as the pager
This emulates the default behaviour of git help pages, and also fixes
a bug on macOS where `less -F` doesn't display anything at all when
the output is shorter than one terminal screen.

Also moved the DEFAULT_PAGER define to after the includes, because
it's an unprefixed define.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/330
2018-11-23 20:31:27 +05:30
Zeeshan Ali
ef58a84571 gst-inspect: Pipe stderr to pager as well
If stderr is not redirected by the user, also page that.
2018-11-09 12:27:18 +00:00
Zeeshan Ali
8abe052590 gst-inspect: Don't page if output fits the screen 2018-10-30 15:30:38 +01:00
Zeeshan Ali
4fbd3baf1e gst-inspect: Flush stdout before closing stdout FD
Otherwise, last line can be lost.
2018-10-30 14:53:00 +01:00
Zeeshan Ali
5d115a5d64 gst-inspect: Pipe stdout to less if not piped already
https://bugzilla.gnome.org/show_bug.cgi?id=797344
2018-10-28 13:19:47 +00:00
Thibault Saunier
d93076f826 gst-inspect: Sort properties names
Making it simpler to find properties you are looking for when reading.
2018-07-13 08:54:01 -04:00
Stefan Sauer
ffc85bf7f6 inspect: add comment for how to improve tracer support 2017-12-26 12:17:53 +01:00
Tim-Philipp Müller
906bbd3817 tools: gst-inspect: fix readable flag printing for pad properties 2017-11-28 23:37:47 +00:00
Tim-Philipp Müller
ec6d2304bd tools: gst-inspect: don't print element flags whch are always 'none'
We print the interesting flags like clocking capabilities separately
later, this function just always prints 'none', so remove it.
2017-11-26 00:20:13 +00:00
Tim-Philipp Müller
8cc7c3f6aa tools: gst-inspect: print pad properties where we know the subclass type 2017-11-26 00:17:27 +00:00
Tim-Philipp Müller
b60d869b22 tools: gst-inspect: refactor way indentation is done during printing 2017-11-25 23:41:49 +00:00
Tim-Philipp Müller
b8b03f69b0 tools: gst-inspect: stop printing element state_change function
This is really not interesting at all, not sure why we print this.
2017-11-17 00:15:17 +00:00
Tim-Philipp Müller
465094f071 tools: gst-inspect: fix double empty line after pad templates 2017-11-17 00:14:35 +00:00
Stefan Sauer
875903be3f gst-inspect: print more details for typefind and tracer features
Print full details for typefind features. Print some of the available features
for tracers and add some todos for the ones we'd like to see.
2017-10-20 13:13:52 +02:00
Stefan Sauer
ef660a21d6 gst-inspect: reduce casting back and forth
Refactor the print_element_info() to take a GstPluginFeature. Reduces the need
to cast to and from GstElementFactory.
2017-10-20 11:16:46 +02:00
Stefan Sauer
2354c5b152 gst-inspect: simplify the code for printing feature info
Rename print_element_features() to print_feature_info() and move the code that
handles the ElementFactory there. This simplifies the calling code and improves
readability.

Also don't leak the features for other factories.
2017-10-20 11:11:37 +02:00
Mathieu Duponchelle
7da98a2278 gst-inspect: Print GstValueArray properties nicely
https://bugzilla.gnome.org/show_bug.cgi?id=787924
2017-09-22 00:53:12 +02:00
Jimmy Ohn
a8acba142f gst-inspect: Fix memory leak in print_pad_templates_info
gst_static_caps_get function returned allocated memory.
So, It should be free using gst_caps_unref.

https://bugzilla.gnome.org/show_bug.cgi?id=784311
2017-06-29 15:26:36 +01:00
Thibault Saunier
221d65a5e0 gst-launch: Add a '--types' option to filter elements by types to print
This way the user can easily figure out what are the available audio
encoder for example doing:

  gst-inspect-1.0 --types Encoder/Audio

https://bugzilla.gnome.org/show_bug.cgi?id=776392
2016-12-23 08:24:12 -03:00
Tim-Philipp Müller
ad537a2d51 tools: gst-inspect: add * for pointer signal arguments where needed
Print GObject argument properly with pointer marker:

  "client-added" :  void user_function (GstElement* object,
                                        GObject* arg0,
                                        gpointer user_data);

instead of

  "client-added" :  void user_function (GstElement* object,
                                        GObject arg0,
                                        gpointer user_data);

for gst-inspect-1.0 tcpserversink.
2016-09-04 20:39:31 +01:00
Tim-Philipp Müller
3cae933579 tools: gst-inspect: don't print internal pad request function name
This just confuses people, they look at it and try to call it
directly by name, instead of using the public GstElement API.
It stands to reason that it goes without saying that when an
element provides request pads that they can actually be
requested using the standard API, and there's no point in
printing internal implementation details of the element.
2016-08-28 16:04:27 +01:00
Guillaume Desmottes
4fe32b923f inspect: fix feature leak
https://bugzilla.gnome.org/show_bug.cgi?id=765957
2016-05-04 10:09:43 +03:00
Stefan Sauer
6e9f018dc4 inspect: add support for the new factory
Handle tracer modules.
2015-10-05 20:59:39 +02:00
Vineeth TM
215cfcf993 gstreamer: Fix memory leaks when context parse fails
When g_option_context_parse fails, context and error variables are not getting free'd
which results in memory leaks. Free'ing the same.

And replacing g_error_free with g_clear_error, which checks if the error being passed
is not NULL and sets the variable to NULL on free'ing.

https://bugzilla.gnome.org/show_bug.cgi?id=753851
2015-10-02 17:31:11 +03:00
Stefan Sauer
a4e561c7f8 gst-inspect: only print presets line if num-presets > 0
Also check for an empty strv.
2015-01-04 23:26:19 +01:00
Stefan Sauer
d3958b912e gst-inspect: fix output for -a
Use n_print to ensure all lines are prefixed with the element name.
2015-01-04 22:52:19 +01:00
Stefan Sauer
a536c62ed6 gst-inspect: print preset names
If the element supports presets and ships some, print them.
Fixes #741427
2014-12-21 14:15:54 +01:00
Aurélien Zanelli
c2390c8943 gst-inspect: add G_PARAM_DEPRECATED to known flags
Display 'deprecated' instead of flag value when using G_PARAM_DEPRECATED
in element properties.

https://bugzilla.gnome.org/show_bug.cgi?id=739518
2014-11-02 12:50:04 +00:00
Stefan Sauer
d5518edf12 fixme: bump leftover 0.11 fixme comments 2014-09-25 21:27:03 +02:00
Tim-Philipp Müller
d3de22d802 tools: gst-inspect: don't list pad functions
Don't print all the different pad functions, it's just
confusing and no one has ever needed to know this for
anything ever anyway, it's just useless information.
Besides, we also label the default implementations as
'custom' implementations (the code that tries to
prevent that doesn't actually work it seems).

https://bugzilla.gnome.org/show_bug.cgi?id=736377
2014-09-12 14:13:54 +01:00
Tim-Philipp Müller
721a1c7553 tools: suppress GLib warnings when gst-inspecting deprecated properties
GLib in git will spew a g_warning() when a property marked as
deprecated via param spec flags is accessed. Suppress this by
setting the appropriate environment variable.
2014-07-04 19:40:28 +01:00
Olivier Crête
7992174a1a DeviceProvider: Rename from DeviceMonitor 2014-06-26 14:45:30 -04:00
Wim Taymans
df7bfb6a10 inspect: print structure values of properties 2014-04-12 07:13:02 +02:00
Sebastian Dröge
338a150a1b gst-inspect: Add missing \n in output 2014-04-02 23:52:24 +02:00
Olivier Crête
59611a01ac gst-inpect: Print device monitor 2014-03-16 20:50:53 -04:00
Sebastian Dröge
be32ae0252 gst-inspect: Fix yet another compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=724045
2014-02-10 17:09:59 +01:00
Sebastian Dröge
53d8460bfd gst-inspect: Make clang happy with our g_vprintf() wrapper 2014-02-08 16:42:55 +01:00
Sebastian Dröge
c1ec592ec2 tools: Support non-ASCII tags
By calling setlocale() to get us multi-byte/UTF-8 support.

https://bugzilla.gnome.org/show_bug.cgi?id=723164
2014-01-30 21:25:48 +01:00
Edward Hervey
60b94c6498 gst-inspect: Index features are no more
So remove code that will never be used
2013-12-10 18:25:22 -05:00
Reynaldo H. Verdejo Pinochet
afe174d38d gst-inspect: Remove some dead code 2013-11-04 13:56:37 -08:00