Commit graph

254 commits

Author SHA1 Message Date
Seungha Yang 110edbc8bd gst-launch: Enable Windows high-resolution clock
Default timer precision of Windows is dependent on system, but
usually it's known to be about 15ms in worst case.
That's not an enough precision for multimedia application.

Enable high-resolution clock in gst-launch to demonstrate
the usage of Windows high-precision clock for application developers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/817>
2021-07-28 20:19:10 +09:00
Mathieu Duponchelle c682579c5e gst-launch: go back down to GST_STATE_NULL in one step.
Going through each state on the way back down to GST_STATE_NULL
can cause deadlocks, for example:

gst-launch-1.0 audiotestsrc ! valve drop=true ! autoaudiosink

ctrl + C

Hangs forever when going to PAUSED, because the "final" state is
ASYNC, and the sink blocks waiting for a preroll buffer.

Going straight to NULL addresses this issue, and also helps
making teardown faster when piping sparse streams to a
sync sink.
2020-04-01 15:41:49 +02:00
Seungha Yang 0a185c24b5 gst-launch: Follow up to missing s/g_print/gst_print/g
Required to avoid broken log string on Windows but missed
in the commit of 493a3261a9
2020-03-03 18:57:45 +09:00
Mathieu Duponchelle 4f9cac06e4 gst-launch: handle ERROR messages in the sync handler
Errors causing the pipeline to fail going from NULL to PAUSED
were not displayed, and the pipeline was not dumped either in
those cases.

In addition, dumping the pipeline from the sync handler means
the dump matches exactly the state of the pipeline at the
moment the error was posted.
2019-12-27 10:06:45 +00:00
Seungha Yang c05cb9504d gst-launch: Disable printing current position by default when stdout is not a tty
... and add new option to force-enable printing position even if stdout
is not a tty.
2019-11-14 12:15:20 +00:00
Seungha Yang 0505bd76a1 gst-launch: Add support printing current position of pipeline
By default, gst-launch will print the current position of pipeline (with duration if available).
To disable it, use "--no-position" option.
2019-11-03 09:12:26 +00:00
Seungha Yang 15423723fe gst-launch: Port to the direct use of GMainLoop
... instead of custom event loop.
This can make it easy to use GMainLoop related APIs in code.
2019-11-03 09:12:26 +00:00
Seungha Yang 966d013bf0 gst-launch: Remove meaningless global variable 2019-11-03 09:12:26 +00:00
Seungha Yang 493a3261a9 gst-launch: Use gst_print* instead of g_print* to fix broken stdout on Windows
Concurrent Windows' colored debug message and g_print will print
string hard to read. Instead, use gst_print* which serialize
debug output and the APIs call.
2019-08-24 12:15:56 +00: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
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
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
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
Tim-Philipp Müller 939a7fee6c tools: gst-launch: fix up caps printing in verbose mode
Add missing 'else' and print caps and taglists without the
annoying duplicate string escaping, making both nicer to read.

Fixes string leak and coverity CID 1358492.
2016-04-13 16:42:31 +01:00
Tim-Philipp Müller d09dc8cbc0 tools: gst-launch: use new async property change notification API
https://bugzilla.gnome.org/show_bug.cgi?id=763142
2016-04-08 13:28:06 +01:00
Nicolas Dufresne 4127407823 gst-launch: Fix process return value on error
In case of a run-time error message, the process return value was left
unset. This would lead to error not being caught at shell level.

https://bugzilla.gnome.org/show_bug.cgi?id=759019
2015-12-04 10:45:44 -05:00
Nicolas Dufresne f3a5c17464 Revert "tools: gst-launch: return non-0 exit code on async error"
This reverts commit 2ee4cba248.
2015-12-04 10:45:44 -05:00
Tim-Philipp Müller 2ee4cba248 tools: gst-launch: return non-0 exit code on async error
When an error happens in playing state, still return a
non-0 exit code.

https://bugzilla.gnome.org/show_bug.cgi?id=759019
2015-12-04 15:09:39 +00:00
Vineeth TM 456ef2aa1d tests/gst-launch: Fix sample memory leak
When sample is got using gst_tag_list_get_sample_index, it should
be free'd.

https://bugzilla.gnome.org/show_bug.cgi?id=756069
2015-10-05 12:08:30 +01: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
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
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
Руслан Ижбулатов 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
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
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
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
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 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
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
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
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
Wim Taymans 9baef63f5b launch: don't exit the loop on buffering in paused
When we receive a buffering message of 100% in the paused state, we exit
the event_loop and move to the PLAYING state. What should happen is that
we wait for both ASYNC-DONE and 100% buffering before continueing.
2013-03-11 12:28:19 +01:00
Krzysztof Konopko 6099b35f7e gst-launch: Use g_unix_signal_add() to handle keyboard interruption
Current implementation uses a traditional signal handler and a 250ms
timeout callback in the event loop.  Adding a GSource with
g_unix_signal_add() to the GMainLoop is a much more elegant solution.
The signal handler with this approach can send a message to the bus
directly rather than set a flag as all dispatching intricacies are handled
by GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=693481
2013-02-14 10:10:59 +01:00
Andrzej Bieniek 8cbdf007a7 gst-launch: report execution time in GST_TIME_FORMAT
https://bugzilla.gnome.org/show_bug.cgi?id=687523
2012-12-10 13:02:48 +01:00
Tim-Philipp Müller 666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Josep Torra Valles 111fcc6e31 Make intel compiler happier
https://bugzilla.gnome.org/show_bug.cgi?id=552657
2012-09-25 00:56:26 +01:00
Tim-Philipp Müller f938cf9257 tools: fix printing of partial dates in gst-launch 2012-08-02 11:33:41 +01:00
Tim-Philipp Müller 04142a9653 Revert "tools: print TOC scope"
This reverts commit ee6ab7c936.

The application will probably only ever receive global TOCs,
so don't really need this.
2012-08-02 11:15:16 +01:00
Tim-Philipp Müller ee6ab7c936 tools: print TOC scope 2012-07-28 09:40:25 +01:00
Tim-Philipp Müller 280ac5c5ef gst-launch: print image tags and other GstSample tags properly
These tags are now of type GstSample not GstBuffer.
2012-07-26 15:26:09 +01:00
Sebastian Dröge dfd9b60221 toc: Make structures opaque and clean up function names and fields a bit 2012-07-05 12:29:02 +02:00
Tim-Philipp Müller 1c7ce1594a tools: minor clean-up
Get rid of superfluous argument.
2012-06-26 17:30:22 +01:00
Tim-Philipp Müller 6438a0439d tools: remove useless g_set_prgname() wrapper 2012-06-26 17:30:22 +01:00