amlhwdmx: CF2 refine log output [1/1]

PD#SWPL-192573

Problem:
Cfg each module in amlhwdmx based on same log obj may lead to massive log output

Solution:
Cfg different log obj for different modules
Control the output of each module separately

Verify:
(detail info)

Change-Id: I8e4e11c7418cf8270aaca2d2254b3579a1287457
Signed-off-by: xuesong.jiang <xuesong.jiang@amlogic.com>
diff --git a/aml-hwdemux/gstamladapterpipe.c b/aml-hwdemux/gstamladapterpipe.c
index df50b37..51e5944 100644
--- a/aml-hwdemux/gstamladapterpipe.c
+++ b/aml-hwdemux/gstamladapterpipe.c
@@ -220,7 +220,7 @@
     pipe->status.cur_size += gst_buffer_get_size(buffer);
     pipe->status.pushed_size += gst_buffer_get_size(buffer);
 
-    GST_DEBUG("pipe:%p, type:%d, pushed in buffer %p, status.cur_num:%d, status.cur_size:%d", pipe, pipe->type, buffer, pipe->status.cur_num, pipe->status.cur_size);
+    GST_TRACE("pipe:%p, type:%d, pushed in buffer %p, status.cur_num:%d, status.cur_size:%d", pipe, pipe->type, buffer, pipe->status.cur_num, pipe->status.cur_size);
 
     return GST_FLOW_OK;
 }
@@ -255,7 +255,7 @@
         pipe->status.poped_size += gst_buffer_get_size(*buffer);
     }
 
-    GST_DEBUG("pipe:%p, type:%d, poped out buffer %p, status.cur_num:%d, status.cur_size:%d, ret:%d", pipe, pipe->type, *buffer, pipe->status.cur_num, pipe->status.cur_size, ret);
+    GST_TRACE("pipe:%p, type:%d, poped out buffer %p, status.cur_num:%d, status.cur_size:%d, ret:%d", pipe, pipe->type, *buffer, pipe->status.cur_num, pipe->status.cur_size, ret);
     return ret;
 }
 
