From 6a99d9bf65aa5878cb409945ed2bdbdcb916d047 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期五, 02 九月 2022 14:56:40 +0800 Subject: [PATCH] 更新linphone sdk --- Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Library/mediastreamer2.framework/Headers/msqueue.h | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Library/mediastreamer2.framework/Headers/msqueue.h b/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Library/mediastreamer2.framework/Headers/msqueue.h index f435dff..ec884cc 100755 --- a/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Library/mediastreamer2.framework/Headers/msqueue.h +++ b/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Library/mediastreamer2.framework/Headers/msqueue.h @@ -70,6 +70,10 @@ return qend(&q->q,m); } +static MS2_INLINE mblk_t *ms_queue_peek_next(MSQueue *q, mblk_t *cur){ + return cur->b_next; +} + static MS2_INLINE void ms_queue_remove(MSQueue *q, mblk_t *m){ remq(&q->q,m); } @@ -113,7 +117,7 @@ #define mblk_set_user_flag(m,bit) __mblk_set_flag(m,7,bit) /* to be used by extensions to mediastreamer2*/ #define mblk_get_user_flag(m) (((m)->reserved2)>>7 & 0x1) /*bit 8*/ -#define mblk_set_cseq(m,value) (m)->reserved2=(m)->reserved2| ((value&0xFFFF)<<16); +#define mblk_set_cseq(m,value) (m)->reserved2 = ((m)->reserved2 & 0x0000FFFF) | ((value&0xFFFF)<<16); #define mblk_get_cseq(m) ((m)->reserved2>>16) #define HAVE_ms_bufferizer_fill_current_metas @@ -123,6 +127,10 @@ size_t size; }; +/** + * The MSFlowControlledBufferizer is an object that buffer audio samples provided as mblk_t of any size, + * and allows a reader to read (in a FIFO manner) with an arbitrary size. + */ typedef struct _MSBufferizer MSBufferizer; /*allocates and initialize */ @@ -156,10 +164,19 @@ MS2_PUBLIC void ms_bufferizer_destroy(MSBufferizer *obj); +/** + * The drop method explicits how the MSFlowControlledBufferizer should react when + * it detects an excessive amount of samples. + */ +typedef enum _MSFlowControlledBufferizerDropMethod{ + MSFlowControlledBufferizerSendEvent, /**< Send a MS_AUDIO_FLOW_CONTROL_DROP_EVENT to be caught by the upper layer */ + MSFlowControlledBufferizerImmediateDrop /**< Immediately and abruptly drop samples */ +}MSFlowControlledBufferizerDropMethod; struct _MSFlowControlledBufferizer { MSBufferizer base; struct _MSFilter *filter; + MSFlowControlledBufferizerDropMethod drop_method; uint64_t flow_control_time; uint32_t flow_control_interval_ms; uint32_t max_size_ms; @@ -169,12 +186,22 @@ int nchannels; }; +/** + * The MSFlowControlledBufferizer is an object that buffer audio samples provided as mblk_t of any size, + * and allows a reader to read (in a FIFO manner) with an arbitrary size, exactly as the MSBufferizer, but with an additional feature: + * it monitors the actual fullness (minimum amount of sample) of the internal buffer over a period of time. + * If this amount exceeds a give maximum size, it can either raise an event to request samples to be dropped + * by an upstream filter, or simply eliminate such amount of samples in excess. + * It is particularly useful when synchronizing several streams together, that may not operate at exactly the same rate. + */ typedef struct _MSFlowControlledBufferizer MSFlowControlledBufferizer; MS2_PUBLIC MSFlowControlledBufferizer * ms_flow_controlled_bufferizer_new(struct _MSFilter *f, int samplerate, int nchannels); MS2_PUBLIC void ms_flow_controlled_bufferizer_init(MSFlowControlledBufferizer *obj, struct _MSFilter *f, int samplerate, int nchannels); +MS2_PUBLIC void ms_flow_controlled_bufferizer_set_drop_method(MSFlowControlledBufferizer *obj, MSFlowControlledBufferizerDropMethod method); + MS2_PUBLIC void ms_flow_controlled_bufferizer_set_max_size_ms(MSFlowControlledBufferizer *obj, uint32_t ms); MS2_PUBLIC void ms_flow_controlled_bufferizer_set_granularity_ms(MSFlowControlledBufferizer *obj, uint32_t ms); -- Gitblit v1.8.0