Commit 19d4dca9 authored by Brendan Long's avatar Brendan Long

Merge pull request #10 from cablelabs/dlnasrc-43-cl-name-prop

Got rid of using cl-name property to determine if dlnasrc was source of ...
parents faef3faf c3b0233d
......@@ -1255,7 +1255,7 @@ static void on_source_changed(GstElement* element, GParamSpec* param, gpointer d
int i = 0;
GstElement* src = NULL;
gchar *strVal = NULL;
const gchar *src_type_name = NULL;
g_object_get(element, "source", &src, NULL);
if (src != NULL)
......@@ -1263,19 +1263,22 @@ static void on_source_changed(GstElement* element, GParamSpec* param, gpointer d
g_print("Got src from callback, determine if dlnasrc\n");
g_source = src;
g_object_get(src, "cl_name", &strVal, NULL);
if (strVal != NULL)
src_type_name = g_type_name(G_OBJECT_TYPE (src));
if (src_type_name != NULL)
{
g_print("type name of source for pipeline: %s\n", src_type_name);
if (strcmp(src_type_name, "GstDlnaSrc") == 0)
{
// Get supported rates property value which is a GArray
g_print("Getting supported rates\n");
GArray* arrayVal = NULL;
g_object_get(src, "supported_rates", &arrayVal, NULL);
if (arrayVal != NULL)
GArray* rates_array = NULL;
g_object_get(src, "supported_rates", &rates_array, NULL);
if (rates_array != NULL)
{
g_print("Supported rates cnt: %d\n", arrayVal->len);
for (i = 0; i < arrayVal->len; i++)
g_print("Supported rates cnt: %d\n", rates_array->len);
for (i = 0; i < rates_array->len; i++)
{
g_print("Retrieved rate %d: %f\n", (i+1), g_array_index(arrayVal, gfloat, i));
g_print("Retrieved rate %d: %f\n", (i+1), g_array_index(rates_array, gfloat, i));
}
}
else
......@@ -1285,7 +1288,12 @@ static void on_source_changed(GstElement* element, GParamSpec* param, gpointer d
}
else
{
g_print("dlnasrc is NOT source for pipeline\n");
g_print("dlnasrc is not source of pipeline\n");
}
}
else
{
g_print("Unable to get type name of source\n");
}
}
else
......@@ -1797,7 +1805,7 @@ static gboolean perform_test_playspeeds(CustomData* data)
{
GIOChannel *io_stdin;
g_print("%s - Performing position changes at 2, 1, 3, and 1 mins\n", __FUNCTION__);
g_print("%s - Performing playspeeds test\n", __FUNCTION__);
/* Print usage map */
g_print (
......@@ -1872,6 +1880,12 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa
send_seek_event (data);
break;
case 'f':
data->rate *= 0.5;
g_print ("Adjusting rate to: %2.0f\n", data->rate);
send_seek_event (data);
break;
case 'n':
gst_element_send_event (data->pipeline,
gst_event_new_step (GST_FORMAT_BUFFERS, 1, data->rate, TRUE, FALSE));
......
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