o More updates to libjingle's third party mediaphone (obtained from
current CVS of net/linphone http://savannah.gnu.org/projects/linphone/) library [1] o Pacify gcc: add missing "return" values to non-void functions o This last round of patches get voice communications to "realtime" responsiveness levels. Previously, there were a couple seconds of latency on communications which made them a patience test. - Particularly, the change on talk/third_party/mediastreamer/msrtprecv.c where we now rely on the rtp session's send_pt payload instead of the recv_pt one o Bump PORTREVISION Obtained from: linphone's CVS [1]
This commit is contained in:
parent
2576f2f2d6
commit
c170c3911b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=162055
11 changed files with 195 additions and 16 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= libjingle
|
||||
PORTVERSION= 0.3.0
|
||||
PORTREVISION= 5
|
||||
PORTREVISION= 6
|
||||
CATEGORIES= net-im
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME}
|
||||
|
|
|
@ -8,6 +8,17 @@
|
|||
}
|
||||
|
||||
LinphoneMediaChannel::~LinphoneMediaChannel() {
|
||||
@@ -118,8 +119,8 @@
|
||||
mute_ = !send;
|
||||
}
|
||||
|
||||
-float LinphoneMediaChannel::GetCurrentQuality() {}
|
||||
-int LinphoneMediaChannel::GetOutputLevel() {}
|
||||
+float LinphoneMediaChannel::GetCurrentQuality() { return 0; }
|
||||
+int LinphoneMediaChannel::GetOutputLevel() { return 0; }
|
||||
|
||||
LinphoneMediaEngine::LinphoneMediaEngine() {}
|
||||
LinphoneMediaEngine::~LinphoneMediaEngine() {}
|
||||
@@ -139,7 +140,7 @@
|
||||
|
||||
#ifdef HAVE_SPEEX
|
||||
|
@ -26,3 +37,16 @@
|
|||
codecs_.push_back(Codec(0, "PCMU", 2));
|
||||
|
||||
return true;
|
||||
@@ -163,8 +164,8 @@
|
||||
return new LinphoneMediaChannel();
|
||||
}
|
||||
|
||||
-int LinphoneMediaEngine::SetAudioOptions(int options) {}
|
||||
-int LinphoneMediaEngine::SetSoundDevices(int wave_in_device, int wave_out_device) {}
|
||||
+int LinphoneMediaEngine::SetAudioOptions(int options) { return 0; }
|
||||
+int LinphoneMediaEngine::SetSoundDevices(int wave_in_device, int wave_out_device) { return 0; }
|
||||
|
||||
-float LinphoneMediaEngine::GetCurrentQuality() {}
|
||||
-int LinphoneMediaEngine::GetInputLevel() {}
|
||||
+float LinphoneMediaEngine::GetCurrentQuality() { return 0; }
|
||||
+int LinphoneMediaEngine::GetInputLevel() { return 0; }
|
||||
|
|
|
@ -29,15 +29,19 @@
|
|||
rtp_session_set_jitter_compensation(rtps,jitt_comp);
|
||||
|
||||
rtpr=rtp_session_new(RTP_SESSION_RECVONLY);
|
||||
@@ -158,7 +162,6 @@
|
||||
@@ -156,9 +160,9 @@
|
||||
#endif
|
||||
rtp_session_set_scheduling_mode(rtpr,0);
|
||||
rtp_session_set_blocking_mode(rtpr,0);
|
||||
rtp_session_set_payload_type(rtpr,payload);
|
||||
- rtp_session_set_payload_type(rtpr,payload);
|
||||
+ rtp_session_set_send_payload_type(rtpr,payload);
|
||||
+ rtp_session_set_recv_payload_type(rtpr,payload);
|
||||
rtp_session_set_jitter_compensation(rtpr,jitt_comp);
|
||||
- rtp_session_signal_connect(rtpr,"telephone-event",(RtpCallback)on_dtmf_received,NULL);
|
||||
rtp_session_signal_connect(rtpr,"timestamp_jump",(RtpCallback)on_timestamp_jump,NULL);
|
||||
*recv=rtpr;
|
||||
*send=rtps;
|
||||
@@ -179,8 +182,6 @@
|
||||
@@ -179,8 +183,6 @@
|
||||
rtp_session_signal_connect(rtpr,"telephone-event",(RtpCallback)on_dtmf_received,(gpointer)stream);
|
||||
rtps=rtpr;
|
||||
|
||||
|
@ -46,7 +50,7 @@
|
|||
stream->rtpsend=ms_rtp_send_new();
|
||||
ms_rtp_send_set_session(MS_RTP_SEND(stream->rtpsend),rtps);
|
||||
stream->rtprecv=ms_rtp_recv_new();
|
||||
@@ -217,8 +218,8 @@
|
||||
@@ -217,8 +219,8 @@
|
||||
ms_filter_set_property(stream->decoder,MS_FILTER_PROPERTY_FREQ,&pt->clock_rate);
|
||||
ms_filter_set_property(stream->decoder,MS_FILTER_PROPERTY_BITRATE,&pt->normal_bitrate);
|
||||
|
||||
|
@ -57,3 +61,9 @@
|
|||
/* create the synchronisation source */
|
||||
stream->timer=ms_timer_new();
|
||||
|
||||
@@ -340,4 +342,5 @@
|
||||
{
|
||||
ms_rtp_send_dtmf(MS_RTP_SEND(stream->rtpsend), dtmf);
|
||||
ms_oss_write_play_dtmf(MS_OSS_WRITE(stream->soundwrite),dtmf);
|
||||
+ return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
--- talk/third_party/mediastreamer/msavencoder.h.orig Thu May 11 01:05:51 2006
|
||||
+++ talk/third_party/mediastreamer/msavencoder.h Thu May 11 01:06:18 2006
|
||||
@@ -44,6 +44,7 @@
|
||||
gint av_opened;
|
||||
MSBuffer *comp_buf;
|
||||
MSBuffer *yuv_buf;
|
||||
+ MSMessage *outm;
|
||||
};
|
||||
|
||||
typedef struct _MSAVEncoder MSAVEncoder;
|
|
@ -0,0 +1,42 @@
|
|||
--- ./talk/third_party/mediastreamer/msbuffer.c.orig Wed May 10 23:56:49 2006
|
||||
+++ ./talk/third_party/mediastreamer/msbuffer.c Wed May 10 23:59:29 2006
|
||||
@@ -34,31 +34,28 @@
|
||||
/* allocate the data buffer: there is a lot of optmisation that can be done by using a pool of cached buffers*/
|
||||
buf->buffer=((char*)(buf))+sizeof(MSBuffer); /* to avoid to do two allocations,
|
||||
buffer info and buffer are contigous.*/
|
||||
- buf->flags=MS_BUFFER_CONTIGUOUS;
|
||||
+ buf->freefn=NULL;
|
||||
+ buf->freearg=NULL;
|
||||
return(buf);
|
||||
}
|
||||
|
||||
-MSBuffer *ms_buffer_alloc(gint flags)
|
||||
+MSBuffer *ms_buffer_new_with_buf(char *extbuf, int size,void (*freefn)(void *), void *freearg)
|
||||
{
|
||||
MSBuffer *buf;
|
||||
buf=(MSBuffer*)g_malloc(sizeof(MSBuffer));
|
||||
buf->ref_count=0;
|
||||
- buf->size=0;
|
||||
- buf->buffer=NULL;
|
||||
- buf->flags=0;
|
||||
+ buf->size=size;
|
||||
+ buf->buffer=extbuf;
|
||||
+ buf->freefn=freefn;
|
||||
+ buf->freearg=freearg;
|
||||
return(buf);
|
||||
}
|
||||
|
||||
|
||||
void ms_buffer_destroy(MSBuffer *buf)
|
||||
{
|
||||
- if (buf->flags & MS_BUFFER_CONTIGUOUS){
|
||||
- g_free(buf);
|
||||
- }
|
||||
- else {
|
||||
- g_free(buf->buffer);
|
||||
+ if (buf->freefn!=NULL) buf->freefn(buf->freearg);
|
||||
g_free(buf);
|
||||
- }
|
||||
}
|
||||
|
||||
MSMessage *ms_message_alloc()
|
|
@ -1,6 +1,21 @@
|
|||
--- ./talk/third_party/mediastreamer/msbuffer.h.orig Thu Mar 16 18:43:06 2006
|
||||
+++ ./talk/third_party/mediastreamer/msbuffer.h Fri Apr 21 10:56:34 2006
|
||||
@@ -48,11 +48,12 @@
|
||||
+++ ./talk/third_party/mediastreamer/msbuffer.h Thu May 11 00:12:20 2006
|
||||
@@ -37,28 +37,28 @@
|
||||
{
|
||||
gchar *buffer;
|
||||
guint32 size;
|
||||
- guint16 ref_count;
|
||||
- guint16 flags;
|
||||
-#define MS_BUFFER_CONTIGUOUS (1)
|
||||
+ gint ref_count;
|
||||
+ void (*freefn)(void *);
|
||||
+ void *freearg;
|
||||
}MSBuffer;
|
||||
|
||||
MSBuffer * ms_buffer_new(guint32 size);
|
||||
+MSBuffer *ms_buffer_new_with_buf(char *extbuf, int size,void (*freefn)(void *), void *freearg);
|
||||
void ms_buffer_destroy(MSBuffer *buf);
|
||||
|
||||
struct _MSMessage
|
||||
{
|
||||
MSBuffer *buffer; /* points to a MSBuffer */
|
||||
|
@ -14,3 +29,9 @@
|
|||
};
|
||||
|
||||
typedef struct _MSMessage MSMessage;
|
||||
|
||||
-
|
||||
-MSBuffer *ms_buffer_alloc(gint flags);
|
||||
MSMessage *ms_message_new(gint size);
|
||||
|
||||
#define ms_message_set_buf(m,b) do { (b)->ref_count++; (m)->buffer=(b); (m)->data=(b)->buffer; (m)->size=(b)->size; }while(0)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
--- ./talk/third_party/mediastreamer/mscodec.c.orig Thu May 11 00:01:12 2006
|
||||
+++ ./talk/third_party/mediastreamer/mscodec.c Thu May 11 00:01:45 2006
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "mscodec.h"
|
||||
#include "msMUlawdec.h"
|
||||
+#include "msAlawdec.h"
|
||||
|
||||
#ifdef TRUESPEECH
|
||||
extern MSCodecInfo TrueSpeechinfo;
|
||||
@@ -43,6 +44,7 @@
|
||||
// ms_filter_register(MS_FILTER_INFO(&GSMinfo));
|
||||
// ms_filter_register(MS_FILTER_INFO(&LPC10info));
|
||||
ms_filter_register(MS_FILTER_INFO(&MULAWinfo));
|
||||
+ ms_filter_register(MS_FILTER_INFO(&ALAWinfo));
|
||||
#ifdef TRUESPEECH
|
||||
ms_filter_register(MS_FILTER_INFO(&TrueSpeechinfo));
|
||||
#endif
|
|
@ -1,6 +1,23 @@
|
|||
--- ./talk/third_party/mediastreamer/msfifo.c.orig Thu Mar 16 18:43:06 2006
|
||||
+++ ./talk/third_party/mediastreamer/msfifo.c Fri Apr 21 10:56:34 2006
|
||||
@@ -123,7 +123,7 @@
|
||||
+++ ./talk/third_party/mediastreamer/msfifo.c Thu May 11 00:03:06 2006
|
||||
@@ -54,7 +54,6 @@
|
||||
MSBuffer *buf;
|
||||
gint saved_offset=MAX(r_gran+r_offset,w_offset);
|
||||
gint fifo_size;
|
||||
- gint tmp;
|
||||
if (min_fifo_size==0) min_fifo_size=w_gran;
|
||||
|
||||
/* we must allocate a fifo with a size multiple of min_fifo_size,
|
||||
@@ -90,7 +89,7 @@
|
||||
if (bsize>fifo->readsize)
|
||||
{
|
||||
ms_trace("Not enough data: bsize=%i, readsize=%i",bsize,fifo->readsize);
|
||||
- return (-ENODATA);
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
rnext=fifo->rd_ptr+bsize;
|
||||
@@ -123,7 +122,7 @@
|
||||
/* fix readsize and writesize */
|
||||
fifo->readsize-=unwritten;
|
||||
fifo->writesize+=unwritten;
|
||||
|
@ -9,3 +26,12 @@
|
|||
}
|
||||
|
||||
gint ms_fifo_get_write_ptr(MSFifo *fifo, gint bsize, void **ret_ptr)
|
||||
@@ -137,7 +136,7 @@
|
||||
{
|
||||
ms_trace("Not enough space: bsize=%i, writesize=%i",bsize,fifo->writesize);
|
||||
*ret_ptr=NULL;
|
||||
- return(-ENODATA);
|
||||
+ return -1;
|
||||
}
|
||||
wnext=fifo->wr_ptr+bsize;
|
||||
if (wnext<=fifo->w_end){
|
||||
|
|
|
@ -1,6 +1,23 @@
|
|||
--- ./talk/third_party/mediastreamer/msrtprecv.c.orig Thu Mar 16 18:43:06 2006
|
||||
+++ ./talk/third_party/mediastreamer/msrtprecv.c Fri Apr 21 10:56:34 2006
|
||||
@@ -70,6 +70,8 @@
|
||||
+++ ./talk/third_party/mediastreamer/msrtprecv.c Thu May 11 00:07:00 2006
|
||||
@@ -29,15 +29,10 @@
|
||||
if (mp->b_datap->ref_count!=1) return NULL; /* cannot handle properly non-unique buffers*/
|
||||
/* create a MSBuffer using the mblk_t buffer */
|
||||
msg=ms_message_alloc();
|
||||
- msbuf=ms_buffer_alloc(0);
|
||||
- msbuf->buffer=mp->b_datap->db_base;
|
||||
- msbuf->size=(char*)mp->b_datap->db_lim-(char*)mp->b_datap->db_base;
|
||||
+ msbuf=ms_buffer_new_with_buf(mp->b_datap->db_base,mp->b_datap->db_lim-mp->b_datap->db_base,freemsg,mp);
|
||||
ms_message_set_buf(msg,msbuf);
|
||||
msg->size=mp->b_wptr-mp->b_rptr;
|
||||
msg->data=mp->b_rptr;
|
||||
- /* free the mblk_t */
|
||||
- g_free(mp->b_datap);
|
||||
- g_free(mp);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -70,6 +65,8 @@
|
||||
memset(r->q_outputs,0,sizeof(MSFifo*)*MSRTPRECV_MAX_OUTPUTS);
|
||||
r->rtpsession=NULL;
|
||||
r->stream_started=0;
|
||||
|
@ -9,7 +26,7 @@
|
|||
}
|
||||
|
||||
void ms_rtp_recv_class_init(MSRtpRecvClass *klass)
|
||||
@@ -120,7 +122,7 @@
|
||||
@@ -120,7 +117,7 @@
|
||||
gint got=0;
|
||||
/* we are connected with queues (surely for video)*/
|
||||
/* use the sync system time to compute a timestamp */
|
||||
|
@ -18,7 +35,7 @@
|
|||
if (pt==NULL) {
|
||||
ms_warning("ms_rtp_recv_process(): NULL RtpPayload- skipping.");
|
||||
return;
|
||||
@@ -134,10 +136,16 @@
|
||||
@@ -134,10 +131,16 @@
|
||||
/*g_message("Got packet with timestamp %u",clock);*/
|
||||
got++;
|
||||
r->stream_started=1;
|
||||
|
@ -39,7 +56,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -147,10 +155,24 @@
|
||||
@@ -147,10 +150,24 @@
|
||||
g_free(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
guint32 clockts;
|
||||
/* use the sync system time to compute a timestamp */
|
||||
- PayloadType *pt=rtp_profile_get_payload(r->rtpsession->profile,r->rtpsession->payload_type);
|
||||
+ PayloadType *pt=rtp_profile_get_payload(r->rtpsession->profile,r->rtpsession->recv_pt);
|
||||
+ PayloadType *pt=rtp_profile_get_payload(r->rtpsession->profile,r->rtpsession->send_pt);
|
||||
g_return_val_if_fail(pt!=NULL,0);
|
||||
clockts=(guint32)(((double)synctime * (double)pt->clock_rate)/1000.0);
|
||||
ms_trace("ms_rtp_send_process: sync->time=%i clock=%i",synctime,clockts);
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
--- ./talk/third_party/mediastreamer/mstimer.c.orig Thu Mar 16 18:43:06 2006
|
||||
+++ ./talk/third_party/mediastreamer/mstimer.c Fri Apr 21 10:56:34 2006
|
||||
+++ ./talk/third_party/mediastreamer/mstimer.c Wed May 10 23:45:11 2006
|
||||
@@ -33,8 +33,8 @@
|
||||
ms_sync_init(MS_SYNC(sync));
|
||||
MS_SYNC(sync)->attached_filters=sync->filters;
|
||||
memset(sync->filters,0,MSTIMER_MAX_FILTERS*sizeof(MSFilter*));
|
||||
- MS_SYNC(sync)->samples_per_tick=160;
|
||||
- ms_timer_set_interval(sync,20);
|
||||
+ MS_SYNC(sync)->samples_per_tick=80;
|
||||
+ ms_timer_set_interval(sync,10);
|
||||
sync->state=MS_TIMER_STOPPED;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
else {
|
||||
gint32 diff,time;
|
||||
|
|
Loading…
Reference in a new issue