1. Fix the warning code. 27/40527/1 tizen_3.0.2015.q2_common accepted/tizen/common/20150605.072922 accepted/tizen/mobile/20150605.103022 accepted/tizen/tv/20150605.103045 accepted/tizen/wearable/20150605.103105 submit/tizen/20150605.021903
authorSangkyu Park <sk1122.park@samsung.com>
Fri, 5 Jun 2015 02:10:31 +0000 (11:10 +0900)
committerSangkyu Park <sk1122.park@samsung.com>
Fri, 5 Jun 2015 02:10:44 +0000 (11:10 +0900)
2. Fix the pad probe function.
3. Add log color.

Change-Id: I66e6fcdaaa6931e50ed33039d4709b622c6fc4bb
Signed-off-by: Sangkyu Park <sk1122.park@samsung.com>
common/include/mm_wfd_sink_dlog.h
packaging/libmm-wfd.spec
sink/mm_wfd_sink.c
sink/mm_wfd_sink_priv.c
sink/mm_wfd_sink_util.c

index d9e2f99..54d7d01 100755 (executable)
@@ -28,57 +28,66 @@ extern "C" {
 #endif
 #define LOG_TAG "MM_WFD_SINK"
 
+#define FONT_COLOR_RESET    "\033[0m"
+#define FONT_COLOR_RED      "\033[31m"
+#define FONT_COLOR_GREEN    "\033[32m"
+#define FONT_COLOR_YELLOW   "\033[33m"
+#define FONT_COLOR_BLUE     "\033[34m"
+#define FONT_COLOR_PURPLE   "\033[35m"
+#define FONT_COLOR_CYAN     "\033[36m"
+#define FONT_COLOR_GRAY     "\033[37m"
+
 #define wfd_sink_debug(fmt, arg...) do { \
-                       LOGD(""fmt"", ##arg);     \
+                       LOGD(FONT_COLOR_RESET""fmt"", ##arg);     \
                } while (0)
 
 #define wfd_sink_info(fmt, arg...) do { \
-                       LOGI(""fmt"", ##arg);     \
+                       LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg);     \
                } while (0)
 
 #define wfd_sink_error(fmt, arg...) do { \
-                       LOGE(""fmt"", ##arg);     \
+                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
                } while (0)
 
 #define wfd_sink_warning(fmt, arg...) do { \
-                       LOGW(""fmt"", ##arg);     \
+                       LOGW(FONT_COLOR_YELLOW""fmt""FONT_COLOR_RESET, ##arg);     \
                } while (0)
 
 #define wfd_sink_debug_fenter() do { \
-                       LOGD("<Enter>");     \
+                       LOGD(FONT_COLOR_RESET"<Enter>");     \
                } while (0)
 
 #define wfd_sink_debug_fleave() do { \
-                       LOGD("<Leave>");     \
+                       LOGD(FONT_COLOR_RESET"<Leave>");     \
                } while (0)
 
 #define wfd_sink_error_fenter() do { \
-                       LOGE("NO-ERROR : <Enter>");     \
+                       LOGE(FONT_COLOR_RESET"NO-ERROR : <Enter>");     \
                } while (0)
 
 #define wfd_sink_error_fleave() do { \
-                       LOGE("NO-ERROR : <Leave>");     \
+                       LOGE(FONT_COLOR_RESET"NO-ERROR : <Leave>");     \
                } while (0)
 
 #define wfd_sink_sucure_info(fmt, arg...) do { \
