amlv4l2dec: CB2 config buffer pool issue [1/1]
PD#SWPL-177028
Problem:
config capture buffer pool to negative numbers
Solution:
set min buffer count of other buffer pool to 4
Verify:
ap222
Change-Id: I3a6c8bf1f51f19a6cc2ea9f3500f24f64c7a0c9e
Signed-off-by: fei.deng <fei.deng@amlogic.com>
diff --git a/src/gstamlv4l2object.c b/src/gstamlv4l2object.c
index 225a5a0..de495ab 100644
--- a/src/gstamlv4l2object.c
+++ b/src/gstamlv4l2object.c
@@ -5636,8 +5636,11 @@
if (obj->old_other_pool || obj->old_old_other_pool) //jxsdbg for switching
{
obj->outstanding_buf_num = gst_aml_v4l2_object_get_outstanding_capture_buf_num(obj);
- other_min = min - obj->outstanding_buf_num;
- other_max = max - obj->outstanding_buf_num;
+ //when doing resolution changed,set new other buffer pool count to 1
+ //the buffer pool count will increase after buffer released
+ if (obj->outstanding_buf_num > 0) {
+ other_min = other_max = 1;
+ }
GST_DEBUG_OBJECT(obj, "oop:%p, ooop:%p, outstanding buf num:%d, set min, max to %d,%d",
obj->old_other_pool, obj->old_old_other_pool,
obj->outstanding_buf_num, other_min, other_max);