Commit graph

753 commits

Author SHA1 Message Date
Tim-Philipp Müller
6a9b191fb2 tools: gst-launch: fix --exclude command line option
This has not worked (as in: crashed) since 2005, so
perhaps it should just be removed instead.
2015-09-05 11:19:53 +01:00
Vivia Nikolaidou
957a81eef9 gst-indent: Add support for gindent as executable name
gst-indent used to support gnuindent and indent as executable names.
However, on OSX one can "brew install gnu-indent" and then the
executable name will be gindent. Added support for that.

https://bugzilla.gnome.org/show_bug.cgi?id=750351
2015-06-03 18:09:24 +02:00
Tim-Philipp Müller
8e6561be91 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 17:49:44 +01:00
Mathieu Duponchelle
5d96658874 tools: remove outdated completion script
+ Remove the associated test

https://bugzilla.gnome.org/show_bug.cgi?id=744877#c21
2015-03-18 14:16:48 +01: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
Sebastian Dröge
154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +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
Jan Schmidt
8f4b4a9497 gst-indent: Run indent twice. Once is not idempotent, twice seems to be. 2014-10-20 23:55:47 +11: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
Руслан Ижбулатов
35fc309544 gst-launch: Support SIGINT (Ctrl+C) on W32
W32 has no SIGINT, but it does have SetConsoleCtrlHandler(), which sets up
a handler for Ctrl+C.

https://bugzilla.gnome.org/show_bug.cgi?id=733814
2014-07-28 09:21:40 +02:00
Sebastian Dröge
7f9c0d06dd docs: There is no decodebin2 anymore, don't pretend otherwise 2014-07-08 11:18:05 +02: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
Edward Hervey
98ea309bea gst-launch.1: Playbin2 is dead, long live playbin
Looks like that was the last remaining mention in core ...
2014-04-03 07:37:11 +02:00
Sebastian Dröge
338a150a1b gst-inspect: Add missing \n in output 2014-04-02 23:52:24 +02:00
Wim Taymans
f85ce91e9d launch: place the deep-notify on the right pipeline
If the toplevel bin is not not a pipeline, we place the bin in a
pipeline. Also make sure that we connect to the deep-notify of this new
pipeline because we will g_signal_handler_disconnect() from it later.
2014-03-25 12:38:07 +01: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
12b3a37b5e gst-launch: Handle taglist copy failure
If we couldn't copy the tags, just return instead of trying to use bogus
values.
2013-12-10 18:30:03 -05: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
Tim-Philipp Müller
208e303568 tools: gst-launch: don't try to remove already-removed GSource from main loop
It's considered a programming error in recent GLib versions now.
We may already have removed the source by returning FALSE from
the callback if it was fired. Fixes warning with newer GLibs
when interrupting a pipeline with Control-C.
2013-12-05 00:26:13 +00:00
Philippe Normand
6e4cab6541 gst-launch: exit with an error code when an error occured
If the pipeline failed to pre-roll or the user interrupted the
execution then set the exit code to a positive value.

https://bugzilla.gnome.org/show_bug.cgi?id=712300
2013-11-25 12:12:39 +01:00
Stefan Sauer
24c741554c typefind: use g_get_prgname() for error message 2013-11-07 21:01:27 +01:00
Reynaldo H. Verdejo Pinochet
afe174d38d gst-inspect: Remove some dead code 2013-11-04 13:56:37 -08:00
Matthieu Bouron
a0e2eb6169 gst-launch: fix potential uninitialized variable warning
https://bugzilla.gnome.org/show_bug.cgi?id=710758
2013-11-01 15:15:29 +01:00
Sebastian Dröge
aacedb9da4 gst-launch: Update for GstContext changes 2013-09-18 21:42:42 +02:00
Tim-Philipp Müller
954776ab38 tools: move gst-plot-timeline.py into scripts directory
So it's not in PATH in an uninstalled setup (thwarting
gst-play autocompletion).
2013-09-04 10:43:16 +01:00
Tim-Philipp Müller
71422a9a70 tools: gst-launch: don't print properties being reset when shutting down
It's just noise.
2013-08-26 13:19:10 +01:00
Руслан Ижбулатов
797fcd1d49 info: Add debug color mode option
This allows to explicitely set the debug output color
mode to UNIX on every platform, enable it (use platform
default color mode) or enable it.

https://bugzilla.gnome.org/show_bug.cgi?id=674320
2013-07-18 14:30:44 +02:00
Sebastian Dröge
ff47fe72ab gst-launch: Remove unref that should not be there
We keep a reference to the context around all the time.

