amlhwdmx: CB1 fix eos misjudgment [1/1]
PD#SWPL-175705
Problem:
Eos misjudgment due to es pipe low th cfg to 0.
Es pipe pushing will be blocked when reach high th until pipe down to low th.
low th cfg to 0 will cause eos misjudgment when
eos event reach between last buf poped and blocked buf pushed
Solution:
Cfg pipe low th to 10
Verify:
(detail info)
Change-Id: I5a94bc3821c2ed6a4ff25d6aeb40c5d7a25054ef
Signed-off-by: xuesong.jiang <xuesong.jiang@amlogic.com>
diff --git a/aml-hwdemux/aml_defs.h b/aml-hwdemux/aml_defs.h
index 62f6750..90c025e 100644
--- a/aml-hwdemux/aml_defs.h
+++ b/aml-hwdemux/aml_defs.h
@@ -112,7 +112,7 @@
#define BUFFER_SIZE LOW_BUFFER_SIZE
/* secure adaptor size */
#define SEC_BUF_QUEUE_MAX_SIZE 256
-#define SEC_BUF_QUEUE_MIN_SIZE 0
+#define SEC_BUF_QUEUE_MIN_SIZE 10 //don't cfg to 0. 0 will case eos misjudgment
#define SEC_BUF_QUEUE_NEEDED_SIZE 1
#define SEC_BUF_QUEUE_UNLIMIT_SIZE -1
/* dmx es buffer pts threshold(ms) */
diff --git a/aml-hwdemux/gstamldmx.c b/aml-hwdemux/gstamldmx.c
index 073e515..7957b13 100644
--- a/aml-hwdemux/gstamldmx.c
+++ b/aml-hwdemux/gstamldmx.c
@@ -796,7 +796,7 @@
amlhwdmx = (GstAmlhwdmx *)parent;
gboolean result = TRUE;
- GST_DEBUG_OBJECT(amlhwdmx, "event: %" GST_PTR_FORMAT, event);
+ GST_INFO_OBJECT(amlhwdmx, "event: %" GST_PTR_FORMAT, event);
switch (GST_EVENT_TYPE(event))
{
@@ -1997,7 +1997,7 @@
if (gst_amlhwdmx_is_ts_drain(&amlhwdmx->sinkpad))
{
amlhwdmx->last_ts_write_time = amlhwdmx->latest_ts_write_time;
- GST_DEBUG_OBJECT(amlhwdmx, "get upstream eos event and the cached data has been processed");
+ GST_INFO_OBJECT(amlhwdmx, "get upstream eos event and the cached data has been processed");
goto eos;
}
else
@@ -2140,7 +2140,7 @@
{
if (gst_amlhwdmx_is_es_drain(srcpad))
{
- GST_DEBUG_OBJECT(srcpad->pad, "get upstream eos event and the cached data has been processed, push eos event");
+ GST_INFO_OBJECT(srcpad->pad, "get upstream eos event and the cached data has been processed, push eos event");
gst_pad_push_event(srcpad->pad, gst_event_new_eos());
goto pause;
}
@@ -2211,7 +2211,7 @@
min_ts = max_ts = ts;
min_idx = max_idx = srcpad->idx;
- if (-1 == amlhwdmx->lb_th)
+ if (-1 == amlhwdmx->lb_th && amlhwdmx->srcpad_num <= 1)
{
goto done;
}
@@ -2299,6 +2299,11 @@
ret = gst_amladapterpipe_is_eos(sinkpad->adapter_pipe);
done:
+ if (ret)
+ {
+ GST_INFO_OBJECT(sinkpad->pad, "ts eos with status | pushed_num:%d, poped_num:%d, pushed_size:%d, poped_size:%d",
+ status.pushed_num, status.poped_num, status.pushed_size, status.poped_size);
+ }
return ret;
}
@@ -2365,6 +2370,11 @@
}
done:
+ if (ret)
+ {
+ GST_INFO_OBJECT(srcpad->pad, "es eos with status | pushed_num:%d, poped_num:%d, pushed_size:%d, poped_size:%d",
+ status.pushed_num, status.poped_num, status.pushed_size, status.poped_size);
+ }
return ret;
}
diff --git a/aml-hwdemux/gstamldmxfilter.c b/aml-hwdemux/gstamldmxfilter.c
index 4fcffaf..8f67051 100644
--- a/aml-hwdemux/gstamldmxfilter.c
+++ b/aml-hwdemux/gstamldmxfilter.c
@@ -240,7 +240,7 @@
if (!buf)
return AMLHWDMX_FILTER_ALL;
- GST_DEBUG_OBJECT(dmx_src_pad->pad, "got buf:%p (size:%d start: %" GST_TIME_FORMAT ", duration: %" GST_TIME_FORMAT ")",
+ GST_INFO_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,
GST_TIME_ARGS(GST_BUFFER_PTS(buf)),
diff --git a/aml-hwdemux/gstamldmxwrap.c b/aml-hwdemux/gstamldmxwrap.c
index 6aafd1f..62218ba 100644
--- a/aml-hwdemux/gstamldmxwrap.c
+++ b/aml-hwdemux/gstamldmxwrap.c
@@ -249,6 +249,7 @@
if (have_read > 0 && filter->cb)
{
lb_ret = filter->cb(filter->dev_no, fids[i], (const guint *)read_buf, have_read, filter->user_data);
+ GST_TRACE("lb_ret:%d", lb_ret);
}
}
}