From 622ef9b72def93965b53161767b0e0ac1a4e5c97 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 10 Mar 2020 19:52:00 +0900 Subject: [PATCH] Add debug log to rank compare Change-Id: I50d8e54c9ab2fe5f57082443022d206bd1940a46 Signed-off-by: Hyunil --- src/media_streamer_gst.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index b3cc716..74d5290 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -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]", -- 2.7.4