amldmx: CB1 adjust es buf size cfg [1/1]

PD#SWPL-176357

Problem:
Different projects have different file node cfg H/W DMX es buf size

Solution:
Traverses potential paths to cfg

Verify:
(detail info)

Change-Id: I2201b72ee8bab8880303c6f311e1fefa1991a10a
Signed-off-by: xuesong.jiang <xuesong.jiang@amlogic.com>
diff --git a/src/gstamldmxwrap.c b/src/gstamldmxwrap.c
index ca35f02..5e22ff3 100644
--- a/src/gstamldmxwrap.c
+++ b/src/gstamldmxwrap.c
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/prctl.h>
+#include <glib/gstdio.h>
 
 #include <poll.h>
 #include <fcntl.h>
@@ -929,18 +930,29 @@
 
 DVB_RESULT gst_amldmxwrap_set_video_filters_es_buf_size(guint size)
 {
-    const char *path = "/sys/module/dvb_demux/parameters/video_buf_size";
-    gint fd;
+    GStatBuf fileInfo;
+    const gchar *paths[] = {"/sys/module/dvb_demux/parameters/video_buf_size",
+                            "/sys/module/amlogic_dvb_demux/parameters/video_buf_size", NULL};
+    gint fd = -1;
     gchar cmd[128] = {0};
+    memset(&fileInfo, 0, sizeof(fileInfo));
 
-    fd = open(path, O_CREAT | O_RDWR | O_TRUNC, 0644);
-    if (fd < 0)
-        return DVB_FAILURE;
+    for (guint i = 0; paths[i] != NULL; i++)
+    {
+        if (g_stat(paths[i], &fileInfo) == 0)
+        {
+            fd = open(paths[i], O_CREAT | O_RDWR | O_TRUNC, 0644);
+            if (fd < 0)
+                return DVB_FAILURE;
 
-    sprintf(cmd, "%d", size);
-    write(fd, cmd, strlen(cmd));
-    close(fd);
-    return DVB_SUCCESS;
+            sprintf(cmd, "%d", size);
+            write(fd, cmd, strlen(cmd));
+            close(fd);
+            GST_DEBUG("config es buf size 0x%x in to %s", size, paths[i]);
+            return DVB_SUCCESS;
+        }
+    }
+    return DVB_FAILURE;
 }
 
 DVB_RESULT gst_amldmxwrap_set_filter_ring_buf_size(gint dev_no, gint fhandle, guint size)