-                       SECURE_LOGI(""fmt"", ##arg);     \
+                       SECURE_LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg);     \
                } while (0)
 
 #define wfd_sink_return_if_fail(expr)  \
                if(!(expr)) {   \
-                       wfd_sink_error("failed [%s]\n", #expr); \
+                       wfd_sink_error(FONT_COLOR_RED"failed [%s]\n"FONT_COLOR_RESET, #expr);   \
                        return; \
                }
 
 #define wfd_sink_return_val_if_fail(expr, val) \
                if (!(expr)) {  \
-                       wfd_sink_error("failed [%s]\n", #expr); \
+                       wfd_sink_error(FONT_COLOR_RED"failed [%s]\n"FONT_COLOR_RESET, #expr);   \
                        return val; \
                }
 
 #define wfd_sink_assert_not_reached() \
        { \
-               wfd_sink_error("assert_not_reached()"); \
+               wfd_sink_error(FONT_COLOR_RED"assert_not_reached()"FONT_COLOR_RESET); \
                assert(0); \
        }
 
index 400bd1f..63a2d9b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-wfd
 Summary:    Multimedia Framework Wifi-Display Library
-Version:    0.2.162
+Version:    0.2.165
 Release:    0
 Group:      System/Libraries
 License:    Apache License 2.0
index a01f35e..d9872c8 100755 (executable)
@@ -124,6 +124,7 @@ int mm_wfd_sink_unprepare(MMHandleType wfd_sink)
 int mm_wfd_sink_destroy(MMHandleType wfd_sink)
 {
        int result = MM_ERROR_NONE;
+       mm_wfd_sink_t * sink_handle = NULL;
 
        wfd_sink_return_val_if_fail(wfd_sink, MM_ERROR_WFD_NOT_INITIALIZED);
 
@@ -133,7 +134,8 @@ int mm_wfd_sink_destroy(MMHandleType wfd_sink)
 
        g_mutex_clear(&(((mm_wfd_sink_t *)wfd_sink)->cmd_lock));
 
-       MMWFDSINK_FREEIF(wfd_sink);
+       sink_handle = (mm_wfd_sink_t *)wfd_sink;
+       MMWFDSINK_FREEIF(sink_handle);
 
        return result;
 }
index a7e7013..d925374 100755 (executable)
@@ -1265,7 +1265,6 @@ _mm_wfd_sink_check_running_time(GstPad * pad, GstPadProbeInfo * info, gpointer u
        GstClockTimeDiff diff = GST_CLOCK_TIME_NONE;
        GstBuffer * buffer = NULL;
        gint64 ts_offset = 0LL;
-       GstPadProbeReturn ret = GST_PAD_PROBE_OK;
 
        wfd_sink_return_val_if_fail (info, FALSE);
        wfd_sink_return_val_if_fail (wfd_sink &&
@@ -2320,7 +2319,6 @@ static int __mm_wfd_sink_create_audiobin(mm_wfd_sink_t *wfd_sink)
        GstPad *pad = NULL;
        GstPad *ghostpad = NULL;
        GstCaps *caps = NULL;
-       gint i;
 
        wfd_sink_debug_fenter();
 
@@ -2788,7 +2786,6 @@ static int __mm_wfd_sink_create_videobin(mm_wfd_sink_t *wfd_sink)
        GList* element_bucket = NULL;
        GstPad *pad = NULL;
        GstPad *ghostpad = NULL;
-       gint i = 0;
 
        wfd_sink_debug_fenter();
 
index fedb81e..d03dda5 100755 (executable)
@@ -78,7 +78,7 @@ _mm_wfd_sink_util_pad_probe_cb(GstPad * pad, GstPadProbeInfo * info, gpointer u_
                return GST_PAD_PROBE_DROP;
        }
 
-       if (info->type == GST_PAD_PROBE_TYPE_BUFFER)
+       if (info->type & GST_PAD_PROBE_TYPE_BUFFER)
        {
                GstBuffer *buffer = gst_pad_probe_info_get_buffer (info);
                /* show name and timestamp */
@@ -88,10 +88,10 @@ _mm_wfd_sink_util_pad_probe_cb(GstPad * pad, GstPadProbeInfo * info, gpointer u_
                        GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(buffer)),
                        gst_buffer_get_size(buffer));
        }
-       else if (info->type == GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM ||
-               info->type == GST_PAD_PROBE_TYPE_EVENT_UPSTREAM ||
-               info->type == GST_PAD_PROBE_TYPE_EVENT_FLUSH ||
-               info->type == GST_PAD_PROBE_TYPE_EVENT_BOTH)
+       else if (info->type & GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM ||
+               info->type & GST_PAD_PROBE_TYPE_EVENT_UPSTREAM ||
+               info->type & GST_PAD_PROBE_TYPE_EVENT_FLUSH ||
+               info->type & GST_PAD_PROBE_TYPE_EVENT_BOTH)
        {
                GstEvent *event = gst_pad_probe_info_get_event (info);