https://bugzilla.gnome.org/show_bug.cgi?id=701985
2013-06-11 10:25:02 +02:00
Sebastian Dröge
b7ad14984b gst-launch: Improve GstContext handling
https://bugzilla.gnome.org/show_bug.cgi?id=700967
2013-06-09 17:20:22 +02:00
David Rothlisberger
9f5e9c8632 tools/gstreamer-completion: Allow 1.0 and 0.10 scripts installed simultaneously
As long as the scripts' filenames are different, and the _gst_inspect
and _gst_launch functions are named differently, the completion scripts
for GStreamer 1.0 and 0.10 can be installed side-by-side in
/etc/bash_completion.d.

On my 0.10 branch† the completion script is renamed to
"gstreamer-completion-0.10" and the functions are renamed to
"_gst_inspect_0_10" and "_gst_launch_0_10". The remaining helper
functions should remain identical (the command-line interface to
gst-inspect hasn't changed, nor has the format of the gst-launch
pipeline), so it doesn't matter if the 1.0 script overrides the 0.10
script's definitions.

Note that I don't expect there to be another GStreamer 0.10 release, so
the 0.10 completion script will probably never be officially released;
but it is still worthwhile allowing both scripts to be installed
alongside each other, for those who install the 0.10 completion script
manually.

Fixes: #690515https://github.com/drothlis/gstreamer/blob/bash-completion-0.10/tools/gstreamer-completion-0.10
2013-04-29 21:17:23 +02:00
David Rothlisberger
5d6635f9b4 tools/gstreamer-completion: Complete option & property values on bash 3.2
Bash 3's completion doesn't split words by characters in
COMP_WORDBREAKS. In particular it doesn't split at "=" signs. Now
_gst_launch_parse handles both bash 3 and 4 format of COMP_WORDS.

Note that "${cur%%=*}" means cur's value with the longest possible match
of "=*" deleted from the end; "${cur#*=}" means cur's value with the
shortest possible match of "*=" deleted from the beginning. See
http://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

Regardless of the version of bash running the unit tests, I can test for
both behaviours because the unit test populates COMP_WORDS manually. So
this tests the bash 3 behaviour:

    test_gst_inspect_completion --gst-debug-level=4

and this tests the bash 4 behaviour:

    test_gst_inspect_completion --gst-debug-level = 4
2013-04-29 21:12:42 +02:00
David Rothlisberger
f586e34a50 tools/gstreamer-completion: Bash 3.2 compatibility fixes
Compatible with bash 3.2; doesn't require the bash-completion package at
all (though the easiest way to install this script is still to install
bash-completion, and then drop this script into /etc/bash_completion.d).

Note that bash 3 doesn't break COMP_WORDS according to characters in
COMP_WORDBREAKS, so "property=val" looks like a single word, so this
won't complete property values (on bash 3). Similarly,
"--gst-debug-level=<TAB>" won't complete properly (on bash 3), but
"--gst-debug-level <TAB>" will.

For that reason, I now offer "--gst-debug-level" etc as completions
instead of "--gst-debug-level=".

Functions "_init_completion" and "_parse_help" were provided by the
bash-completion package >= 2.0; now I roll my own equivalent of
"_parse_help", and instead of "_init_completion" I use
"_get_comp_words_by_ref" which is available from bash-completion 1.2
onwards. If the bash-completion package isn't available at all I use
bash's raw facilities, at the expense of not completing properly when
the cursor is in the middle of a word.

The builtin "compopt" doesn't exist in bash 3; those users will just
have to live with the inconvenience of "property=" completing to
"property= " with a trailing space. Property values aren't completed
properly anyway on bash 3 (see above).

"[[ -v var ]]" to test whether a variable is set, also doesn't exist in
bash 3. Neither does ";;&" to fall through in a "case" statement.

In the unit tests:

* On my system (OS X), "#!/bin/bash" is bash 3.2, whereas
  "#!/usr/bin/env bash" is the 4.2 version I built myself.
* I have to initialise array variables like "expected=()", or bash 3
  treats "+=" as appending to an array already populated with one empty
  string.
2013-04-29 21:12:42 +02:00
David Rothlisberger
020dd3bbf3 tools/gstreamer-completion: Support gst-inspect, and gst-launch element properties
Completes options like "--gst-debug-level" and the values of some of
those options; completes gst-launch pipeline element names, property
names, and even property values (for enum or boolean properties only).

Doesn't complete all caps specifications, nor element names specified
earlier in the pipeline with "name=...".

The GStreamer version number is hard-coded into the completion script:
This patch is off the master branch and has the version hard-coded as
"1.0"; it needs to be updated if backported to the 0.10 branch. You
could always create a "gstreamer-completion.in" that has the appropriate
version inserted by "configure", but I'd rather not do that. The
hard-coded version is consistent with the previous implementation of
gstreamer-completion, which had the registry path hard-coded as
~/.gstreamer-1.0/registry.xml.

Note that GStreamer 0.10 installs "gst-inspect" and "gst-inspect-0.10".
"gst-inspect --help" only prints 4 flags (--help, --print, --gst-mm,
gst-list-mm) whereas "gst-inspect-0.10 --help-all" prints the full list
of flags. The same applies to "gst-launch" and "gst-launch-0.10".
GStreamer 1.0 only installs "gst-inspect-1.0", not "gst-inspect".

