Add debug log to rank compare 16/227216/7 submit/tizen/20200312.092738
authorHyunil <hyunil46.park@samsung.com>
Tue, 10 Mar 2020 10:52:00 +0000 (19:52 +0900)
committerHyunil <hyunil46.park@samsung.com>
Thu, 12 Mar 2020 07:20:57 +0000 (16:20 +0900)
Change-Id: I50d8e54c9ab2fe5f57082443022d206bd1940a46
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
src/media_streamer_gst.c

index b3cc716..74d5290 100644 (file)
@@ -480,12 +480,16 @@ static GstElement *__ms_bin_find_element_by_type(GstElement *previous_element, G
 int __ms_factory_rank_compare(GstPluginFeature *first_feature, GstPluginFeature *second_feature)
 {
        ms_debug_fenter();
+       guint first_rank = 0, second_rank = 0;
 
-       ms_retvm_if(!first_feature, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "first_feature is NULL");
-       ms_retvm_if(!second_feature, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "second_feature is NULL");
+       first_rank = gst_plugin_feature_get_rank(first_feature);
+       second_rank = gst_plugin_feature_get_rank(second_feature);
+       ms_debug ("second[%s]_rank(%d) - first[%s]_rank(%d) = (%d)",
+               GST_OBJECT_NAME(GST_ELEMENT_FACTORY(second_feature)), second_rank,
+               GST_OBJECT_NAME(GST_ELEMENT_FACTORY(first_feature)), first_rank, second_rank - first_rank);
 
        ms_debug_fleave();
-       return (gst_plugin_feature_get_rank(second_feature) - gst_plugin_feature_get_rank(first_feature));
+       return second_rank - first_rank;
 }
 
 GstElement *__ms_combine_next_element(GstElement *previous_element, GstPad *prev_elem_src_pad, GstElement *bin_to_find_in, media_streamer_node_type_e node_type)
@@ -1288,6 +1292,7 @@ static GstElement *__ms_element_create_by_registry(node_plug_s *plug_info, media
 
        if (factories) {
                factory = GST_ELEMENT_FACTORY(factories->data);
+               ms_info("Sorted result element is [%s]", GST_OBJECT_NAME(factory));
                gst_element = __ms_element_create(GST_OBJECT_NAME(factory), NULL);
        } else {
                ms_debug("Could not find any compatible element for node [%d]: in[%s] - out[%s]",