Commit graph

831 commits

Author SHA1 Message Date
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
Tim-Philipp Müller
ce4698487e meson: add option to disable parse-launch pipeline string parser 2018-08-10 00:08:43 +01:00
Nirbheek Chauhan
38ec95460f meson: Don't add static printf library to executables
They should only need to link to libgstreamer.
2018-07-25 16:02:06 +05:30
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
Tim-Philipp Müller
92ad74052b gst-launch: fix compiler warnings for SIGHUP handlers on windows
Fix unused variable/function compiler warnings on windows.
The SIGHUP handling is only available under unix.

https://bugzilla.gnome.org/show_bug.cgi?id=783661
2017-07-20 17:31:41 +01:00
Graham Leggett
cfe59c285c Generate a gstreamer pipeline diagram on SIGHUP.
Useful for debugging a pipeline that refuses to enter a given state.

https://bugzilla.gnome.org/show_bug.cgi?id=783661
2017-07-13 14:02:33 +01:00
Scott D Phillips
f37688ef4d tools: gst-stats: Use standard character escapes
Having '\e' expand to '\x1b' is a gnu extension. I didn't see any
document describing the behavior, but gcc also seems to expand
'\[' to '['.

https://bugzilla.gnome.org/show_bug.cgi?id=782028
2017-07-09 20:10:31 +01: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
55ccfd4760 meson: Add configinc as include_directory in tools/
Otherwise when the glib is used as a subproject config.h is the glib
one, not ours.
2017-06-28 09:38:35 -04:00
Tim-Philipp Müller
9f05e66154 tools: dist new gst-stats man page
Fixes meson build from tarball.
2017-05-20 16:44:56 +01:00
Koop Mast
97cacb78e3 Meson: also build and install gst-stats-1.0 and it's man page.
https://bugzilla.gnome.org/show_bug.cgi?id=781585
2017-04-21 10:55:55 -03:00
Koop Mast
8b06627df9 Add very simple man page for gst-stats.
https://bugzilla.gnome.org/show_bug.cgi?id=781585
2017-04-21 10:55:55 -03:00
Tim-Philipp Müller
921b0f40d8 tools: gst-launch: print structure property notifies nicer
One less layer of escaping, but still lots of ugly \.
2017-03-27 18:27:59 +01:00
Tim-Philipp Müller
b84cb75200 tools: replace mentions of 'mad' on the gst-launch-1.0 man page
The 'mad' plugin has been removed. Mention mpg123audiodec instead.

https://bugzilla.gnome.org/show_bug.cgi?id=776140
2017-03-20 16:54:22 +00:00
Mark Nauwelaerts
31f96fc7a6 tools: update gst-inspect man page 2017-01-05 15:26:08 +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
Nicolas Dechesne
2d5dba8d05 tools: gst-launch: set GST_GL_XINITTHREADS
This ensure that XInitThreads is called and so gl contexts are properly
initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=776401
2016-12-23 12:20:52 +02:00
Stefan Sauer
1bfd04a5fe tracers/stats: log optional fields instead of GST_CLOCK_TIME_NONE
Simplify the traces and avoid trace analyzer to know that ((1<<64) - 1) means
we had no value.
2016-12-16 15:55:21 +01:00
Edward Hervey
9cc36e511c tools: Remove files to be cleaned
manpages are no longer auto-generated
cov-related files should not be there (if needed we could use gitignore)
2016-11-23 18:56:20 +01:00
Tim-Philipp Müller
94cd315595 tools: fix distcheck and .gitignore 2016-11-23 09:58:44 +00:00
Antonio Ospite
38b9aa4c33 meson: tools: install the man pages
https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-23 09:38:25 +00:00
Antonio Ospite
2a5a8dd3c7 tools: ship the final man pages directly, no more man pages templates
Don't use templates for the man pages, the API version change is a rare
event, so it's not really worth keeping in place the "sed" boilerplate
to have it set at build time.

Shipping the final man pages directly also makes it easer to install the
man pages with meson (in a future commit).

Note that now all the occurrences of the programs names have the API
version as a suffix.

Traditionally the example command lines looked like:

  gst-launch ...

Now they look like:

  gst-launch-1.0 ...

This reflects the actual programs names and makes it easier to copy and
paste the example commands.

Also, the .gitignore file is adjusted not to ignore the final man pages
anymore.

You may need to clean your src/build directory before pulling in this
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-23 09:09:05 +00:00
Antonio Ospite
4eb64cd276 meson: tools: generate the targets dynamically
The three targets are the same except for input and output
files, use a loop and generate them dynamically.

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-11 10:01:16 +00:00
Antonio Ospite
ef3a60793b tools: don't mention gst-feedback in man pages
gst-feedback no longer exists.

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-11 09:59:40 +00:00
Antonio Ospite
76656050b5 tools: put the examples descriptions before the commands in man page
Put the description of the example command lines before the command
instead of after them. The new way is more intuitive.

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-11 09:58:40 +00:00
Antonio Ospite
7521d5b3cf tools: don't start lines with single quotes in man page
When a line starts with a single quote it's treated in a special way by
man, which may result in paragraphs of the man page not rendered by the
man pager, so just avoid that.

A possible solution could have been to escape the singe quote with
a \(cq sequence but this is rather unreadable, instead the text has been
reformatted to have the problematic quoted 'ppc' string on the previous
line.

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-11 09:57:39 +00:00
Antonio Ospite
64c097d296 tools: escape dashes in the man pages
The portable way to have the dashes to be rendered as ASCII minuses is
to use the sequence backslash-dash, use this style at least for text
that can be copied and pasted (e.g. command names, file names, element
options).

Also use backslash-dash in the NAME section as suggested by lexgrog(1).

https://bugzilla.gnome.org/show_bug.cgi?id=773917
2016-11-11 09:55:16 +00:00
Antonio Ospite
050f486d10 tools: gst-launch: fix minor memory leak when failing to parse options
Commit 215cfcf993 (gstreamer: Fix memory leaks when context parse
fails) fixes some memory leak, but in one of the newly added calls to
g_clear_error() the wrong variable was passed.

When failing to parse command line options, free the "err" variable, not
the "error" one.

https://bugzilla.gnome.org/show_bug.cgi?id=773907
2016-11-04 16:59:36 +02:00
Jan Schmidt
5a5ae1be1f parse-launch: Support linking all pads with new operator
Introduce a new operator ':' - e.g. element1 ':' element2

For example, 'uridecodebin : encodebin' -
if the encodebin has multiple profiles compatible with the
decodebin, multiple links will be created.

With '!' , after one delayed link is successfully done, the
pad-added callback is disconnected.

https://bugzilla.gnome.org/show_bug.cgi?id=751450
2016-11-02 12:04:33 +11: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