@@ -344,10 +344,10 @@
 
     while (!pipe->unlimit && (pipe->status.cur_num + 1 > pipe->status.max_num || pipe->status.cur_size + gst_buffer_get_size(buffer) > pipe->status.max_size))
     {
-        GST_DEBUG("pipe:%p, type:%d, reached max, [status.cur_num:%d, status.max_num:%d], [status.cur_size:%d, status.max_size:%d], waitting sig",
+        GST_TRACE("pipe:%p, type:%d, reached max, [status.cur_num:%d, status.max_num:%d], [status.cur_size:%d, status.max_size:%d], waitting sig",
                   pipe, pipe->type, pipe->status.cur_num, pipe->status.max_num, pipe->status.cur_size, pipe->status.max_size);
         GST_ADAPTER_PIPE_WAIT(pipe);
-        GST_DEBUG("pipe:%p, type:%d, waitted", pipe, pipe->type);
+        GST_TRACE("pipe:%p, type:%d, waitted", pipe, pipe->type);
     }
 
     if (pipe->flushing)
@@ -357,7 +357,7 @@
 
     if (!pipe->unlimit && (pipe->status.cur_num >= pipe->status.needed_num && pipe->status.cur_size >= pipe->status.needed_size))
     {
-        GST_DEBUG("pipe:%p, type:%d, reachd needed, [status.cur_num:%d, status.needed_num:%d], [status.cur_size:%d, status.needed_size:%d], emit sig",
+        GST_TRACE("pipe:%p, type:%d, reachd needed, [status.cur_num:%d, status.needed_num:%d], [status.cur_size:%d, status.needed_size:%d], emit sig",
                   pipe, pipe->type, pipe->status.cur_num, pipe->status.needed_num, pipe->status.cur_size, pipe->status.needed_size);
         GST_ADAPTER_PIPE_SIGNAL(pipe);
     }
@@ -368,7 +368,7 @@
         goto done;
     }
 
-    GST_DEBUG("pipe:%p, type:%d, pushed buf:%p(%d bytes), status.cur_num:%d, status.cur_size:%d",
+    GST_TRACE("pipe:%p, type:%d, pushed buf:%p(%d bytes), status.cur_num:%d, status.cur_size:%d",
               pipe, pipe->type, buffer, buffer ? gst_buffer_get_size(buffer) : -1, pipe->status.cur_num, pipe->status.cur_size);
 done:
     GST_ADAPTER_PIPE_MUTEX_UNLOCK(pipe);
@@ -407,25 +407,25 @@
             continue;
         }
 
-        GST_DEBUG("pipe:%p, type:%d, waitted", pipe, pipe->type);
+        GST_TRACE("pipe:%p, type:%d, waitted", pipe, pipe->type);
         break;
     }
 
     ret = gst_amladapterpipe_pop_uncheck_unlock(pipe, buffer);
     if (ret == GST_FLOW_AMLAP_EMPTY)
     {
-        GST_DEBUG("pipe:%p, type:%d, poped buf:%p, status.cur_num:%d, status.cur_size:%d, pipe empty, need retry",
+        GST_TRACE("pipe:%p, type:%d, poped buf:%p, status.cur_num:%d, status.cur_size:%d, pipe empty, need retry",
                   pipe, pipe->type, *buffer, pipe->status.cur_num, pipe->status.cur_size);
         goto done;
     }
 
-    GST_DEBUG("pipe:%p, type:%d, poped buf:%p(%d bytes), status.cur_num:%d, status.cur_size:%d",
+    GST_TRACE("pipe:%p, type:%d, poped buf:%p(%d bytes), status.cur_num:%d, status.cur_size:%d",
               pipe, pipe->type, *buffer, *buffer ? gst_buffer_get_size(*buffer) : -1, pipe->status.cur_num, pipe->status.cur_size);
 
 done:
     if (!pipe->unlimit && (pipe->status.cur_num <= pipe->status.low_num || pipe->status.cur_size <= pipe->status.low_size))
     {
-        GST_DEBUG("pipe:%p, type:%d, buffer low, [status.cur_num:%d, status.low_num:%d], [status.cur_size:%d, status.low_size:%d]",
+        GST_TRACE("pipe:%p, type:%d, buffer low, [status.cur_num:%d, status.low_num:%d], [status.cur_size:%d, status.low_size:%d]",
                   pipe, pipe->type, pipe->status.cur_num, pipe->status.low_num, pipe->status.cur_size, pipe->status.low_size);
         GST_ADAPTER_PIPE_SIGNAL(pipe);
     }
@@ -454,7 +454,7 @@
     {
         if (gst_queue_array_get_length(pipe->s.secure_ap.sec_buf_q) <= pipe->s.secure_ap.prob_peek_idx)
         {
-            GST_DEBUG("pipe:%p, type:%d, peek err. q len < idx", pipe, pipe->type);
+            GST_TRACE("pipe:%p, type:%d, peek err. q len < idx", pipe, pipe->type);
         }
         else
         {
@@ -472,7 +472,7 @@
         guint available = gst_adapter_available(pipe->s.clear_ap.adapter);
         if (available < BUFFER_SIZE + pipe->s.clear_ap.prob_peek_offset)
         {
-            GST_DEBUG("pipe:%p, type:%d, peek err. q available:%d < BUFFER_SIZE", pipe, pipe->type, available);
+            GST_TRACE("pipe:%p, type:%d, peek err. q available:%d < BUFFER_SIZE", pipe, pipe->type, available);
         }
         else
         {
@@ -490,7 +490,7 @@
         }
     }
 
-    GST_DEBUG("pipe:%p, type:%d, peeked buf:%p(%d bytes), ret:%d", pipe, pipe->type, *buffer, *buffer ? gst_buffer_get_size(*buffer) : -1, ret);
+    GST_TRACE("pipe:%p, type:%d, peeked buf:%p(%d bytes), ret:%d", pipe, pipe->type, *buffer, *buffer ? gst_buffer_get_size(*buffer) : -1, ret);
     GST_ADAPTER_PIPE_MUTEX_UNLOCK(pipe);
     return ret;
 }
@@ -502,7 +502,7 @@
     GstFlowReturn ret;
 
     GST_ADAPTER_PIPE_MUTEX_LOCK(pipe);
-    GST_DEBUG("pipe:%p, type:%d, set flushing to %d", pipe, pipe->type, flushing);
+    GST_TRACE("pipe:%p, type:%d, set flushing to %d", pipe, pipe->type, flushing);
     pipe->flushing = flushing;
     ret = gst_amladapterpipe_clear_unlock(pipe);
     if (!pipe->unlimit)
@@ -519,7 +519,7 @@
 
     GST_ADAPTER_PIPE_MUTEX_LOCK(pipe);
     *flushing = pipe->flushing;
-    GST_DEBUG("pipe:%p, type:%d, is flushing:%d", pipe, pipe->type, pipe->flushing);
+    GST_TRACE("pipe:%p, type:%d, is flushing:%d", pipe, pipe->type, pipe->flushing);
     GST_ADAPTER_PIPE_MUTEX_UNLOCK(pipe);
 
     return GST_FLOW_OK;
@@ -530,7 +530,7 @@
     g_return_if_fail(pipe);
 
     GST_ADAPTER_PIPE_MUTEX_LOCK(pipe);
-    GST_DEBUG("pipe:%p, type:%d, set eos", pipe, pipe->type);
+    GST_TRACE("pipe:%p, type:%d, set eos", pipe, pipe->type);
     pipe->eos = TRUE;
     GST_ADAPTER_PIPE_MUTEX_UNLOCK(pipe);
 }
diff --git a/aml-hwdemux/gstamladapterpipe.h b/aml-hwdemux/gstamladapterpipe.h
index e222cc2..34bfcfc 100644
--- a/aml-hwdemux/gstamladapterpipe.h
+++ b/aml-hwdemux/gstamladapterpipe.h
@@ -66,8 +66,8 @@
     }                                                            \
     G_STMT_END
 
-GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_debug);
-#define GST_CAT_DEFAULT gst_amlhwdmx_debug
+GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_ap_debug);
+#define GST_CAT_DEFAULT gst_amlhwdmx_ap_debug
 
 #define GST_FLOW_AMLAP_EMPTY GST_FLOW_CUSTOM_SUCCESS
 
