Forráskód Böngészése

#IQRV #comment [sipphone] 同步连线过程sipphone实体存在卡住问题修复到国产化版本

陈礼鹏80274480 4 éve
szülő
commit
59d8f908b7

+ 1 - 0
Other/libaudioframework/CMakeLists.txt

@@ -104,6 +104,7 @@ set(${MODULE_PREFIX}_SRCS
     codec/gsmcodec.h 
     other/circbuf.h 
     other/delaybuf.h 
+    other/jerrno.h
     other/jbuf.h 
     #other/plc.h 
     #other/silencedet.h 

+ 9 - 8
Other/libaudioframework/other/jbuf.c

@@ -1,4 +1,5 @@
 #include "jbuf.h"
+#include "jerrno.h"
 
 #include <memory.h>
 #include <assert.h>
@@ -446,7 +447,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
 	if (index < framelist->origin) {
 		if (framelist->origin - index < MAX_MISORDER) {
 			/* too late */
-			return -1;
+			return PJ_ETOOSMALL;
 		} else {
 			/* sequence restart */
 			framelist->origin = index - framelist->size;
@@ -471,7 +472,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
 			distance = 0;
 		} else {
 			/* otherwise, reject the frame */
-			return -1;
+			return PJ_ETOOMANY;
 		}
 	}
 
@@ -480,7 +481,7 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
 
 	/* if the slot is occupied, it must be duplicated frame, ignore it. */
 	if (framelist->frame_type[pos] != JB_MISSING_FRAME)
-		return -1;
+		return PJ_EEXISTS;
 
 	/* put the frame into the slot */
 	framelist->frame_type[pos] = frame_type;
@@ -495,11 +496,11 @@ static int jb_framelist_put_at(jb_framelist_t *framelist,
 		/* copy frame content */
 		memcpy(framelist->content + pos * framelist->frame_size,
 			frame, frame_size);
-		return 0;
+		return PJ_SUCCESS;
 	} else {
 		/* frame is being discarded */
 		framelist->discarded_num++;
-		return -1;
+		return PJ_EIGNORED;
 	}
 }
 
@@ -831,7 +832,7 @@ default:
 		min_frame_size, bit_info, frame_type);
 
 	/* Jitter buffer is full, remove some older frames */
-	while (status == -1) {
+    while (status == PJ_ETOOMANY) {
 		int distance;
 		unsigned removed;
 
@@ -861,9 +862,9 @@ default:
 
 	/* Return the flag if this frame is discarded */
 	if (discarded)
-		*discarded = (status != 0);
+		*discarded = (status != PJ_SUCCESS);
 
-	if (status == 0) {
+    if (status == PJ_SUCCESS) {
 		if (jb->jb_status == JB_STATUS_PREFETCHING) {
 			if (new_size >= jb->jb_prefetch)
 				jb->jb_status = JB_STATUS_PROCESSING;

+ 117 - 0
Other/libaudioframework/other/jerrno.h

@@ -0,0 +1,117 @@
+#pragma once
+
+/** Status is OK. */
+#define PJ_SUCCESS  0
+
+#define PJ_ERRNO_START_STATUS 70000
+/**
+ * @hideinitializer
+ * Unknown error has been reported.
+ */
+#define PJ_EUNKNOWN	    (PJ_ERRNO_START_STATUS + 1)	/* 70001 */
+/**
+ * @hideinitializer
+ * The operation is pending and will be completed later.
+ */
+#define PJ_EPENDING	    (PJ_ERRNO_START_STATUS + 2)	/* 70002 */
+/**
+ * @hideinitializer
+ * Too many connecting sockets.
+ */
+#define PJ_ETOOMANYCONN	    (PJ_ERRNO_START_STATUS + 3)	/* 70003 */
+/**
+ * @hideinitializer
+ * Invalid argument.
+ */
+#define PJ_EINVAL	    (PJ_ERRNO_START_STATUS + 4)	/* 70004 */
+/**
+ * @hideinitializer
+ * Name too long (eg. hostname too long).
+ */
+#define PJ_ENAMETOOLONG	    (PJ_ERRNO_START_STATUS + 5)	/* 70005 */
+/**
+ * @hideinitializer
+ * Not found.
+ */
+#define PJ_ENOTFOUND	    (PJ_ERRNO_START_STATUS + 6)	/* 70006 */
+/**
+ * @hideinitializer
+ * Not enough memory.
+ */
+#define PJ_ENOMEM	    (PJ_ERRNO_START_STATUS + 7)	/* 70007 */
+/**
+ * @hideinitializer
+ * Bug detected!
+ */
+#define PJ_EBUG             (PJ_ERRNO_START_STATUS + 8)	/* 70008 */
+/**
+ * @hideinitializer
+ * Operation timed out.
+ */
+#define PJ_ETIMEDOUT        (PJ_ERRNO_START_STATUS + 9)	/* 70009 */
+/**
+ * @hideinitializer
+ * Too many objects.
+ */
+#define PJ_ETOOMANY         (PJ_ERRNO_START_STATUS + 10)/* 70010 */
+/**
+ * @hideinitializer
+ * Object is busy.
+ */
+#define PJ_EBUSY            (PJ_ERRNO_START_STATUS + 11)/* 70011 */
+/**
+ * @hideinitializer
+ * The specified option is not supported.
+ */
+#define PJ_ENOTSUP	    (PJ_ERRNO_START_STATUS + 12)/* 70012 */
+/**
+ * @hideinitializer
+ * Invalid operation.
+ */
+#define PJ_EINVALIDOP	    (PJ_ERRNO_START_STATUS + 13)/* 70013 */
+/**
+ * @hideinitializer
+ * Operation is cancelled.
+ */
+#define PJ_ECANCELLED	    (PJ_ERRNO_START_STATUS + 14)/* 70014 */
+/**
+ * @hideinitializer
+ * Object already exists.
+ */
+#define PJ_EEXISTS          (PJ_ERRNO_START_STATUS + 15)/* 70015 */
+/**
+ * @hideinitializer
+ * End of file.
+ */
+#define PJ_EEOF		    (PJ_ERRNO_START_STATUS + 16)/* 70016 */
+/**
+ * @hideinitializer
+ * Size is too big.
+ */
+#define PJ_ETOOBIG	    (PJ_ERRNO_START_STATUS + 17)/* 70017 */
+/**
+ * @hideinitializer
+ * Error in gethostbyname(). This is a generic error returned when
+ * gethostbyname() has returned an error.
+ */
+#define PJ_ERESOLVE	    (PJ_ERRNO_START_STATUS + 18)/* 70018 */
+/**
+ * @hideinitializer
+ * Size is too small.
+ */
+#define PJ_ETOOSMALL	    (PJ_ERRNO_START_STATUS + 19)/* 70019 */
+/**
+ * @hideinitializer
+ * Ignored
+ */
+#define PJ_EIGNORED	    (PJ_ERRNO_START_STATUS + 20)/* 70020 */
+/**
+ * @hideinitializer
+ * IPv6 is not supported
+ */
+#define PJ_EIPV6NOTSUP	    (PJ_ERRNO_START_STATUS + 21)/* 70021 */
+/**
+ * @hideinitializer
+ * Unsupported address family
+ */
+#define PJ_EAFNOTSUP	    (PJ_ERRNO_START_STATUS + 22)/* 70022 */