validate: Run gst-indent on all code

so whitespace. much indent. spacing !
This commit is contained in:
Edward Hervey 2014-06-03 10:02:10 +02:00
parent 90f5dae534
commit ca44a11429
11 changed files with 195 additions and 174 deletions

View file

@ -74,9 +74,9 @@ gst_validate_bin_monitor_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_STATELESS: case PROP_STATELESS:
monitor->stateless = g_value_get_boolean(value); monitor->stateless = g_value_get_boolean (value);
if (monitor->scenario != NULL) if (monitor->scenario != NULL)
g_object_set(monitor->scenario, "stateless", monitor->stateless, NULL); g_object_set (monitor->scenario, "stateless", monitor->stateless, NULL);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -139,9 +139,9 @@ gst_validate_bin_monitor_class_init (GstValidateBinMonitorClass * klass)
gobject_class->dispose = gst_validate_bin_monitor_dispose; gobject_class->dispose = gst_validate_bin_monitor_dispose;
g_object_class_install_property (gobject_class, PROP_STATELESS, g_object_class_install_property (gobject_class, PROP_STATELESS,
g_param_spec_boolean ("stateless", "Stateless", "True to execute actions as soon as possible, regardless " g_param_spec_boolean ("stateless", "Stateless",
"of the initial state of the pipeline", "True to execute actions as soon as possible, regardless "
FALSE, G_PARAM_READWRITE)); "of the initial state of the pipeline", FALSE, G_PARAM_READWRITE));
validatemonitor_class->setup = gst_validate_bin_monitor_setup; validatemonitor_class->setup = gst_validate_bin_monitor_setup;
} }
@ -152,11 +152,12 @@ gst_validate_bin_monitor_init (GstValidateBinMonitor * bin_monitor)
} }
static gboolean static gboolean
print_position (GstValidateMonitor *monitor) print_position (GstValidateMonitor * monitor)
{ {
GstQuery *query; GstQuery *query;
gint64 position, duration; gint64 position, duration;
GstElement *pipeline = GST_ELEMENT (GST_VALIDATE_MONITOR_GET_OBJECT (monitor)); GstElement *pipeline =
GST_ELEMENT (GST_VALIDATE_MONITOR_GET_OBJECT (monitor));
gdouble rate = 1.0; gdouble rate = 1.0;
GstFormat format = GST_FORMAT_TIME; GstFormat format = GST_FORMAT_TIME;
@ -180,7 +181,8 @@ print_position (GstValidateMonitor *monitor)
} }
static void static void
_bus_handler (GstBus * bus, GstMessage * message, GstValidateBinMonitor *monitor) _bus_handler (GstBus * bus, GstMessage * message,
GstValidateBinMonitor * monitor)
{ {
GError *err; GError *err;
gchar *debug; gchar *debug;
@ -256,10 +258,11 @@ gst_validate_bin_monitor_new (GstBin * bin, GstValidateRunner * runner,
GstBus *bus; GstBus *bus;
monitor->print_pos_srcid = monitor->print_pos_srcid =
g_timeout_add (PRINT_POSITION_TIMEOUT, (GSourceFunc) print_position, monitor); g_timeout_add (PRINT_POSITION_TIMEOUT, (GSourceFunc) print_position,
monitor);
bus = gst_element_get_bus (GST_ELEMENT (bin)); bus = gst_element_get_bus (GST_ELEMENT (bin));
gst_bus_enable_sync_message_emission(bus); gst_bus_enable_sync_message_emission (bus);
g_signal_connect (bus, "sync-message", (GCallback) _bus_handler, monitor); g_signal_connect (bus, "sync-message", (GCallback) _bus_handler, monitor);
gst_object_unref (bus); gst_object_unref (bus);

View file

@ -186,7 +186,8 @@ gst_validate_media_info_load (const gchar * path, GError ** err)
if (err && *err) if (err && *err)
goto end; goto end;
mi->duration = g_key_file_get_uint64 (kf, "media-info", "file-duration", NULL); mi->duration =
g_key_file_get_uint64 (kf, "media-info", "file-duration", NULL);
mi->seekable = g_key_file_get_boolean (kf, "media-info", "seekable", NULL); mi->seekable = g_key_file_get_boolean (kf, "media-info", "seekable", NULL);
mi->is_image = g_key_file_get_boolean (kf, "media-info", "is-image", NULL); mi->is_image = g_key_file_get_boolean (kf, "media-info", "is-image", NULL);
@ -1042,25 +1043,25 @@ end:
} }
static gboolean static gboolean
check_is_image (GstDiscovererInfo *info) check_is_image (GstDiscovererInfo * info)
{ {
gboolean ret = FALSE; gboolean ret = FALSE;
GList *video_streams = gst_discoverer_info_get_video_streams (info); GList *video_streams = gst_discoverer_info_get_video_streams (info);
if (g_list_length (video_streams) == 1) { if (g_list_length (video_streams) == 1) {
if (gst_discoverer_video_info_is_image (video_streams->data)) { if (gst_discoverer_video_info_is_image (video_streams->data)) {
GList *audio_streams = gst_discoverer_info_get_audio_streams (info); GList *audio_streams = gst_discoverer_info_get_audio_streams (info);
if (audio_streams == NULL) if (audio_streams == NULL)
ret = TRUE; ret = TRUE;
else else
gst_discoverer_stream_info_list_free (audio_streams); gst_discoverer_stream_info_list_free (audio_streams);
}
} }
}
gst_discoverer_stream_info_list_free (video_streams); gst_discoverer_stream_info_list_free (video_streams);
return ret; return ret;
} }
gboolean gboolean
@ -1093,11 +1094,11 @@ gst_validate_media_info_inspect_uri (GstValidateMediaInfo * mi,
ret = check_file_duration (mi, info) & ret; ret = check_file_duration (mi, info) & ret;
if (mi->is_image) if (mi->is_image)
goto done; goto done;
check_seekable (mi, info); check_seekable (mi, info);
if (discover_only) if (discover_only)
goto done; goto done;
ret = check_playback (mi, &mi->playback_error) & ret; ret = check_playback (mi, &mi->playback_error) & ret;
ret = check_reverse_playback (mi, &mi->reverse_playback_error) & ret; ret = check_reverse_playback (mi, &mi->reverse_playback_error) & ret;
@ -1131,21 +1132,21 @@ gst_validate_media_info_compare (GstValidateMediaInfo * expected,
} }
if (extracted->discover_only == FALSE) { if (extracted->discover_only == FALSE) {
if (expected->playback_error == NULL && extracted->playback_error) { if (expected->playback_error == NULL && extracted->playback_error) {
g_print ("Playback is now failing with: %s\n", extracted->playback_error); g_print ("Playback is now failing with: %s\n", extracted->playback_error);
ret = FALSE; ret = FALSE;
} }
if (expected->reverse_playback_error == NULL if (expected->reverse_playback_error == NULL
&& extracted->reverse_playback_error) { && extracted->reverse_playback_error) {
g_print ("Reverse playback is now failing with: %s\n", g_print ("Reverse playback is now failing with: %s\n",
extracted->reverse_playback_error); extracted->reverse_playback_error);
ret = FALSE; ret = FALSE;
} }
if (expected->track_switch_error == NULL && extracted->track_switch_error) { if (expected->track_switch_error == NULL && extracted->track_switch_error) {
g_print ("Track switching is now failing with: %s\n", g_print ("Track switching is now failing with: %s\n",
extracted->track_switch_error); extracted->track_switch_error);
ret = FALSE; ret = FALSE;
} }
} }
if (extracted->stream_info == NULL || expected->stream_info == NULL) { if (extracted->stream_info == NULL || expected->stream_info == NULL) {

View file

@ -51,7 +51,7 @@ static GstValidateOverrideRegistry *_registry_default;
#define GST_VALIDATE_OVERRIDE_REGISTRY_UNLOCK(r) g_mutex_unlock (&r->mutex) #define GST_VALIDATE_OVERRIDE_REGISTRY_UNLOCK(r) g_mutex_unlock (&r->mutex)
#define GST_VALIDATE_OVERRIDE_INIT_SYMBOL "gst_validate_create_overrides" #define GST_VALIDATE_OVERRIDE_INIT_SYMBOL "gst_validate_create_overrides"
typedef int (*GstValidateCreateOverride)(void); typedef int (*GstValidateCreateOverride) (void);
static GstValidateOverrideRegistry * static GstValidateOverrideRegistry *
gst_validate_override_registry_new (void) gst_validate_override_registry_new (void)
@ -222,7 +222,8 @@ gst_validate_override_registry_preload (void)
module = g_module_open (*modname, G_MODULE_BIND_LAZY); module = g_module_open (*modname, G_MODULE_BIND_LAZY);
if (module == NULL) { if (module == NULL) {
loaderr = g_module_error (); loaderr = g_module_error ();
GST_ERROR ("Failed to load %s %s", *modname, loaderr ? loaderr : "no idea why"); GST_ERROR ("Failed to load %s %s", *modname,
loaderr ? loaderr : "no idea why");
continue; continue;
} }
if (g_module_symbol (module, GST_VALIDATE_OVERRIDE_INIT_SYMBOL, if (g_module_symbol (module, GST_VALIDATE_OVERRIDE_INIT_SYMBOL,
@ -237,7 +238,8 @@ gst_validate_override_registry_preload (void)
GST_INFO ("Loaded no overrides from %s", *modname); GST_INFO ("Loaded no overrides from %s", *modname);
} }
} else { } else {
GST_WARNING (GST_VALIDATE_OVERRIDE_INIT_SYMBOL " not found in %s", *modname); GST_WARNING (GST_VALIDATE_OVERRIDE_INIT_SYMBOL " not found in %s",
*modname);
} }
g_module_close (module); g_module_close (module);
} }

View file

@ -154,7 +154,7 @@ _structure_is_raw_audio (GstStructure * structure)
} }
static gchar * static gchar *
_get_event_string (GstEvent *event) _get_event_string (GstEvent * event)
{ {
const GstStructure *st; const GstStructure *st;
@ -841,7 +841,7 @@ gst_validate_pad_monitor_check_eos (GstValidatePadMonitor *
{ {
if (G_UNLIKELY (pad_monitor->is_eos)) { if (G_UNLIKELY (pad_monitor->is_eos)) {
GST_VALIDATE_REPORT (pad_monitor, BUFFER_AFTER_EOS, GST_VALIDATE_REPORT (pad_monitor, BUFFER_AFTER_EOS,
"Received buffer %" GST_PTR_FORMAT " after EOS", buffer); "Received buffer %" GST_PTR_FORMAT " after EOS", buffer);
} }
} }
@ -1192,7 +1192,8 @@ gst_validate_pad_monitor_flush (GstValidatePadMonitor * pad_monitor)
pad_monitor->is_eos = FALSE; pad_monitor->is_eos = FALSE;
pad_monitor->last_flow_return = GST_FLOW_OK; pad_monitor->last_flow_return = GST_FLOW_OK;
gst_caps_replace (&pad_monitor->last_caps, NULL); gst_caps_replace (&pad_monitor->last_caps, NULL);
pad_monitor->caps_is_audio = pad_monitor->caps_is_video = pad_monitor->caps_is_raw = FALSE; pad_monitor->caps_is_audio = pad_monitor->caps_is_video =
pad_monitor->caps_is_raw = FALSE;
g_list_free_full (pad_monitor->expired_events, g_list_free_full (pad_monitor->expired_events,
(GDestroyNotify) gst_event_unref); (GDestroyNotify) gst_event_unref);
@ -1679,13 +1680,15 @@ gst_validate_pad_monitor_buffer_probe (GstPad * pad, GstBuffer * buffer,
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)) && if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)) &&
GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)) && GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)) &&
((!gst_segment_clip (&monitor->segment, monitor->segment.format, ((!gst_segment_clip (&monitor->segment, monitor->segment.format,
GST_BUFFER_TIMESTAMP (buffer), GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_TIMESTAMP (buffer),
GST_BUFFER_DURATION (buffer), NULL, NULL)) || GST_BUFFER_TIMESTAMP (buffer) +
/* In the case of raw data, buffers should be strictly contained inside the GST_BUFFER_DURATION (buffer), NULL, NULL)) ||
* segment */ /* In the case of raw data, buffers should be strictly contained inside the
(monitor->caps_is_raw && * segment */
GST_BUFFER_PTS (buffer) + GST_BUFFER_DURATION (buffer) < monitor->segment.start)) (monitor->caps_is_raw &&
) { GST_BUFFER_PTS (buffer) + GST_BUFFER_DURATION (buffer) <
monitor->segment.start))
) {
/* TODO is this a timestamp issue? */ /* TODO is this a timestamp issue? */
GST_VALIDATE_REPORT (monitor, BUFFER_IS_OUT_OF_SEGMENT, GST_VALIDATE_REPORT (monitor, BUFFER_IS_OUT_OF_SEGMENT,
"buffer is out of segment and shouldn't be pushed. Timestamp: %" "buffer is out of segment and shouldn't be pushed. Timestamp: %"

View file

@ -260,11 +260,11 @@ gst_validate_report_init (void)
file_env = g_getenv ("GST_VALIDATE_FILE"); file_env = g_getenv ("GST_VALIDATE_FILE");
if (file_env != NULL && *file_env != '\0') { if (file_env != NULL && *file_env != '\0') {
log_file = g_fopen (file_env, "w"); log_file = g_fopen (file_env, "w");
if (log_file == NULL) { if (log_file == NULL) {
g_printerr ("Could not open log file '%s' for writing: %s\n", file_env, g_printerr ("Could not open log file '%s' for writing: %s\n", file_env,
g_strerror (errno)); g_strerror (errno));
log_file = stderr; log_file = stderr;
} }
} else { } else {
log_file = stdout; log_file = stdout;
@ -390,24 +390,24 @@ gst_validate_printf (gpointer source, const gchar * format, ...)
} }
void void
gst_validate_printf_valist (gpointer source, gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
const gchar * format, va_list args)
{ {
GString *string = g_string_new (NULL); GString *string = g_string_new (NULL);
if (source) { if (source) {
if (*(GType *) source == GST_TYPE_VALIDATE_ACTION) { if (*(GType *) source == GST_TYPE_VALIDATE_ACTION) {
GstValidateAction *action = (GstValidateAction*) source; GstValidateAction *action = (GstValidateAction *) source;
g_string_printf (string, "\n(Executing action: %s, number: %u at position: %" g_string_printf (string,
GST_TIME_FORMAT " repeat: %i) | ", g_strcmp0 (action->name, "") == 0 ? "\n(Executing action: %s, number: %u at position: %" GST_TIME_FORMAT
"Unnamed" : action->name, " repeat: %i) | ", g_strcmp0 (action->name,
action->action_number, GST_TIME_ARGS (action->playback_time), "") == 0 ? "Unnamed" : action->name, action->action_number,
action->repeat); GST_TIME_ARGS (action->playback_time), action->repeat);
} else if (GST_IS_OBJECT (source)) { } else if (GST_IS_OBJECT (source)) {
g_string_printf (string, "\n%s --> ", GST_OBJECT_NAME (source)); g_string_printf (string, "\n%s --> ", GST_OBJECT_NAME (source));
} else if (G_IS_OBJECT (source)) { } else if (G_IS_OBJECT (source)) {
g_string_printf (string, "\n<%s@%p> --> ", G_OBJECT_TYPE_NAME (source), source); g_string_printf (string, "\n<%s@%p> --> ", G_OBJECT_TYPE_NAME (source),
source);
} }
} }
@ -422,14 +422,16 @@ gst_validate_printf_valist (gpointer source,
void void
gst_validate_report_printf (GstValidateReport * report) gst_validate_report_printf (GstValidateReport * report)
{ {
gst_validate_printf (NULL, "%10s : %s\n", gst_validate_report_level_get_name (report->level), gst_validate_printf (NULL, "%10s : %s\n",
gst_validate_report_level_get_name (report->level),
report->issue->summary); report->issue->summary);
gst_validate_printf (NULL, "%*s Detected on <%s> at %" GST_TIME_FORMAT "\n", 12, "", gst_validate_printf (NULL, "%*s Detected on <%s> at %" GST_TIME_FORMAT "\n",
gst_validate_reporter_get_name (report->reporter), 12, "", gst_validate_reporter_get_name (report->reporter),
GST_TIME_ARGS (report->timestamp)); GST_TIME_ARGS (report->timestamp));
if (report->message) if (report->message)
gst_validate_printf (NULL, "%*s Details : %s\n", 12, "", report->message); gst_validate_printf (NULL, "%*s Details : %s\n", 12, "", report->message);
if (report->issue->description) if (report->issue->description)
gst_validate_printf (NULL, "%*s Description : %s\n", 12, "", report->issue->description); gst_validate_printf (NULL, "%*s Description : %s\n", 12, "",
report->issue->description);
gst_validate_printf (NULL, "\n"); gst_validate_printf (NULL, "\n");
} }

View file

@ -38,7 +38,7 @@ typedef struct _GstValidateReporterPrivate
guint log_handler_id; guint log_handler_id;
} GstValidateReporterPrivate; } GstValidateReporterPrivate;
static GstValidateReporterPrivate * g_log_handler = NULL; static GstValidateReporterPrivate *g_log_handler = NULL;
G_DEFINE_INTERFACE (GstValidateReporter, gst_validate_reporter, G_TYPE_OBJECT); G_DEFINE_INTERFACE (GstValidateReporter, gst_validate_reporter, G_TYPE_OBJECT);
@ -226,7 +226,8 @@ gst_validate_reporter_set_runner (GstValidateReporter * reporter,
void void
gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter) gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter)
{ {
g_log_set_default_handler ((GLogFunc) gst_validate_reporter_g_log_func, reporter); g_log_set_default_handler ((GLogFunc) gst_validate_reporter_g_log_func,
reporter);
g_log_handler = gst_validate_reporter_get_priv (reporter); g_log_handler = gst_validate_reporter_get_priv (reporter);
} }

View file

@ -446,8 +446,8 @@ _read_power (MathParser * parser)
} }
gdouble gdouble
gst_validate_utils_parse_expression (const gchar * expr, ParseVariableFunc variable_func, gst_validate_utils_parse_expression (const gchar * expr,
gpointer user_data, gchar ** error) ParseVariableFunc variable_func, gpointer user_data, gchar ** error)
{ {
gdouble val; gdouble val;
MathParser parser; MathParser parser;
@ -489,7 +489,8 @@ gst_validate_utils_flags_from_str (GType type, const gchar * str_flags)
} }
gboolean gboolean
gst_validate_utils_enum_from_str (GType type, const gchar * str_enum, guint * enum_value) gst_validate_utils_enum_from_str (GType type, const gchar * str_enum,
guint * enum_value)
{ {
guint i; guint i;
GEnumClass *class = g_type_class_ref (type); GEnumClass *class = g_type_class_ref (type);

View file

@ -139,8 +139,8 @@ gst_media_descriptor_finalize (GstMediaDescriptor * self)
if (self->filenode) if (self->filenode)
free_filenode (self->filenode); free_filenode (self->filenode);
G_OBJECT_CLASS (gst_media_descriptor_parent_class)-> G_OBJECT_CLASS (gst_media_descriptor_parent_class)->finalize (G_OBJECT
finalize (G_OBJECT (self)); (self));
} }
static void static void
@ -203,7 +203,8 @@ gst_media_descriptor_class_init (GstMediaDescriptorClass * self_class)
} }
static gint static gint
compare_tags (GstMediaDescriptor *ref, StreamNode *rstream, StreamNode *cstream) compare_tags (GstMediaDescriptor * ref, StreamNode * rstream,
StreamNode * cstream)
{ {
gboolean found; gboolean found;
TagNode *rtag, *ctag; TagNode *rtag, *ctag;
@ -233,7 +234,7 @@ compare_tags (GstMediaDescriptor *ref, StreamNode *rstream, StreamNode *cstream)
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Reference descriptor for stream %s has tags %s" "Reference descriptor for stream %s has tags %s"
" but no equivalent taglist was found on the compared stream", " but no equivalent taglist was found on the compared stream",
rstream->id, rtaglist); rstream->id, rtaglist);
g_free (rtaglist); g_free (rtaglist);
return 0; return 0;
@ -245,17 +246,17 @@ compare_tags (GstMediaDescriptor *ref, StreamNode *rstream, StreamNode *cstream)
/* Return -1 if not found 1 if OK 0 if an error occured */ /* Return -1 if not found 1 if OK 0 if an error occured */
static gint static gint
comparse_stream (GstMediaDescriptor *ref, StreamNode *rstream, StreamNode *cstream) comparse_stream (GstMediaDescriptor * ref, StreamNode * rstream,
StreamNode * cstream)
{ {
if (g_strcmp0 (rstream->id, cstream->id) == 0) { if (g_strcmp0 (rstream->id, cstream->id) == 0) {
if (!gst_caps_is_equal (rstream->caps, cstream->caps)) { if (!gst_caps_is_equal (rstream->caps, cstream->caps)) {
gchar *rcaps = gst_caps_to_string (rstream->caps), gchar *rcaps = gst_caps_to_string (rstream->caps),
*ccaps = gst_caps_to_string (cstream->caps); *ccaps = gst_caps_to_string (cstream->caps);
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Reference descriptor for stream %s has caps: %s" "Reference descriptor for stream %s has caps: %s"
" but compared stream %s has caps: %s", " but compared stream %s has caps: %s",
rstream->id, rcaps, rstream->id, rcaps, cstream->id, ccaps);
cstream->id, ccaps);
g_free (rcaps); g_free (rcaps);
g_free (ccaps); g_free (ccaps);
return 0; return 0;
@ -276,8 +277,8 @@ gst_media_descriptors_compare (GstMediaDescriptor * ref,
if (rfilenode->duration != cfilenode->duration) { if (rfilenode->duration != cfilenode->duration) {
GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT,
"Duration %" GST_TIME_FORMAT " is different from the reference %" GST_TIME_FORMAT, "Duration %" GST_TIME_FORMAT " is different from the reference %"
GST_TIME_ARGS (cfilenode->duration), GST_TIME_FORMAT, GST_TIME_ARGS (cfilenode->duration),
GST_TIME_ARGS (rfilenode->duration)); GST_TIME_ARGS (rfilenode->duration));
} }
@ -300,7 +301,7 @@ gst_media_descriptors_compare (GstMediaDescriptor * ref,
for (rstream_list = rfilenode->streams; rstream_list; for (rstream_list = rfilenode->streams; rstream_list;
rstream_list = rstream_list->next) { rstream_list = rstream_list->next) {
GList *cstream_list; GList *cstream_list;
gint sfound = -1; gint sfound = -1;
for (cstream_list = cfilenode->streams; cstream_list; for (cstream_list = cfilenode->streams; cstream_list;
cstream_list = cstream_list->next) { cstream_list = cstream_list->next) {
@ -309,14 +310,14 @@ gst_media_descriptors_compare (GstMediaDescriptor * ref,
if (sfound == 0) { if (sfound == 0) {
return FALSE; return FALSE;
} else if (sfound == 1) { } else if (sfound == 1) {
break; break;
} }
} }
if (sfound == FALSE) { if (sfound == FALSE) {
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT, GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Could not find stream %s in the compared descriptor", "Could not find stream %s in the compared descriptor",
((StreamNode*) rstream_list->data)->id); ((StreamNode *) rstream_list->data)->id);
return FALSE; return FALSE;
} }

View file

@ -48,7 +48,7 @@ main (int argc, gchar ** argv)
gchar *output = NULL; gchar *output = NULL;
GstMediaDescriptorWriter *writer; GstMediaDescriptorWriter *writer;
GstValidateRunner *runner; GstValidateRunner *runner;
GstMediaDescriptorParser * reference = NULL; GstMediaDescriptorParser *reference = NULL;
GOptionEntry options[] = { GOptionEntry options[] = {
{"output-file", 'o', 0, G_OPTION_ARG_FILENAME, {"output-file", 'o', 0, G_OPTION_ARG_FILENAME,
@ -93,7 +93,8 @@ main (int argc, gchar ** argv)
g_option_context_free (ctx); g_option_context_free (ctx);
runner = gst_validate_runner_new (); runner = gst_validate_runner_new ();
writer = gst_media_descriptor_writer_new_discover (runner, argv[1], full, NULL); writer =
gst_media_descriptor_writer_new_discover (runner, argv[1], full, NULL);
if (writer == NULL) { if (writer == NULL) {
g_print ("Could not discover file: %s", argv[1]); g_print ("Could not discover file: %s", argv[1]);
return 1; return 1;
@ -103,8 +104,7 @@ main (int argc, gchar ** argv)
gst_media_descriptor_writer_write (writer, output_file); gst_media_descriptor_writer_write (writer, output_file);
if (expected_file) { if (expected_file) {
reference = gst_media_descriptor_parser_new (runner, reference = gst_media_descriptor_parser_new (runner, expected_file, NULL);
expected_file, NULL);
if (reference == NULL) { if (reference == NULL) {
g_print ("Could not parse file: %s", expected_file); g_print ("Could not parse file: %s", expected_file);

View file

@ -55,7 +55,7 @@ typedef struct
{ {
volatile gint refcount; volatile gint refcount;
GstSegment segment; /* The currently configured segment */ GstSegment segment; /* The currently configured segment */
/* FIXME Do we need a weak ref here? */ /* FIXME Do we need a weak ref here? */
GstValidateScenario *scenario; GstValidateScenario *scenario;
@ -95,7 +95,7 @@ intr_handler (gpointer user_data)
#endif /* G_OS_UNIX */ #endif /* G_OS_UNIX */
static void static void
key_unit_data_unref (KeyUnitProbeInfo *info) key_unit_data_unref (KeyUnitProbeInfo * info)
{ {
if (G_UNLIKELY (g_atomic_int_dec_and_test (&info->refcount))) { if (G_UNLIKELY (g_atomic_int_dec_and_test (&info->refcount))) {
g_slice_free (KeyUnitProbeInfo, info); g_slice_free (KeyUnitProbeInfo, info);
@ -103,7 +103,7 @@ key_unit_data_unref (KeyUnitProbeInfo *info)
} }
static KeyUnitProbeInfo * static KeyUnitProbeInfo *
key_unit_data_ref (KeyUnitProbeInfo *info) key_unit_data_ref (KeyUnitProbeInfo * info)
{ {
g_atomic_int_inc (&info->refcount); g_atomic_int_inc (&info->refcount);
@ -111,7 +111,7 @@ key_unit_data_ref (KeyUnitProbeInfo *info)
} }
static KeyUnitProbeInfo * static KeyUnitProbeInfo *
key_unit_data_new (GstValidateScenario *scenario, GstClockTime running_time) key_unit_data_new (GstValidateScenario * scenario, GstClockTime running_time)
{ {
KeyUnitProbeInfo *info = g_slice_new0 (KeyUnitProbeInfo); KeyUnitProbeInfo *info = g_slice_new0 (KeyUnitProbeInfo);
info->refcount = 1; info->refcount = 1;
@ -123,7 +123,8 @@ key_unit_data_new (GstValidateScenario *scenario, GstClockTime running_time)
} }
static GstPadProbeReturn static GstPadProbeReturn
_check_is_key_unit_cb (GstPad * pad, GstPadProbeInfo * info, KeyUnitProbeInfo *kuinfo) _check_is_key_unit_cb (GstPad * pad, GstPadProbeInfo * info,
KeyUnitProbeInfo * kuinfo)
{ {
if (GST_IS_EVENT (GST_PAD_PROBE_INFO_DATA (info))) { if (GST_IS_EVENT (GST_PAD_PROBE_INFO_DATA (info))) {
if (gst_video_event_is_force_key_unit (GST_PAD_PROBE_INFO_DATA (info))) if (gst_video_event_is_force_key_unit (GST_PAD_PROBE_INFO_DATA (info)))
@ -135,38 +136,40 @@ _check_is_key_unit_cb (GstPad * pad, GstPadProbeInfo * info, KeyUnitProbeInfo *k
gst_event_parse_segment (info->data, &segment); gst_event_parse_segment (info->data, &segment);
kuinfo->segment = *segment; kuinfo->segment = *segment;
} }
} else if (GST_IS_BUFFER (GST_PAD_PROBE_INFO_DATA (info)) && kuinfo->seen_event) { } else if (GST_IS_BUFFER (GST_PAD_PROBE_INFO_DATA (info))
&& kuinfo->seen_event) {
if (GST_CLOCK_TIME_IS_VALID (kuinfo->running_time)) { if (GST_CLOCK_TIME_IS_VALID (kuinfo->running_time)) {
GstClockTime running_time = gst_segment_to_running_time (&kuinfo->segment, GstClockTime running_time = gst_segment_to_running_time (&kuinfo->segment,
GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (info->data)); GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (info->data));
if (running_time < kuinfo->running_time) if (running_time < kuinfo->running_time)
return GST_PAD_PROBE_OK; return GST_PAD_PROBE_OK;
} }
if (GST_BUFFER_FLAG_IS_SET (GST_PAD_PROBE_INFO_BUFFER (info), GST_BUFFER_FLAG_DELTA_UNIT)) { if (GST_BUFFER_FLAG_IS_SET (GST_PAD_PROBE_INFO_BUFFER (info),
if (kuinfo->count_bufs >= NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE) { GST_BUFFER_FLAG_DELTA_UNIT)) {
GST_VALIDATE_REPORT (kuinfo->scenario, if (kuinfo->count_bufs >= NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE) {
SCENARIO_ACTION_EXECUTION_ERROR, GST_VALIDATE_REPORT (kuinfo->scenario,
"Did not receive a key frame after requested one, " SCENARIO_ACTION_EXECUTION_ERROR,
" at running_time %" GST_TIME_FORMAT " (with a %i " "Did not receive a key frame after requested one, "
"frame tolerance)", GST_TIME_ARGS (kuinfo->running_time), " at running_time %" GST_TIME_FORMAT " (with a %i "
NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE); "frame tolerance)", GST_TIME_ARGS (kuinfo->running_time),
NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE);
return GST_PAD_PROBE_REMOVE; return GST_PAD_PROBE_REMOVE;
} }
kuinfo->count_bufs++; kuinfo->count_bufs++;
} else { } else {
GST_DEBUG_OBJECT (kuinfo->scenario, GST_DEBUG_OBJECT (kuinfo->scenario,
"Properly got keyframe after \"force-keyframe\" event " "Properly got keyframe after \"force-keyframe\" event "
"with running_time %" GST_TIME_FORMAT " (latency %d frame(s))", "with running_time %" GST_TIME_FORMAT " (latency %d frame(s))",
GST_TIME_ARGS (kuinfo->running_time), kuinfo->count_bufs); GST_TIME_ARGS (kuinfo->running_time), kuinfo->count_bufs);
return GST_PAD_PROBE_REMOVE; return GST_PAD_PROBE_REMOVE;
} }
} }
return GST_PAD_PROBE_OK; return GST_PAD_PROBE_OK;
} }
@ -176,11 +179,11 @@ _find_video_encoder (GValue * velement, gpointer udata)
{ {
GstElement *element = g_value_get_object (velement); GstElement *element = g_value_get_object (velement);
const gchar *klass = gst_element_class_get_metadata (GST_ELEMENT_GET_CLASS (element), const gchar *klass =
gst_element_class_get_metadata (GST_ELEMENT_GET_CLASS (element),
GST_ELEMENT_METADATA_KLASS); GST_ELEMENT_METADATA_KLASS);
if (g_strstr_len (klass, -1, "Video") && if (g_strstr_len (klass, -1, "Video") && g_strstr_len (klass, -1, "Encoder")) {
g_strstr_len (klass, -1, "Encoder")) {
return 0; return 0;
} }
@ -210,7 +213,7 @@ _execute_request_key_unit (GstValidateScenario * scenario,
iter = gst_bin_iterate_recurse (GST_BIN (encodebin)); iter = gst_bin_iterate_recurse (GST_BIN (encodebin));
if (!gst_iterator_find_custom (iter, if (!gst_iterator_find_custom (iter,
(GCompareFunc) _find_video_encoder, &result,NULL)) { (GCompareFunc) _find_video_encoder, &result, NULL)) {
g_error ("Could not find any video encode"); g_error ("Could not find any video encode");
goto fail; goto fail;
@ -254,8 +257,7 @@ _execute_request_key_unit (GstValidateScenario * scenario,
gst_pad_add_probe (encoder_srcpad, gst_pad_add_probe (encoder_srcpad,
GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
(GstPadProbeCallback) _check_is_key_unit_cb, (GstPadProbeCallback) _check_is_key_unit_cb,
key_unit_data_ref (info), key_unit_data_ref (info), (GDestroyNotify) key_unit_data_unref);
(GDestroyNotify) key_unit_data_unref);
} else if (g_strcmp0 (direction, "downstream") == 0) { } else if (g_strcmp0 (direction, "downstream") == 0) {
GstClockTime timestamp = GST_CLOCK_TIME_NONE, GstClockTime timestamp = GST_CLOCK_TIME_NONE,
stream_time = GST_CLOCK_TIME_NONE; stream_time = GST_CLOCK_TIME_NONE;
@ -274,14 +276,14 @@ _execute_request_key_unit (GstValidateScenario * scenario,
gst_validate_action_get_clocktime (scenario, action, gst_validate_action_get_clocktime (scenario, action,
"stream-time", &stream_time); "stream-time", &stream_time);
event = gst_video_event_new_downstream_force_key_unit (timestamp, stream_time, event =
gst_video_event_new_downstream_force_key_unit (timestamp, stream_time,
running_time, all_headers, count); running_time, all_headers, count);
gst_pad_add_probe (pad, gst_pad_add_probe (pad,
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) _check_is_key_unit_cb, (GstPadProbeCallback) _check_is_key_unit_cb,
key_unit_data_ref (info), key_unit_data_ref (info), (GDestroyNotify) key_unit_data_unref);
(GDestroyNotify) key_unit_data_unref);
} else { } else {
g_error ("request keyunit direction %s invalide (should be in" g_error ("request keyunit direction %s invalide (should be in"
" [downstrean, upstream]", direction); " [downstrean, upstream]", direction);
@ -289,15 +291,15 @@ _execute_request_key_unit (GstValidateScenario * scenario,
goto fail; goto fail;
} }
gst_validate_printf (action, "Sendings a \"force key unit\" event %s\n", direction); gst_validate_printf (action, "Sendings a \"force key unit\" event %s\n",
direction);
segment_query = gst_query_new_segment (GST_FORMAT_TIME); segment_query = gst_query_new_segment (GST_FORMAT_TIME);
gst_pad_query (encoder_srcpad, segment_query); gst_pad_query (encoder_srcpad, segment_query);
gst_query_parse_segment (segment_query, &(info->segment.rate), gst_query_parse_segment (segment_query, &(info->segment.rate),
&(info->segment.format), &(info->segment.format),
(gint64*) &(info->segment.start), (gint64 *) & (info->segment.start), (gint64 *) & (info->segment.stop));
(gint64*) &(info->segment.stop));
gst_pad_add_probe (encoder_srcpad, gst_pad_add_probe (encoder_srcpad,
GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
@ -306,8 +308,8 @@ _execute_request_key_unit (GstValidateScenario * scenario,
if (!gst_pad_send_event (pad, event)) { if (!gst_pad_send_event (pad, event)) {
GST_VALIDATE_REPORT (scenario, SCENARIO_ACTION_EXECUTION_ERROR, GST_VALIDATE_REPORT (scenario, SCENARIO_ACTION_EXECUTION_ERROR,
"Could not send \"force key unit\" event %s", direction); "Could not send \"force key unit\" event %s", direction);
goto fail; goto fail;
} }
@ -493,10 +495,10 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message)) if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
&& state == GST_STATE_NULL) { && state == GST_STATE_NULL) {
GST_VALIDATE_REPORT (GST_MESSAGE_SRC (message), GST_VALIDATE_REPORT (GST_MESSAGE_SRC (message),
SCENARIO_ACTION_EXECUTION_ISSUE, SCENARIO_ACTION_EXECUTION_ISSUE,
"Force stopping a transcoding pipeline is not recommanded" "Force stopping a transcoding pipeline is not recommanded"
" you should make sure to finalize it using a EOS event"); " you should make sure to finalize it using a EOS event");
gst_validate_printf (pipeline, "State change request NULL, " gst_validate_printf (pipeline, "State change request NULL, "
"quiting mainloop\n"); "quiting mainloop\n");
@ -701,10 +703,12 @@ _register_actions (void)
{ {
const gchar *resize_video_mandatory_fields[] = { "restriction-caps", NULL }; const gchar *resize_video_mandatory_fields[] = { "restriction-caps", NULL };
const gchar *force_key_unit_mandatory_fields[] = { "direction", const gchar *force_key_unit_mandatory_fields[] = { "direction",
"running-time", "all-headers", "count", NULL }; "running-time", "all-headers", "count", NULL
};
gst_validate_add_action_type ("set-restriction", _execute_set_restriction, gst_validate_add_action_type ("set-restriction", _execute_set_restriction,
resize_video_mandatory_fields, "Change the restriction caps on the fly", FALSE); resize_video_mandatory_fields, "Change the restriction caps on the fly",
FALSE);
gst_validate_add_action_type ("video-request-key-unit", gst_validate_add_action_type ("video-request-key-unit",
_execute_request_key_unit, force_key_unit_mandatory_fields, _execute_request_key_unit, force_key_unit_mandatory_fields,
"Request a video key unit", FALSE); "Request a video key unit", FALSE);
@ -745,9 +749,9 @@ main (int argc, gchar ** argv)
"Let you set a scenario, it will override the GST_VALIDATE_SCENARIO " "Let you set a scenario, it will override the GST_VALIDATE_SCENARIO "
"environment variable", NULL}, "environment variable", NULL},
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs, {"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
"Let you set a config scenario, the scenario needs to be set as 'config" "Let you set a config scenario, the scenario needs to be set as 'config"
"' you can specify a list of scenario separated by ':'" "' you can specify a list of scenario separated by ':'"
" it will override the GST_VALIDATE_SCENARIO environment variable,", " it will override the GST_VALIDATE_SCENARIO environment variable,",
NULL}, NULL},
{"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &eos_on_shutdown, {"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &eos_on_shutdown,
"If an EOS event should be sent to the pipeline if an interrupt is " "If an EOS event should be sent to the pipeline if an interrupt is "
@ -757,12 +761,12 @@ main (int argc, gchar ** argv)
{"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios, {"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios,
"List the avalaible scenarios that can be run", NULL}, "List the avalaible scenarios that can be run", NULL},
{"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME, {"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME,
&output_file, "The output file to store scenarios details. " &output_file, "The output file to store scenarios details. "
"Implies --list-scenario", "Implies --list-scenario",
NULL}, NULL},
{"force-reencoding", 'r', 0, G_OPTION_ARG_NONE, &force_reencoding, {"force-reencoding", 'r', 0, G_OPTION_ARG_NONE, &force_reencoding,
"Whether to try to force reencoding, meaning trying to only remux " "Whether to try to force reencoding, meaning trying to only remux "
"if possible(default: TRUE)", NULL}, "if possible(default: TRUE)", NULL},
{NULL} {NULL}
}; };
@ -812,7 +816,7 @@ main (int argc, gchar ** argv)
if (list_scenarios || output_file) { if (list_scenarios || output_file) {
if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file)) if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file))
return 1; return 1;
return 0; return 0;
} }

View file

@ -128,9 +128,9 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
gst_message_parse_request_state (message, &state); gst_message_parse_request_state (message, &state);
if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message)) if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
&& state == GST_STATE_NULL) { && state == GST_STATE_NULL) {
gst_validate_printf (GST_MESSAGE_SRC (message), "State change request NULL, " gst_validate_printf (GST_MESSAGE_SRC (message),
"quiting mainloop\n"); "State change request NULL, " "quiting mainloop\n");
g_main_loop_quit (mainloop); g_main_loop_quit (mainloop);
} }
break; break;
@ -143,7 +143,7 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
} }
static gboolean static gboolean
_is_playbin_pipeline (int argc, gchar **argv) _is_playbin_pipeline (int argc, gchar ** argv)
{ {
gint i; gint i;
@ -157,10 +157,11 @@ _is_playbin_pipeline (int argc, gchar **argv)
} }
static gboolean static gboolean
_execute_set_subtitles (GstValidateScenario * scenario, GstValidateAction * action) _execute_set_subtitles (GstValidateScenario * scenario,
GstValidateAction * action)
{ {
gchar *uri, *fname; gchar *uri, *fname;
GFile * tmpfile, *folder; GFile *tmpfile, *folder;
const gchar *subtitle_file, *subtitle_dir; const gchar *subtitle_file, *subtitle_dir;
subtitle_file = gst_structure_get_string (action->structure, "subtitle-file"); subtitle_file = gst_structure_get_string (action->structure, "subtitle-file");
@ -176,8 +177,7 @@ _execute_set_subtitles (GstValidateScenario * scenario, GstValidateAction * acti
fname = g_strdup_printf ("%s%s%s%s", fname = g_strdup_printf ("%s%s%s%s",
subtitle_dir ? subtitle_dir : "", subtitle_dir ? subtitle_dir : "",
subtitle_dir ? G_DIR_SEPARATOR_S : "", subtitle_dir ? G_DIR_SEPARATOR_S : "",
g_file_get_basename (tmpfile), g_file_get_basename (tmpfile), subtitle_file);
subtitle_file);
gst_object_unref (tmpfile); gst_object_unref (tmpfile);
tmpfile = g_file_get_child (folder, fname); tmpfile = g_file_get_child (folder, fname);
@ -206,12 +206,14 @@ _execute_switch_track (GstValidateScenario * scenario,
if (!(type = gst_structure_get_string (action->structure, "type"))) if (!(type = gst_structure_get_string (action->structure, "type")))
type = "audio"; type = "audio";
tflag = gst_validate_utils_flags_from_str (g_type_from_name ("GstPlayFlags"), type); tflag =
gst_validate_utils_flags_from_str (g_type_from_name ("GstPlayFlags"),
type);
current_txt = g_strdup_printf ("current-%s", type); current_txt = g_strdup_printf ("current-%s", type);
tmp = g_strdup_printf ("n-%s", type); tmp = g_strdup_printf ("n-%s", type);
g_object_get (scenario->pipeline, "flags", &flags, tmp, &n, g_object_get (scenario->pipeline, "flags", &flags, tmp, &n,
current_txt, &current, NULL); current_txt, &current, NULL);
g_free (tmp); g_free (tmp);
@ -219,7 +221,8 @@ _execute_switch_track (GstValidateScenario * scenario,
disabling = TRUE; disabling = TRUE;
flags &= ~tflag; flags &= ~tflag;
index = -1; index = -1;
} else if (!(str_index = gst_structure_get_string (action->structure, "index"))) { } else if (!(str_index =
gst_structure_get_string (action->structure, "index"))) {
if (!gst_structure_get_int (action->structure, "index", &index)) { if (!gst_structure_get_int (action->structure, "index", &index)) {
GST_WARNING ("No index given, defaulting to +1"); GST_WARNING ("No index given, defaulting to +1");
index = 1; index = 1;
@ -230,7 +233,7 @@ _execute_switch_track (GstValidateScenario * scenario,
index = g_ascii_strtoll (str_index, NULL, 10); index = g_ascii_strtoll (str_index, NULL, 10);
} }
if (relative) { /* We are changing track relatively to current track */ if (relative) { /* We are changing track relatively to current track */
index = current + index; index = current + index;
if (current >= n) if (current >= n)
index = -2; index = -2;
@ -238,7 +241,8 @@ _execute_switch_track (GstValidateScenario * scenario,
if (!disabling) { if (!disabling) {
tmp = g_strdup_printf ("get-%s-pad", type); tmp = g_strdup_printf ("get-%s-pad", type);
g_signal_emit_by_name (G_OBJECT (scenario->pipeline), tmp, current, &oldpad); g_signal_emit_by_name (G_OBJECT (scenario->pipeline), tmp, current,
&oldpad);
g_signal_emit_by_name (G_OBJECT (scenario->pipeline), tmp, index, &newpad); g_signal_emit_by_name (G_OBJECT (scenario->pipeline), tmp, index, &newpad);
gst_validate_printf (action, "Switching to track number: %i," gst_validate_printf (action, "Switching to track number: %i,"
@ -277,13 +281,13 @@ main (int argc, gchar ** argv)
{"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios, {"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios,
"List the avalaible scenarios that can be run", NULL}, "List the avalaible scenarios that can be run", NULL},
{"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME, {"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME,
&output_file, "The output file to store scenarios details. " &output_file, "The output file to store scenarios details. "
"Implies --list-scenario", "Implies --list-scenario",
NULL}, NULL},
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs, {"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
"Let you set a config scenario, the scenario needs to be set as 'config" "Let you set a config scenario, the scenario needs to be set as 'config"
"' you can specify a list of scenario separated by ':'" "' you can specify a list of scenario separated by ':'"
" it will override the GST_VALIDATE_SCENARIO environment variable,", " it will override the GST_VALIDATE_SCENARIO environment variable,",
NULL}, NULL},
{NULL} {NULL}
}; };
@ -330,7 +334,7 @@ main (int argc, gchar ** argv)
if (list_scenarios || output_file) { if (list_scenarios || output_file) {
if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file)) if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file))
return 1; return 1;
return 0; return 0;
} }
@ -358,7 +362,6 @@ main (int argc, gchar ** argv)
gst_bin_add (GST_BIN (new_pipeline), pipeline); gst_bin_add (GST_BIN (new_pipeline), pipeline);
pipeline = new_pipeline; pipeline = new_pipeline;
} }
#ifdef G_OS_UNIX #ifdef G_OS_UNIX
signal_watch_id = signal_watch_id =
g_unix_signal_add (SIGINT, (GSourceFunc) intr_handler, pipeline); g_unix_signal_add (SIGINT, (GSourceFunc) intr_handler, pipeline);
@ -379,7 +382,7 @@ main (int argc, gchar ** argv)
FALSE); FALSE);
/* Overriding default implementation */ /* Overriding default implementation */
gst_validate_add_action_type ("switch-track", _execute_switch_track, NULL, gst_validate_add_action_type ("switch-track", _execute_switch_track, NULL,
"The 'switch-track' command can be used to switch tracks.\n" "The 'switch-track' command can be used to switch tracks.\n"
"The 'type' argument selects which track type to change (can be 'audio', 'video'," "The 'type' argument selects which track type to change (can be 'audio', 'video',"
" or 'text'). The 'index' argument selects which track of this type" " or 'text'). The 'index' argument selects which track of this type"