diff --git a/aml-hwdemux/gstamldmx.c b/aml-hwdemux/gstamldmx.c
index 2a0ee28..e1bb159 100644
--- a/aml-hwdemux/gstamldmx.c
+++ b/aml-hwdemux/gstamldmx.c
@@ -119,6 +119,12 @@
 };
 
 GST_DEBUG_CATEGORY(gst_amlhwdmx_debug);
+GST_DEBUG_CATEGORY(gst_amlhwdmx_ap_debug);
+GST_DEBUG_CATEGORY(gst_amlhwdmx_filter_debug);
+GST_DEBUG_CATEGORY(gst_amlhwdmx_dmxwrap_debug);
+GST_DEBUG_CATEGORY(gst_amlhwdmx_mgr_debug);
+GST_DEBUG_CATEGORY(gst_amlhwdmx_table_debug);
+
 #define GST_CAT_DEFAULT gst_amlhwdmx_debug
 
 static GstBinClass *parent_class;
@@ -2035,13 +2041,13 @@
 
     if (srcpad->stream_type != GST_STREAM_TYPE_AUDIO)
     {
-        GST_DEBUG_OBJECT(srcpad->pad, "only do clip for audio");
+        GST_TRACE_OBJECT(srcpad->pad, "only do clip for audio");
         goto push;
     }
 
     if (!amlhwdmx->sinkpad.segment_event)
     {
-        GST_DEBUG_OBJECT(srcpad->pad, "don't do clip when we have no input segment");
+        GST_TRACE_OBJECT(srcpad->pad, "don't do clip when we have no input segment");
         goto push;
     }
 
