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