aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-09-14 09:01:22 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-09-14 09:01:22 +0200
commite0655f96cc7e2ef783f3db82c6b087d34f1e2b87 (patch)
tree3fbcd63c3f1a9a3677b48fcab2275bd2e10123a0 /tools
parentd1f921cf62a353aff4ea4bbb953cd08d6bdc8fc1 (diff)
Imported Upstream version 0.11.94upstream/0.11.94
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-inspect.c64
-rw-r--r--tools/gst-launch.1.in26
2 files changed, 68 insertions, 22 deletions
diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index 9616a0e..a8fc207 100644
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
@@ -1505,6 +1505,11 @@ main (int argc, char *argv[])
gboolean plugin_name = FALSE;
gboolean print_aii = FALSE;
gboolean uri_handlers = FALSE;
+ gboolean check_exists = FALSE;
+ gchar *min_version = NULL;
+ guint minver_maj = GST_VERSION_MAJOR;
+ guint minver_min = GST_VERSION_MINOR;
+ guint minver_micro = 0;
#ifndef GST_DISABLE_OPTION_PARSING
GOptionEntry options[] = {
{"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
@@ -1518,6 +1523,12 @@ main (int argc, char *argv[])
"installation mechanisms"), NULL},
{"plugin", '\0', 0, G_OPTION_ARG_NONE, &plugin_name,
N_("List the plugin contents"), NULL},
+ {"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},
{"uri-handlers", 'u', 0, G_OPTION_ARG_NONE, &uri_handlers,
N_
("Print supported URI schemes, with the elements that implement them"),
@@ -1542,8 +1553,8 @@ main (int argc, char *argv[])
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)) {
- g_print ("Error initializing: %s\n", err->message);
- exit (1);
+ g_printerr ("Error initializing: %s\n", err->message);
+ return -1;
}
g_option_context_free (ctx);
#else
@@ -1553,13 +1564,50 @@ main (int argc, char *argv[])
gst_tools_print_version ();
if (print_all && argc > 1) {
- g_print ("-a requires no extra arguments\n");
- return 1;
+ g_printerr ("-a requires no extra arguments\n");
+ return -1;
}
if (uri_handlers && argc > 1) {
- g_print ("-u requires no extra arguments\n");
- exit (1);
+ g_printerr ("-u requires no extra arguments\n");
+ 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) {
+ int exit_code;
+
+ 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;
+ }
+ } else {
+ /* FIXME: support checking for plugins too */
+ g_printerr ("Checking for plugins is not supported yet\n");
+ exit_code = -1;
+ }
+ }
+ return exit_code;
}
/* if no arguments, print out list of elements */
@@ -1621,12 +1669,12 @@ main (int argc, char *argv[])
print_plugin_features (plugin);
}
} else {
- g_print (_("Could not load plugin file: %s\n"), error->message);
+ g_printerr (_("Could not load plugin file: %s\n"), error->message);
g_error_free (error);
return -1;
}
} else {
- g_print (_("No such element or plugin '%s'\n"), arg);
+ g_printerr (_("No such element or plugin '%s'\n"), arg);
return -1;
}
}
diff --git a/tools/gst-launch.1.in b/tools/gst-launch.1.in
index 156fd9f..73bffeb 100644
--- a/tools/gst-launch.1.in
+++ b/tools/gst-launch.1.in
@@ -182,8 +182,6 @@ and the type can have the following case-insensitive values:
.br
- \fBf\fR or \fBfloat\fR for float values or ranges
.br
-- \fB4\fR or \fBfourcc\fR for FOURCC values
-.br
- \fBb\fR, \fBbool\fR or \fBboolean\fR for boolean values
.br
- \fBs\fR, \fBstr\fR or \fBstring\fR for strings
@@ -212,7 +210,7 @@ Likewise, "xvimagesink" can be substituted with "ximagesink", "sdlvideosink",
"osxvideosink", or "aasink". Keep in mind though that different sinks might
accept different formats and even the same sink might accept different formats
on different machines, so you might need to add converter elements like
-audioconvert and audioresample (for audio) or ffmpegcolorspace (for video)
+audioconvert and audioresample (for audio) or videoconvert (for video)
in front of the sink to make things work.
.B Audio playback
@@ -310,7 +308,7 @@ an SDL window
Play both video and audio portions of an MPEG movie
.B
- gst\-launch filesrc location=movie.mpg ! mpegdemux name=demuxer demuxer. ! queue ! mpeg2dec ! ffmpegcolorspace ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
+ gst\-launch filesrc location=movie.mpg ! mpegdemux name=demuxer demuxer. ! queue ! mpeg2dec ! videoconvert ! sdlvideosink demuxer. ! queue ! mad ! audioconvert ! audioresample ! osssink
.br
Play an AVI movie with an external text subtitle stream
@@ -318,7 +316,7 @@ This example also shows how to refer to specific pads by name if an element
(here: textoverlay) has multiple sink or source pads.
.B
- gst\-launch textoverlay name=overlay ! ffmpegcolorspace ! videoscale ! autovideosink filesrc location=movie.avi ! decodebin2 ! ffmpegcolorspace ! overlay.video_sink filesrc location=movie.srt ! subparse ! overlay.text_sink
+ gst\-launch textoverlay name=overlay ! videoconvert ! videoscale ! autovideosink filesrc location=movie.avi ! decodebin2 ! videoconvert ! overlay.video_sink filesrc location=movie.srt ! subparse ! overlay.text_sink
.br
Play an AVI movie with an external text subtitle stream using playbin2
@@ -331,7 +329,7 @@ Play an AVI movie with an external text subtitle stream using playbin2
Stream video using RTP and network elements.
.B
- gst\-launch v4l2src ! video/x-raw-yuv,width=128,height=96,format='(fourcc)'UYVY ! ffmpegcolorspace ! ffenc_h263 ! video/x-h263 ! rtph263ppay pt=96 ! udpsink host=192.168.1.1 port=5000 sync=false
+ gst\-launch v4l2src ! video/x-raw,width=128,height=96,format=UYVY ! videoconvert ! ffenc_h263 ! video/x-h263 ! rtph263ppay pt=96 ! udpsink host=192.168.1.1 port=5000
.br
This command would be run on the transmitter
@@ -371,7 +369,7 @@ to get a working pipeline.
Play any supported audio format
.B
- gst\-launch filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! osssink decoder. ! ffmpegcolorspace ! xvimagesink
+ gst\-launch filesrc location=videofile ! decodebin name=decoder decoder. ! queue ! audioconvert ! audioresample ! osssink decoder. ! videoconvert ! xvimagesink
.br
Play any supported video format with video and audio output. Threads are used
automatically. To make this even easier, you can use the playbin element:
@@ -386,12 +384,12 @@ automatically. To make this even easier, you can use the playbin element:
These examples show you how to use filtered caps.
.B
- gst\-launch videotestsrc ! 'video/x-raw-yuv,format=(fourcc)YUY2;video/x-raw-yuv,format=(fourcc)YV12' ! xvimagesink
+ gst\-launch videotestsrc ! 'video/x-raw,format=YUY2;video/x-raw,format=YV12' ! xvimagesink
.br
Show a test image and use the YUY2 or YV12 video format for this.
.B
- gst\-launch osssrc ! 'audio/x-raw-int,rate=[32000,64000],width=[16,32],depth={16,24,32},signed=(boolean)true' ! wavenc ! filesink location=recording.wav
+ gst\-launch osssrc ! 'audio/x-raw,rate=[32000,64000],format={S16LE,S24LE,S32LE}' ! wavenc ! filesink location=recording.wav
.br
record audio and write it to a .wav file. Force usage of signed 16 to 32 bit
samples and a sample rate between 32kHz and 64KHz.
@@ -448,13 +446,13 @@ a stack trace in the usual way.
.
.SH FILES
.TP 8
-~/.gstreamer-GST_API_VERSION/registry-*.bin
+~/.cache/gstreamer-GST_API_VERSION/registry-*.bin
The plugin cache; can be deleted at any time, will be re-created
-automatically when it does not exist yet or plugins change.
+automatically when it does not exist yet or plugins change. Based on
+XDG_CACHE_DIR, so may be in a different location than the one suggested.
.
.SH "SEE ALSO"
-.BR gst\-feedback (1),
-.BR gst\-inspect (1),
-.BR gst\-typefind (1)
+.BR gst\-inspect\-GST_API_VERSION (1),
+.BR gst\-launch\-GST_API_VERSION (1),
.SH "AUTHOR"
The GStreamer team at http://gstreamer.freedesktop.org/