@@ -2051,13 +2057,13 @@
     if ((segment.rate > 0 && GST_CLOCK_TIME_NONE == segment.start) ||
         (segment.rate < 0 && GST_CLOCK_TIME_NONE == segment.stop))
     {
-        GST_DEBUG_OBJECT(srcpad->pad, "don't do clip when we don't have invalid input segment");
+        GST_TRACE_OBJECT(srcpad->pad, "don't do clip when we don't have invalid input segment");
         goto push;
     }
 
     if (GST_CLOCK_TIME_NONE == GST_BUFFER_PTS(buf))
     {
-        GST_DEBUG_OBJECT(srcpad->pad, "sync last drop strategy for audio buf with invalid pts");
+        GST_TRACE_OBJECT(srcpad->pad, "sync last drop strategy for audio buf with invalid pts");
         if (srcpad->is_last_buf_dropped)
             goto drop;
         else
@@ -2073,7 +2079,7 @@
 
         if ((GST_BUFFER_PTS(buf) + duration) < segment.start)
         {
-            GST_DEBUG_OBJECT(srcpad->pad, "drop frame with pts(dur %" GST_TIME_FORMAT ") %" GST_TIME_FORMAT " < start %" GST_TIME_FORMAT,
+            GST_TRACE_OBJECT(srcpad->pad, "drop frame with pts(dur %" GST_TIME_FORMAT ") %" GST_TIME_FORMAT " < start %" GST_TIME_FORMAT,
                 GST_TIME_ARGS(GST_BUFFER_PTS(buf)), GST_TIME_ARGS(GST_BUFFER_DURATION(buf)), GST_TIME_ARGS(segment.start));
             goto drop;
         }
@@ -2082,7 +2088,7 @@
     {
         if (GST_BUFFER_PTS(buf) > segment.stop)
         {
-            GST_DEBUG_OBJECT(srcpad->pad, "drop frame with pts(dur %" GST_TIME_FORMAT ") %" GST_TIME_FORMAT " > stop %" GST_TIME_FORMAT,
+            GST_TRACE_OBJECT(srcpad->pad, "drop frame with pts(dur %" GST_TIME_FORMAT ") %" GST_TIME_FORMAT " > stop %" GST_TIME_FORMAT,
                 GST_TIME_ARGS(GST_BUFFER_PTS(buf)), GST_TIME_ARGS(GST_BUFFER_DURATION(buf)), GST_TIME_ARGS(segment.stop));
             goto drop;
         }
@@ -2097,7 +2103,7 @@
     srcpad->is_last_buf_dropped = TRUE;
     goto done;
 done:
-    GST_DEBUG_OBJECT(srcpad->pad, "%s buf:%p (size:%d start: %" GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ")",
+    GST_INFO_OBJECT(srcpad->pad, "%s buf:%p (size:%d start: %" GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ")",
                      srcpad->is_last_buf_dropped ? "dropped" : "pushed", buf,
                      buf ? gst_buffer_get_size(buf) : -1,
                      GST_TIME_ARGS(GST_BUFFER_PTS(buf)),
@@ -2179,12 +2185,6 @@
 
     gst_amlhwdmx_clip_and_push(srcpad, buf);
 
-    GST_DEBUG_OBJECT(srcpad->pad, "pushed buf:%p (size:%d start: %" GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ")",
-                     buf,
-                     buf ? gst_buffer_get_size(buf) : -1,
-                     GST_TIME_ARGS(GST_BUFFER_PTS(buf)),
-                     GST_TIME_ARGS(GST_BUFFER_DURATION(buf)));
-
 done:
     GST_DEBUG_OBJECT(srcpad->pad, "end of this loop, reason %d (%s)", ret, gst_flow_get_name(ret));
     return;
@@ -2498,6 +2498,11 @@
 amlhwdmx_init(GstPlugin *plugin)
 {
     GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_debug, "amlhwdmx", 0, "amlhwdmx");
+    GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_ap_debug, "amlhwdmx-ap", 0, "amlhwdmx");
+    GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_filter_debug, "amlhwdmx-filter", 0, "amlhwdmx");
+    GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_dmxwrap_debug, "amlhwdmx-dmxwrap", 0, "amlhwdmx");
+    GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_mgr_debug, "amlhwdmx-mgr", 0, "amlhwdmx");
+    GST_DEBUG_CATEGORY_INIT(gst_amlhwdmx_table_debug, "amlhwdmx-table", 0, "amlhwdmx");
 
     return gst_element_register(plugin, "amlhwdmx", 200, GST_TYPE_AMLHWDMX);
 }
diff --git a/aml-hwdemux/gstamldmxfilter.c b/aml-hwdemux/gstamldmxfilter.c
index 922ade6..339fa1e 100644
--- a/aml-hwdemux/gstamldmxfilter.c
+++ b/aml-hwdemux/gstamldmxfilter.c
@@ -222,11 +222,11 @@
     amlhwdmx = (GstAmlhwdmx *)gst_pad_get_parent(dmx_src_pad->pad);
     adapter_pipe = dmx_src_pad->adapter_pipe;
 
-    GST_DEBUG_OBJECT(dmx_src_pad->pad, "trace in | dev_no:%d, fid:%d, data:%p, len:%d", dev_no, fid, data, len);
+    GST_TRACE_OBJECT(dmx_src_pad->pad, "trace in | dev_no:%d, fid:%d, data:%p, len:%d", dev_no, fid, data, len);
 
     if (amlhwdmx->flags & GST_AML_DMX_PROB)
     {
-        GST_DEBUG_OBJECT(dmx_src_pad->pad, "ignore es buffer in probe state ");
+        GST_TRACE_OBJECT(dmx_src_pad->pad, "ignore es buffer in probe state ");
         return AMLHWDMX_FILTER_ALL;
     }
 
@@ -234,34 +234,6 @@
     if (!buf)
         return AMLHWDMX_FILTER_ALL;
 
-    // if (dmx_src_pad->stream_type == GST_STREAM_TYPE_VIDEO)
-    // {
-    //     char name[50];
-    //     FILE *fd;
-    //     GstMapInfo map;
-    //     GstMemory *mem;
-    //     gsize offset, maxsize;
-
-    //     GST_ERROR_OBJECT(amlhwdmx, "check dump");
-    //     sprintf(name, "/data/test/%s-cb.es", GST_PAD_NAME(dmx_src_pad->pad));
-    //     fd = fopen(name, "ab");
-    //     if (!fd)
-    //         return AMLHWDMX_FILTER_ALL;
-
-    //     GST_ERROR_OBJECT(amlhwdmx, "before write");
-    //     if(buf)
-    //     {
-
-    //         memset(&map, 0, sizeof(map));
-    //         gst_buffer_map(buf, &map, GST_MAP_READ);
-    //         fwrite(map.data, 1, map.size, fd);
-    //         gst_buffer_unmap(buf, &map);
-    //     }
-
-
-    //     fclose(fd);
-    // }
-
     GST_DEBUG_OBJECT(dmx_src_pad->pad, "got buf:%p (size:%d start: %" GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ")",
                      buf,
                      buf ? gst_buffer_get_size(buf) : -1,
@@ -504,7 +476,7 @@
     g_assert(data != NULL);
     g_assert(len == SEC_BUF_HEADER_SIZE);
 
-    GST_DEBUG_OBJECT(amlhwdmx, "trace in | data:%p, len:%d", data, len);
+    GST_TRACE_OBJECT(amlhwdmx, "trace in | data:%p, len:%d", data, len);
 
     sec_data = (struct dmx_sec_es_data *)data;
     if (gst_amldmxwrap_get_dmafd(dev_no, fid, sec_data, &dmafd, &size))
@@ -512,7 +484,7 @@
         GST_ERROR_OBJECT(amlhwdmx, "dbg secure, fd = %d is invalid",dmafd);
         goto err;
     }
-    GST_DEBUG_OBJECT(amlhwdmx, "get sec es buf fd:%d, size:%d", dmafd, size);
+    GST_TRACE_OBJECT(amlhwdmx, "get sec es buf fd:%d, size:%d", dmafd, size);
 
     buf = gst_buffer_new();
     if (!buf)
@@ -582,7 +554,7 @@
     g_assert(data != NULL);
     g_assert(len == NON_SEC_BUF_HEADER_SIZE);
 
-    GST_DEBUG_OBJECT(amlhwdmx, "trace in | data:%p, len:%d", data, len);
+    GST_TRACE_OBJECT(amlhwdmx, "trace in | data:%p, len:%d", data, len);
 
     struct dmx_non_sec_es_header *non_secure_es;
 
@@ -594,7 +566,7 @@
     pts = non_secure_es->pts;
     dts = non_secure_es->dts;
 
-    if (GST_LEVEL_MEMDUMP == gst_debug_category_get_threshold(gst_amlhwdmx_debug))
+    if (GST_LEVEL_MEMDUMP == gst_debug_category_get_threshold(gst_amlhwdmx_ap_debug))
         gst_es_filter_dbg_non_sec_header(amlhwdmx, data, len);
 
     if (pts_dts_flag < 0 || pts_dts_flag > 3 || data_size > 5*1024*1024)
@@ -603,7 +575,7 @@
         return NULL;
     }
 
