struct _GstValidateScenarioPrivate
{
- GstElement *pipeline;
GstValidateRunner *runner;
GList *actions;
if (!g_strcmp0 (name, "duration")) {
gint64 duration;
- if (!gst_element_query_duration (scenario->priv->pipeline,
+ if (!gst_element_query_duration (scenario->pipeline,
GST_FORMAT_TIME, &duration)) {
GST_WARNING_OBJECT (scenario, "Could not query duration");
return FALSE;
} else if (!g_strcmp0 (name, "position")) {
gint64 position;
- if (!gst_element_query_position (scenario->priv->pipeline,
+ if (!gst_element_query_position (scenario->pipeline,
GST_FORMAT_TIME, &position)) {
GST_WARNING_OBJECT (scenario, "Could not query position");
return FALSE;
seek = gst_event_new_seek (rate, format, flags, start_type, start,
stop_type, stop);
gst_event_ref (seek);
- if (gst_element_send_event (priv->pipeline, seek)) {
+ if (gst_element_send_event (scenario->pipeline, seek)) {
gst_event_replace (&priv->last_seek, seek);
} else {
GST_VALIDATE_REPORT (scenario, EVENT_SEEK_NOT_HANDLED,
static gboolean
_pause_action_restore_playing (GstValidateScenario * scenario)
{
- GstElement *pipeline = scenario->priv->pipeline;
+ GstElement *pipeline = scenario->pipeline;
+
+
+ g_print ("\n\nBack to playing\n\n");
if (gst_element_set_state (pipeline, GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
{
gdouble duration = 0;
- GstValidateScenarioPrivate *priv = scenario->priv;
-
gst_structure_get_double (action->structure, "duration", &duration);
g_print ("\n%s (num %u), pausing for %" GST_TIME_FORMAT "\n",
action->name, action->action_number,
GST_DEBUG ("Pausing for %" GST_TIME_FORMAT,
GST_TIME_ARGS (duration * GST_SECOND));
- if (gst_element_set_state (priv->pipeline, GST_STATE_PAUSED) ==
+ if (gst_element_set_state (scenario->pipeline, GST_STATE_PAUSED) ==
GST_STATE_CHANGE_FAILURE) {
GST_VALIDATE_REPORT (scenario, STATE_CHANGE_FAILURE,
"Failed to set state to paused");
GST_DEBUG ("Playing back");
- if (gst_element_set_state (scenario->priv->pipeline, GST_STATE_PLAYING) ==
+ if (gst_element_set_state (scenario->pipeline, GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
GST_VALIDATE_REPORT (scenario, STATE_CHANGE_FAILURE,
"Failed to set state to playing");
return FALSE;
}
- gst_element_get_state (scenario->priv->pipeline, NULL, NULL, -1);
+ gst_element_get_state (scenario->pipeline, NULL, NULL, -1);
return TRUE;
}
GST_DEBUG ("Sending eos to pipeline at %" GST_TIME_FORMAT,
GST_TIME_ARGS (action->playback_time));
- return gst_element_send_event (scenario->priv->pipeline,
- gst_event_new_eos ());
+ return gst_element_send_event (scenario->pipeline, gst_event_new_eos ());
}
static int
/* First find an input selector that has the right type */
input_selector =
- find_input_selector_with_type (GST_BIN (scenario->priv->pipeline), type);
+ find_input_selector_with_type (GST_BIN (scenario->pipeline), type);
if (input_selector) {
GstPad *pad;
GstPluginFeature *feature;
const gchar *feature_name;
- if (!(feature_name = gst_structure_get_string (action->structure, "feature-name"))) {
+ if (!(feature_name =
+ gst_structure_get_string (action->structure, "feature-name"))) {
GST_ERROR ("Could not find the name of the feature to tweak");
return FALSE;
}
if (!(gst_structure_get_uint (action->structure, "rank", &rank) ||
- gst_structure_get_int (action->structure, "rank", (gint*) &rank))) {
+ gst_structure_get_int (action->structure, "rank", (gint *) & rank))) {
GST_ERROR ("Could not get rank to set on %s", feature_name);
return FALSE;
gint64 position, duration;
GstFormat format = GST_FORMAT_TIME;
GstValidateScenarioPrivate *priv = scenario->priv;
- GstElement *pipeline = scenario->priv->pipeline;
+ GstElement *pipeline = scenario->pipeline;
query = gst_query_new_segment (GST_FORMAT_DEFAULT);
- if (gst_element_query (GST_ELEMENT (priv->pipeline), query))
+ if (gst_element_query (GST_ELEMENT (scenario->pipeline), query))
gst_query_parse_segment (query, &rate, NULL, NULL, NULL);
gst_query_unref (query);
GstValidateScenarioPrivate *priv = scenario->priv;
if (priv->get_pos_id)
- g_source_remove (priv->get_pos_id);
- priv->pipeline = NULL;
+ g_source_remove (priv->get_pos_id);
+ scenario->pipeline = NULL;
GST_DEBUG_OBJECT (scenario, "pipeline was freed");
}
if (priv->last_seek)
gst_event_unref (priv->last_seek);
- if (priv->pipeline)
- gst_object_unref (priv->pipeline);
- g_list_free_full (priv->actions, (GDestroyNotify) _free_scenario_action);
+ if (GST_VALIDATE_SCENARIO (object)->pipeline)
+ gst_object_unref (GST_VALIDATE_SCENARIO (object)->pipeline);
G_OBJECT_CLASS (gst_validate_scenario_parent_class)->dispose (object);
}
return NULL;
}
- scenario->priv->pipeline = pipeline;
+ scenario->pipeline = pipeline;
g_object_weak_ref (G_OBJECT (pipeline),
(GWeakNotify) _pipeline_freed_cb, scenario);
gst_validate_reporter_set_name (GST_VALIDATE_REPORTER (scenario),