Requires bash 4; only tested with bash 4.2. Requires "bash-completion"
(which you install with your system's package manager).

Put this in /etc/bash_completion.d/ or in `pkg-config
--variable=compatdir bash-completion`, where it will be loaded at the
beginning of every new terminal session;
or in `pgk-config --variable=completionsdir bash-completion`, renamed to
match the name of the command it completes (e.g. "gst-launch-1.0", with
an additional symlink named "gst-inspect-1.0"), where it will be
autoloaded when needed.

test-gstreamer-completion.sh is (for now) in tests/misc -- it might be
worth creating "tests/check/tools", with all the necessary automake
boilerplate, and moving test-gstreamer-completion.sh there, and have it
run automatically with "make check".

IF YOU'RE NEW TO BASH COMPLETION SCRIPTS
----------------------------------------

"complete -F _gst_launch gst-launch-1.0" means that bash will run the
function "_gst_launch" to generate possible completions for the command
"gst-launch-1.0".

"_gst_launch" must return the possible completions in the array variable
COMPREPLY. (Note on bash syntax: "V=(a b c)" assigns three elements to
the array "V").

"compgen" prints a list of possible completions to standard output. Try
it:

    compgen -W "abc1 abc2 def" -- "a"
    compgen -f -- "/"

The last argument is the word currently being completed; compgen uses it
to filter out the non-matching completions. We put "--" first, in case
the word currently being completed starts with "-" or "--", so that it
isn't treated as a flag to compgen.

For the documentation of COMP_WORDS, COMP_CWORD, etc see
http://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-COMP_005fCWORD-180

See also:
* http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html
* http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html

The bash-completion package provides the helper function
"_init_completion" which populates variables "cur", "prev", and "words".
See
http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=blob;f=bash_completion;h=870811b4;hb=HEAD#l634

Note that by default, bash appends a space to the completed word. When
the completion is "property=" we don't want a trailing space; calling
"compopt -o nospace" modifies the currently-executing completion
accordingly. See
http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#index-compopt
2013-04-29 21:12:42 +02:00
David Rothlisberger
271c707c45 tools/gstreamer-completion: Updated to work with the binary registry
The original registry was in xml format (~/.gstreamer-*/registry.xml). A
binary registry format was added in 2007 (commit ebf0c9d3) and made the
default in 2008 (commit 3f39fd7e). In 0.10 you could still choose at
"configure" time to use the xml registry instead; in 1.0 the binary
registry is your only choice.

This change to gstreamer-completion should work with either format
because it parses the output of "gst-inspect" instead of reading the
registry file directly.

Note that _gst_launch no longer needs an explicit "return 0" because,
unlike the previous grep command, compgen always returns 0 (unless a
genuine error occurs).

Just like the previous implementation by David Schleef, this "only
completes names of features, but that's 90% of what I want it for."
2013-04-29 21:12:42 +02:00
Tim-Philipp Müller
7954ac2ad7 tools: update for latest context API changes 2013-04-18 10:13:30 +01:00
Sebastian Dröge
8f8036f344 gst-launch: Add GstContext support
gst-launch will collect all the contexts from the pipeline elements
and update the overall pipeline context with it.
2013-04-17 13:47:35 +02:00
Tim-Philipp Müller
21e584696d gst-inspect: only add a '*' for non-'gpointer' pointers
Spotted by Jose Antonio Santos Cadena.

https://bugzilla.gnome.org/show_bug.cgi?id=697791
2013-04-13 12:00:12 +01:00
Jose Antonio Santos Cadenas
9e98492e12 gst-inspect: add pointer mark to signal and action return types that are pointers
When the return type of a signal or action is a pointer, it
should have an asterisk to mark it as such.

https://bugzilla.gnome.org/show_bug.cgi?id=697791
2013-04-11 23:35:38 +01:00
Wim Taymans
9ee7e72c36 launch: handle PROGRESS messages
Wait for all PROGRESS messages (if any) to complete before going to the PLAYING
state. This is the only way we can wait for live elements to complete their
operations.

This is interesting for elements like rtspsrc that do some asynchronous network
requests as part of going to the PAUSED state. It could be possible that it, for
example, provides a clock and then we would like to wait until it completes
so that we can use the provided clock when going to PLAYING.
2013-04-11 14:00:32 +01:00
David Schleef
96a8d5945f gst-launch: Fix space in fault message 2013-04-06 16:10:16 -07:00
Sebastian Dröge
91b3890d70 caps: Handle ANY caps features properly in more places 2013-04-06 21:49:25 +02:00
Sebastian Dröge
f810565ca7 gst-inspect: Print caps features too 2013-04-01 10:20:01 +02:00