-    GST_DEBUG_OBJECT(amlhwdmx, "[secure es:%d] | pts_dts_flag:%d, pts:0x%llx, dts:0x%llx | data[%p-%p], data_size:%d",
+    GST_TRACE_OBJECT(amlhwdmx, "[secure es:%d] | pts_dts_flag:%d, pts:0x%llx, dts:0x%llx | data[%p-%p], data_size:%d",
                      amlhwdmx->is_secure, pts_dts_flag, pts, dts, (void *)data_start, (void *)data_end, data_size);
 
     if ((buf = gst_buffer_new_allocate(NULL, data_size, NULL)) == NULL)
@@ -664,7 +636,7 @@
     guint8 *data_start = NULL;
     guint8 *data_end = NULL;
 
-    GST_DEBUG_OBJECT(amlhwdmx, "trace in dump header data:%p, len:%d", data, len);
+    GST_TRACE_OBJECT(amlhwdmx, "trace in dump header data:%p, len:%d", data, len);
 
     while (offset < len)
     {
diff --git a/aml-hwdemux/gstamldmxfilter.h b/aml-hwdemux/gstamldmxfilter.h
index 0d56b8d..5811a3e 100644
--- a/aml-hwdemux/gstamldmxfilter.h
+++ b/aml-hwdemux/gstamldmxfilter.h
@@ -23,8 +23,8 @@
 #include "gstamldmx.h"
 #include "gstamldmxwrap.h"
 
-GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_debug);
-#define GST_CAT_DEFAULT gst_amlhwdmx_debug
+GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_filter_debug);
+#define GST_CAT_DEFAULT gst_amlhwdmx_filter_debug
 
 gint gst_parse_pat_cb(int dev_no, int fid, const guint *data, int len, void *user_data);
 gint gst_parse_pmt_cb(int dev_no, int fid, const guint *data, int len, void *user_data);
