Commit 0cbf3295 authored by Lori Anderson's avatar Lori Anderson

Added the command line arg "seek_source" which will direct the test program to...

Added the command line arg "seek_source" which will direct the test program to perform byte or time based seeks from the seek_secs or seek_percent options to be performed on the source element of the pipeline rather than on the pipeline element.
parent a4812522
......@@ -51,6 +51,7 @@ static gboolean g_use_dtcp = FALSE;
static gboolean g_format_bytes = FALSE;
static gint g_seek_secs = 0;
static gint g_seek_percent = 0;
static gboolean g_seek_source = FALSE;
static gboolean g_zero_position = FALSE;
static gboolean g_positions = FALSE;
......@@ -70,6 +71,7 @@ static gchar* TEST_FILE_URL_PREFIX_ENV = "TEST_FILE_URL_PREFIX";
static gboolean g_create_dot = FALSE;
static GstElement* g_sink = NULL;
static GstElement* g_source = NULL;
static GstElement* g_pipeline = NULL;
static GstElement* g_identity = NULL;
static GstElement* g_tee = NULL;
......@@ -555,6 +557,11 @@ static gboolean process_cmd_line_args(int argc, char *argv[])
g_print("Set requested seek percent to %d\n", g_seek_percent);
}
}
else if (strstr(argv[i], "seek_source") != NULL)
{
g_seek_source = TRUE;
g_print("Set to seek on source of pipeline rather than on pipeline itself\n");
}
else
{
g_printerr("Invalid option: %s\n", argv[i]);
......@@ -577,6 +584,7 @@ static gboolean process_cmd_line_args(int argc, char *argv[])
g_printerr("\t rrid=i \t\t where i is cds recording id\n");
g_printerr("\t seek_percent \t\t perform byte based seek to specified percent of total byte size\n");
g_printerr("\t seek_secs \t\t perform seek to specified seconds\n");
g_printerr("\t seek_source \t\t issue seek on pipeline's source rather than pipeline itself\n");
g_printerr("\t simple \t\t create simple pipeline rather than playbin\n");
g_printerr("\t states \t\t test state changes\n");
g_printerr("\t switch \t\t play for wait secs then switch uri\n");
......@@ -1253,6 +1261,7 @@ static void on_source_changed(GstElement* element, GParamSpec* param, gpointer d
if (src != NULL)
{
g_print("Got src from callback, determine if dlnasrc\n");
g_source = src;
g_object_get(src, "cl_name", &strVal, NULL);
if (strVal != NULL)
......@@ -1722,14 +1731,33 @@ static gboolean perform_test_seek_byte_percent(CustomData* data)
g_usleep(g_wait_secs * 1000000L);
if (!gst_element_query_duration (data->pipeline, GST_FORMAT_BYTES, &total_bytes))
{
g_printerr ("Could not query current duration.\n");
return FALSE;
if (g_seek_source) {
if (g_source) {
if (!gst_element_query_duration (g_source, GST_FORMAT_BYTES, &total_bytes))
{
g_printerr ("Could not query source for current duration.\n");
return FALSE;
}
else
{
g_print("%s - Got total bytes: %" G_GINT64_FORMAT " \n", __FUNCTION__, total_bytes);
}
} else {
g_printerr ("No source could not query current duration.\n");
return FALSE;
}
}
else
else // query pipeline for duration
{
g_print("%s - Got total bytes: %" G_GINT64_FORMAT " \n", __FUNCTION__, total_bytes);
if (!gst_element_query_duration (data->pipeline, GST_FORMAT_BYTES, &total_bytes))
{
g_printerr ("Could not query pipeline for current duration.\n");
return FALSE;
}
else
{
g_print("%s - Got total bytes: %" G_GINT64_FORMAT " \n", __FUNCTION__, total_bytes);
}
}
// Calculate byte for percent requested
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment