switch (prop_id) {
case PROP_STATELESS:
- monitor->stateless = g_value_get_boolean(value);
+ monitor->stateless = g_value_get_boolean (value);
if (monitor->scenario != NULL)
- g_object_set(monitor->scenario, "stateless", monitor->stateless, NULL);
+ g_object_set (monitor->scenario, "stateless", monitor->stateless, NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gobject_class->dispose = gst_validate_bin_monitor_dispose;
g_object_class_install_property (gobject_class, PROP_STATELESS,
- g_param_spec_boolean ("stateless", "Stateless", "True to execute actions as soon as possible, regardless "
- "of the initial state of the pipeline",
- FALSE, G_PARAM_READWRITE));
+ g_param_spec_boolean ("stateless", "Stateless",
+ "True to execute actions as soon as possible, regardless "
+ "of the initial state of the pipeline", FALSE, G_PARAM_READWRITE));
validatemonitor_class->setup = gst_validate_bin_monitor_setup;
}
}
static gboolean
-print_position (GstValidateMonitor *monitor)
+print_position (GstValidateMonitor * monitor)
{
GstQuery *query;
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;
GstFormat format = GST_FORMAT_TIME;
}
static void
-_bus_handler (GstBus * bus, GstMessage * message, GstValidateBinMonitor *monitor)
+_bus_handler (GstBus * bus, GstMessage * message,
+ GstValidateBinMonitor * monitor)
{
GError *err;
gchar *debug;
GstBus *bus;
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));
- gst_bus_enable_sync_message_emission(bus);
+ gst_bus_enable_sync_message_emission (bus);
g_signal_connect (bus, "sync-message", (GCallback) _bus_handler, monitor);
gst_object_unref (bus);
if (err && *err)
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->is_image = g_key_file_get_boolean (kf, "media-info", "is-image", NULL);
}
static gboolean
-check_is_image (GstDiscovererInfo *info)
+check_is_image (GstDiscovererInfo * info)
{
- gboolean ret = FALSE;
- GList *video_streams = gst_discoverer_info_get_video_streams (info);
+ gboolean ret = FALSE;
+ GList *video_streams = gst_discoverer_info_get_video_streams (info);
- if (g_list_length (video_streams) == 1) {
- if (gst_discoverer_video_info_is_image (video_streams->data)) {
- GList *audio_streams = gst_discoverer_info_get_audio_streams (info);
+ if (g_list_length (video_streams) == 1) {
+ if (gst_discoverer_video_info_is_image (video_streams->data)) {
+ GList *audio_streams = gst_discoverer_info_get_audio_streams (info);
- if (audio_streams == NULL)
- ret = TRUE;
- else
- gst_discoverer_stream_info_list_free (audio_streams);
- }
+ if (audio_streams == NULL)
+ ret = TRUE;
+ else
+ 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
ret = check_file_duration (mi, info) & ret;
if (mi->is_image)
- goto done;
+ goto done;
check_seekable (mi, info);
if (discover_only)
- goto done;
+ goto done;
ret = check_playback (mi, &mi->playback_error) & ret;
ret = check_reverse_playback (mi, &mi->reverse_playback_error) & ret;
}
if (extracted->discover_only == FALSE) {
- if (expected->playback_error == NULL && extracted->playback_error) {
- g_print ("Playback is now failing with: %s\n", extracted->playback_error);
- ret = FALSE;
- }
- if (expected->reverse_playback_error == NULL
- && extracted->reverse_playback_error) {
- g_print ("Reverse playback is now failing with: %s\n",
- extracted->reverse_playback_error);
- ret = FALSE;
- }
- if (expected->track_switch_error == NULL && extracted->track_switch_error) {
- g_print ("Track switching is now failing with: %s\n",
- extracted->track_switch_error);
- ret = FALSE;
- }
+ if (expected->playback_error == NULL && extracted->playback_error) {
+ g_print ("Playback is now failing with: %s\n", extracted->playback_error);
+ ret = FALSE;
+ }
+ if (expected->reverse_playback_error == NULL
+ && extracted->reverse_playback_error) {
+ g_print ("Reverse playback is now failing with: %s\n",
+ extracted->reverse_playback_error);
+ ret = FALSE;
+ }
+ if (expected->track_switch_error == NULL && extracted->track_switch_error) {
+ g_print ("Track switching is now failing with: %s\n",
+ extracted->track_switch_error);
+ ret = FALSE;
+ }
}
if (extracted->stream_info == NULL || expected->stream_info == NULL) {
#define GST_VALIDATE_OVERRIDE_REGISTRY_UNLOCK(r) g_mutex_unlock (&r->mutex)
#define GST_VALIDATE_OVERRIDE_INIT_SYMBOL "gst_validate_create_overrides"
-typedef int (*GstValidateCreateOverride)(void);
+typedef int (*GstValidateCreateOverride) (void);
static GstValidateOverrideRegistry *
gst_validate_override_registry_new (void)
module = g_module_open (*modname, G_MODULE_BIND_LAZY);
if (module == NULL) {
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;
}
if (g_module_symbol (module, GST_VALIDATE_OVERRIDE_INIT_SYMBOL,
GST_INFO ("Loaded no overrides from %s", *modname);
}
} 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);
}
}
static gchar *
-_get_event_string (GstEvent *event)
+_get_event_string (GstEvent * event)
{
const GstStructure *st;
{
if (G_UNLIKELY (pad_monitor->is_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);
}
}
pad_monitor->is_eos = FALSE;
pad_monitor->last_flow_return = GST_FLOW_OK;
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,
(GDestroyNotify) gst_event_unref);
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)) &&
GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)) &&
((!gst_segment_clip (&monitor->segment, monitor->segment.format,
- GST_BUFFER_TIMESTAMP (buffer), GST_BUFFER_TIMESTAMP (buffer) +
- GST_BUFFER_DURATION (buffer), NULL, NULL)) ||
- /* In the case of raw data, buffers should be strictly contained inside the
- * segment */
- (monitor->caps_is_raw &&
- GST_BUFFER_PTS (buffer) + GST_BUFFER_DURATION (buffer) < monitor->segment.start))
- ) {
+ GST_BUFFER_TIMESTAMP (buffer),
+ GST_BUFFER_TIMESTAMP (buffer) +
+ GST_BUFFER_DURATION (buffer), NULL, NULL)) ||
+ /* In the case of raw data, buffers should be strictly contained inside the
+ * segment */
+ (monitor->caps_is_raw &&
+ GST_BUFFER_PTS (buffer) + GST_BUFFER_DURATION (buffer) <
+ monitor->segment.start))
+ ) {
/* TODO is this a timestamp issue? */
GST_VALIDATE_REPORT (monitor, BUFFER_IS_OUT_OF_SEGMENT,
"buffer is out of segment and shouldn't be pushed. Timestamp: %"
file_env = g_getenv ("GST_VALIDATE_FILE");
if (file_env != NULL && *file_env != '\0') {
- log_file = g_fopen (file_env, "w");
- if (log_file == NULL) {
- g_printerr ("Could not open log file '%s' for writing: %s\n", file_env,
- g_strerror (errno));
- log_file = stderr;
+ log_file = g_fopen (file_env, "w");
+ if (log_file == NULL) {
+ g_printerr ("Could not open log file '%s' for writing: %s\n", file_env,
+ g_strerror (errno));
+ log_file = stderr;
}
} else {
log_file = stdout;
}
void
-gst_validate_printf_valist (gpointer source,
- const gchar * format, va_list args)
+gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
{
GString *string = g_string_new (NULL);
if (source) {
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: %"
- GST_TIME_FORMAT " repeat: %i) | ", g_strcmp0 (action->name, "") == 0 ?
- "Unnamed" : action->name,
- action->action_number, GST_TIME_ARGS (action->playback_time),
- action->repeat);
+ g_string_printf (string,
+ "\n(Executing action: %s, number: %u at position: %" GST_TIME_FORMAT
+ " repeat: %i) | ", g_strcmp0 (action->name,
+ "") == 0 ? "Unnamed" : action->name, action->action_number,
+ GST_TIME_ARGS (action->playback_time), action->repeat);
} else if (GST_IS_OBJECT (source)) {
g_string_printf (string, "\n%s --> ", GST_OBJECT_NAME (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);
}
}
void
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);
- gst_validate_printf (NULL, "%*s Detected on <%s> at %" GST_TIME_FORMAT "\n", 12, "",
- gst_validate_reporter_get_name (report->reporter),
+ gst_validate_printf (NULL, "%*s Detected on <%s> at %" GST_TIME_FORMAT "\n",
+ 12, "", gst_validate_reporter_get_name (report->reporter),
GST_TIME_ARGS (report->timestamp));
if (report->message)
gst_validate_printf (NULL, "%*s Details : %s\n", 12, "", report->message);
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");
}
guint log_handler_id;
} GstValidateReporterPrivate;
-static GstValidateReporterPrivate * g_log_handler = NULL;
+static GstValidateReporterPrivate *g_log_handler = NULL;
G_DEFINE_INTERFACE (GstValidateReporter, gst_validate_reporter, G_TYPE_OBJECT);
void
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);
}
}
gdouble
-gst_validate_utils_parse_expression (const gchar * expr, ParseVariableFunc variable_func,
- gpointer user_data, gchar ** error)
+gst_validate_utils_parse_expression (const gchar * expr,
+ ParseVariableFunc variable_func, gpointer user_data, gchar ** error)
{
gdouble val;
MathParser parser;
}
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;
GEnumClass *class = g_type_class_ref (type);
if (self->filenode)
free_filenode (self->filenode);
- G_OBJECT_CLASS (gst_media_descriptor_parent_class)->
- finalize (G_OBJECT (self));
+ G_OBJECT_CLASS (gst_media_descriptor_parent_class)->finalize (G_OBJECT
+ (self));
}
static void
}
static gint
-compare_tags (GstMediaDescriptor *ref, StreamNode *rstream, StreamNode *cstream)
+compare_tags (GstMediaDescriptor * ref, StreamNode * rstream,
+ StreamNode * cstream)
{
gboolean found;
TagNode *rtag, *ctag;
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Reference descriptor for stream %s has tags %s"
" but no equivalent taglist was found on the compared stream",
- rstream->id, rtaglist);
+ rstream->id, rtaglist);
g_free (rtaglist);
return 0;
/* Return -1 if not found 1 if OK 0 if an error occured */
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 (!gst_caps_is_equal (rstream->caps, cstream->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,
"Reference descriptor for stream %s has caps: %s"
" but compared stream %s has caps: %s",
- rstream->id, rcaps,
- cstream->id, ccaps);
+ rstream->id, rcaps, cstream->id, ccaps);
g_free (rcaps);
g_free (ccaps);
return 0;
if (rfilenode->duration != cfilenode->duration) {
GST_VALIDATE_REPORT (ref, FILE_DURATION_INCORRECT,
- "Duration %" GST_TIME_FORMAT " is different from the reference %" GST_TIME_FORMAT,
- GST_TIME_ARGS (cfilenode->duration),
+ "Duration %" GST_TIME_FORMAT " is different from the reference %"
+ GST_TIME_FORMAT, GST_TIME_ARGS (cfilenode->duration),
GST_TIME_ARGS (rfilenode->duration));
}
for (rstream_list = rfilenode->streams; rstream_list;
rstream_list = rstream_list->next) {
GList *cstream_list;
- gint sfound = -1;
+ gint sfound = -1;
for (cstream_list = cfilenode->streams; cstream_list;
cstream_list = cstream_list->next) {
if (sfound == 0) {
return FALSE;
} else if (sfound == 1) {
- break;
+ break;
}
}
if (sfound == FALSE) {
GST_VALIDATE_REPORT (ref, FILE_PROFILE_INCORRECT,
"Could not find stream %s in the compared descriptor",
- ((StreamNode*) rstream_list->data)->id);
+ ((StreamNode *) rstream_list->data)->id);
return FALSE;
}
gchar *output = NULL;
GstMediaDescriptorWriter *writer;
GstValidateRunner *runner;
- GstMediaDescriptorParser * reference = NULL;
+ GstMediaDescriptorParser *reference = NULL;
GOptionEntry options[] = {
{"output-file", 'o', 0, G_OPTION_ARG_FILENAME,
g_option_context_free (ctx);
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) {
g_print ("Could not discover file: %s", argv[1]);
return 1;
gst_media_descriptor_writer_write (writer, output_file);
if (expected_file) {
- reference = gst_media_descriptor_parser_new (runner,
- expected_file, NULL);
+ reference = gst_media_descriptor_parser_new (runner, expected_file, NULL);
if (reference == NULL) {
g_print ("Could not parse file: %s", expected_file);
{
volatile gint refcount;
- GstSegment segment; /* The currently configured segment */
+ GstSegment segment; /* The currently configured segment */
/* FIXME Do we need a weak ref here? */
GstValidateScenario *scenario;
#endif /* G_OS_UNIX */
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))) {
g_slice_free (KeyUnitProbeInfo, info);
}
static KeyUnitProbeInfo *
-key_unit_data_ref (KeyUnitProbeInfo *info)
+key_unit_data_ref (KeyUnitProbeInfo * info)
{
g_atomic_int_inc (&info->refcount);
}
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);
info->refcount = 1;
}
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_video_event_is_force_key_unit (GST_PAD_PROBE_INFO_DATA (info)))
gst_event_parse_segment (info->data, &segment);
kuinfo->segment = *segment;
}
- } else if (GST_IS_BUFFER (GST_PAD_PROBE_INFO_DATA (info)) && kuinfo->seen_event) {
-
- if (GST_CLOCK_TIME_IS_VALID (kuinfo->running_time)) {
- GstClockTime running_time = gst_segment_to_running_time (&kuinfo->segment,
- GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (info->data));
-
- if (running_time < kuinfo->running_time)
- return GST_PAD_PROBE_OK;
- }
-
- if (GST_BUFFER_FLAG_IS_SET (GST_PAD_PROBE_INFO_BUFFER (info), GST_BUFFER_FLAG_DELTA_UNIT)) {
- if (kuinfo->count_bufs >= NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE) {
- GST_VALIDATE_REPORT (kuinfo->scenario,
- SCENARIO_ACTION_EXECUTION_ERROR,
- "Did not receive a key frame after requested one, "
- " at running_time %" GST_TIME_FORMAT " (with a %i "
- "frame tolerance)", GST_TIME_ARGS (kuinfo->running_time),
- NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE);
-
- return GST_PAD_PROBE_REMOVE;
- }
-
- kuinfo->count_bufs++;
- } else {
- GST_DEBUG_OBJECT (kuinfo->scenario,
- "Properly got keyframe after \"force-keyframe\" event "
- "with running_time %" GST_TIME_FORMAT " (latency %d frame(s))",
- GST_TIME_ARGS (kuinfo->running_time), kuinfo->count_bufs);
-
- return GST_PAD_PROBE_REMOVE;
- }
- }
+ } else if (GST_IS_BUFFER (GST_PAD_PROBE_INFO_DATA (info))
+ && kuinfo->seen_event) {
+
+ if (GST_CLOCK_TIME_IS_VALID (kuinfo->running_time)) {
+ GstClockTime running_time = gst_segment_to_running_time (&kuinfo->segment,
+ GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (info->data));
+
+ if (running_time < kuinfo->running_time)
+ return GST_PAD_PROBE_OK;
+ }
+
+ if (GST_BUFFER_FLAG_IS_SET (GST_PAD_PROBE_INFO_BUFFER (info),
+ GST_BUFFER_FLAG_DELTA_UNIT)) {
+ if (kuinfo->count_bufs >= NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE) {
+ GST_VALIDATE_REPORT (kuinfo->scenario,
+ SCENARIO_ACTION_EXECUTION_ERROR,
+ "Did not receive a key frame after requested one, "
+ " at running_time %" GST_TIME_FORMAT " (with a %i "
+ "frame tolerance)", GST_TIME_ARGS (kuinfo->running_time),
+ NOT_KF_AFTER_FORCE_KF_EVT_TOLERANCE);
+
+ return GST_PAD_PROBE_REMOVE;
+ }
+
+ kuinfo->count_bufs++;
+ } else {
+ GST_DEBUG_OBJECT (kuinfo->scenario,
+ "Properly got keyframe after \"force-keyframe\" event "
+ "with running_time %" GST_TIME_FORMAT " (latency %d frame(s))",
+ GST_TIME_ARGS (kuinfo->running_time), kuinfo->count_bufs);
+
+ return GST_PAD_PROBE_REMOVE;
+ }
+ }
return GST_PAD_PROBE_OK;
}
{
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);
- if (g_strstr_len (klass, -1, "Video") &&
- g_strstr_len (klass, -1, "Encoder")) {
+ if (g_strstr_len (klass, -1, "Video") && g_strstr_len (klass, -1, "Encoder")) {
return 0;
}
iter = gst_bin_iterate_recurse (GST_BIN (encodebin));
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");
goto fail;
gst_pad_add_probe (encoder_srcpad,
GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
(GstPadProbeCallback) _check_is_key_unit_cb,
- key_unit_data_ref (info),
- (GDestroyNotify) key_unit_data_unref);
+ key_unit_data_ref (info), (GDestroyNotify) key_unit_data_unref);
} else if (g_strcmp0 (direction, "downstream") == 0) {
GstClockTime timestamp = GST_CLOCK_TIME_NONE,
stream_time = GST_CLOCK_TIME_NONE;
gst_validate_action_get_clocktime (scenario, action,
"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);
gst_pad_add_probe (pad,
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) _check_is_key_unit_cb,
- key_unit_data_ref (info),
- (GDestroyNotify) key_unit_data_unref);
+ key_unit_data_ref (info), (GDestroyNotify) key_unit_data_unref);
} else {
g_error ("request keyunit direction %s invalide (should be in"
" [downstrean, upstream]", direction);
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);
gst_pad_query (encoder_srcpad, segment_query);
gst_query_parse_segment (segment_query, &(info->segment.rate),
- &(info->segment.format),
- (gint64*) &(info->segment.start),
- (gint64*) &(info->segment.stop));
+ &(info->segment.format),
+ (gint64 *) & (info->segment.start), (gint64 *) & (info->segment.stop));
gst_pad_add_probe (encoder_srcpad,
GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
if (!gst_pad_send_event (pad, event)) {
- GST_VALIDATE_REPORT (scenario, SCENARIO_ACTION_EXECUTION_ERROR,
- "Could not send \"force key unit\" event %s", direction);
+ GST_VALIDATE_REPORT (scenario, SCENARIO_ACTION_EXECUTION_ERROR,
+ "Could not send \"force key unit\" event %s", direction);
goto fail;
}
if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
&& state == GST_STATE_NULL) {
- GST_VALIDATE_REPORT (GST_MESSAGE_SRC (message),
- SCENARIO_ACTION_EXECUTION_ISSUE,
- "Force stopping a transcoding pipeline is not recommanded"
- " you should make sure to finalize it using a EOS event");
+ GST_VALIDATE_REPORT (GST_MESSAGE_SRC (message),
+ SCENARIO_ACTION_EXECUTION_ISSUE,
+ "Force stopping a transcoding pipeline is not recommanded"
+ " you should make sure to finalize it using a EOS event");
gst_validate_printf (pipeline, "State change request NULL, "
"quiting mainloop\n");
{
const gchar *resize_video_mandatory_fields[] = { "restriction-caps", NULL };
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,
- 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",
_execute_request_key_unit, force_key_unit_mandatory_fields,
"Request a video key unit", FALSE);
"Let you set a scenario, it will override the GST_VALIDATE_SCENARIO "
"environment variable", NULL},
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
- "Let you set a config scenario, the scenario needs to be set as 'config"
- "' you can specify a list of scenario separated by ':'"
- " it will override the GST_VALIDATE_SCENARIO environment variable,",
+ "Let you set a config scenario, the scenario needs to be set as 'config"
+ "' you can specify a list of scenario separated by ':'"
+ " it will override the GST_VALIDATE_SCENARIO environment variable,",
NULL},
{"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 "
{"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios,
"List the avalaible scenarios that can be run", NULL},
{"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME,
- &output_file, "The output file to store scenarios details. "
- "Implies --list-scenario",
+ &output_file, "The output file to store scenarios details. "
+ "Implies --list-scenario",
NULL},
{"force-reencoding", 'r', 0, G_OPTION_ARG_NONE, &force_reencoding,
"Whether to try to force reencoding, meaning trying to only remux "
- "if possible(default: TRUE)", NULL},
+ "if possible(default: TRUE)", NULL},
{NULL}
};
if (list_scenarios || output_file) {
if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file))
- return 1;
+ return 1;
return 0;
}
gst_message_parse_request_state (message, &state);
if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))
- && state == GST_STATE_NULL) {
- gst_validate_printf (GST_MESSAGE_SRC (message), "State change request NULL, "
- "quiting mainloop\n");
+ && state == GST_STATE_NULL) {
+ gst_validate_printf (GST_MESSAGE_SRC (message),
+ "State change request NULL, " "quiting mainloop\n");
g_main_loop_quit (mainloop);
}
break;
}
static gboolean
-_is_playbin_pipeline (int argc, gchar **argv)
+_is_playbin_pipeline (int argc, gchar ** argv)
{
gint i;
}
static gboolean
-_execute_set_subtitles (GstValidateScenario * scenario, GstValidateAction * action)
+_execute_set_subtitles (GstValidateScenario * scenario,
+ GstValidateAction * action)
{
gchar *uri, *fname;
- GFile * tmpfile, *folder;
+ GFile *tmpfile, *folder;
const gchar *subtitle_file, *subtitle_dir;
subtitle_file = gst_structure_get_string (action->structure, "subtitle-file");
fname = g_strdup_printf ("%s%s%s%s",
subtitle_dir ? subtitle_dir : "",
subtitle_dir ? G_DIR_SEPARATOR_S : "",
- g_file_get_basename (tmpfile),
- subtitle_file);
+ g_file_get_basename (tmpfile), subtitle_file);
gst_object_unref (tmpfile);
tmpfile = g_file_get_child (folder, fname);
if (!(type = gst_structure_get_string (action->structure, "type")))
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);
tmp = g_strdup_printf ("n-%s", type);
g_object_get (scenario->pipeline, "flags", &flags, tmp, &n,
- current_txt, ¤t, NULL);
+ current_txt, ¤t, NULL);
g_free (tmp);
disabling = TRUE;
flags &= ~tflag;
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)) {
GST_WARNING ("No index given, defaulting to +1");
index = 1;
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;
if (current >= n)
index = -2;
if (!disabling) {
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);
gst_validate_printf (action, "Switching to track number: %i,"
{"list-scenarios", 'l', 0, G_OPTION_ARG_NONE, &list_scenarios,
"List the avalaible scenarios that can be run", NULL},
{"scenarios-defs-output-file", '\0', 0, G_OPTION_ARG_FILENAME,
- &output_file, "The output file to store scenarios details. "
- "Implies --list-scenario",
+ &output_file, "The output file to store scenarios details. "
+ "Implies --list-scenario",
NULL},
{"set-configs", '\0', 0, G_OPTION_ARG_STRING, &configs,
- "Let you set a config scenario, the scenario needs to be set as 'config"
- "' you can specify a list of scenario separated by ':'"
- " it will override the GST_VALIDATE_SCENARIO environment variable,",
+ "Let you set a config scenario, the scenario needs to be set as 'config"
+ "' you can specify a list of scenario separated by ':'"
+ " it will override the GST_VALIDATE_SCENARIO environment variable,",
NULL},
{NULL}
};
if (list_scenarios || output_file) {
if (gst_validate_list_scenarios (argv + 1, argc - 1, output_file))
- return 1;
+ return 1;
return 0;
}
gst_bin_add (GST_BIN (new_pipeline), pipeline);
pipeline = new_pipeline;
}
-
#ifdef G_OS_UNIX
signal_watch_id =
g_unix_signal_add (SIGINT, (GSourceFunc) intr_handler, pipeline);
FALSE);
/* 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 'type' argument selects which track type to change (can be 'audio', 'video',"
" or 'text'). The 'index' argument selects which track of this type"