diff --git a/aml-hwdemux/gstamldmxwrap.c b/aml-hwdemux/gstamldmxwrap.c
index b1bbca7..5efd8fe 100644
--- a/aml-hwdemux/gstamldmxwrap.c
+++ b/aml-hwdemux/gstamldmxwrap.c
@@ -176,7 +176,7 @@
         ret = poll(fds, cnt, DMX_POLL_TIMEOUT);
         if (ret <= 0)
         {
-            GST_DEBUG("poll dmx timeout");
+            GST_TRACE("poll dmx timeout");
             continue;
         }
 
@@ -223,7 +223,7 @@
                                     return NULL;
                                 }
                             }
-                            GST_INFO("have_read: %d  tmp:%d  left:%d", have_read, tmp, left);
+                            GST_TRACE("have_read: %d  tmp:%d  left:%d", have_read, tmp, left);
                         }
                     }
                     else
@@ -235,11 +235,11 @@
                         }
                         if (G_UNLIKELY(have_read == MAX_READ_SIZE))
                             GST_WARNING("please check carefully , this size may be small");
-                        GST_DEBUG("have read: %d", have_read);
+                        GST_TRACE("have read: %d", have_read);
                     }
                 }
                 AMLHWDMXWRAP_CONTEXT_UNLOCK(dmx);
-                GST_DEBUG("tid[%x] ch[%d] cnt[%d] %x bytes", read_buf[0], fids[i], cnt, have_read);
+                GST_TRACE("tid[%x] ch[%d] cnt[%d] %x bytes", read_buf[0], fids[i], cnt, have_read);
                 if (have_read > 0 && filter->cb)
                 {
                     lb_ret = filter->cb(filter->dev_no, fids[i], (const guint *)read_buf, have_read, filter->user_data);
@@ -253,7 +253,7 @@
         free(read_buf);
     }
 
-    GST_DEBUG("trace out data thread");
+    GST_TRACE("trace out data thread");
 
     return NULL;
 }
diff --git a/aml-hwdemux/gstamldmxwrap.h b/aml-hwdemux/gstamldmxwrap.h
index 35e8140..44a0821 100644
--- a/aml-hwdemux/gstamldmxwrap.h
+++ b/aml-hwdemux/gstamldmxwrap.h
@@ -23,8 +23,8 @@
 #include <gst/gst.h>
 #include "dmx_inc/dmx.h"
 
-GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_debug);
-#define GST_CAT_DEFAULT gst_amlhwdmx_debug
+GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_mgr_debug);
+#define GST_CAT_DEFAULT gst_amlhwdmx_mgr_debug
 
 typedef enum
 {
diff --git a/aml-hwdemux/ts_patpmt_parse.c b/aml-hwdemux/ts_patpmt_parse.c
index ecf62eb..9aa0da8 100644
--- a/aml-hwdemux/ts_patpmt_parse.c
+++ b/aml-hwdemux/ts_patpmt_parse.c
@@ -55,7 +55,7 @@
         {
             packet->network_PID = (buffer[10 + n] & 0x1F) << 8 | buffer[11 + n];
 
-            printf(" packet->network_PID %0x /n/n", packet->network_PID);
+            GST_DEBUG(" packet->network_PID %0x", packet->network_PID);
         }
         else
         {
diff --git a/aml-hwdemux/ts_patpmt_parse.h b/aml-hwdemux/ts_patpmt_parse.h
index 47712ae..33c6869 100644
--- a/aml-hwdemux/ts_patpmt_parse.h
+++ b/aml-hwdemux/ts_patpmt_parse.h
@@ -38,7 +38,7 @@
 
 #define STREAM_DESCRIPTOR_SIZE 128
 
-GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_debug);
+GST_DEBUG_CATEGORY_EXTERN(gst_amlhwdmx_table_debug);
 #define GST_CAT_DEFAULT gst_amlhwdmx_debug
 
 typedef struct TS_PAT_Program