Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
a7d25038
Commit
a7d25038
authored
Aug 23, 2007
by
Alexandre Bourget
Browse files
Typos, cosmetics.
parent
ccc291eb
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/audio/audiortp.h
View file @
a7d25038
...
@@ -67,7 +67,7 @@ private:
...
@@ -67,7 +67,7 @@ private:
/** Buffer for 48000hz samples in conversion */
/** Buffer for 48000hz samples in conversion */
float32
*
_floatBuffer48000
;
float32
*
_floatBuffer48000
;
/** Buffer for 8000
h
z samples for mic conversion */
/** Buffer for 8000
H
z samples for mic conversion */
int16
*
_intBuffer8000
;
int16
*
_intBuffer8000
;
void
initAudioRtpSession
(
void
);
void
initAudioRtpSession
(
void
);
...
@@ -87,9 +87,9 @@ public:
...
@@ -87,9 +87,9 @@ public:
void
closeRtpSession
();
void
closeRtpSession
();
private:
private:
AudioRtpRTX
*
_RTXThread
;
AudioRtpRTX
*
_RTXThread
;
bool
_symmetric
;
bool
_symmetric
;
ost
::
Mutex
_threadMutex
;
ost
::
Mutex
_threadMutex
;
};
};
#endif // __AUDIO_RTP_H__
#endif // __AUDIO_RTP_H__
src/audio/ringbuffer.cpp
View file @
a7d25038
...
@@ -64,6 +64,7 @@ RingBuffer::debug() {
...
@@ -64,6 +64,7 @@ RingBuffer::debug() {
//
//
int
int
RingBuffer
::
AvailForPut
()
const
{
RingBuffer
::
AvailForPut
()
const
{
// Always keep 4 bytes safe (?)
return
(
mBufferSize
-
4
)
-
Len
();
return
(
mBufferSize
-
4
)
-
Len
();
}
}
...
@@ -84,19 +85,23 @@ RingBuffer::Put(void* buffer, int toCopy, unsigned short volume) {
...
@@ -84,19 +85,23 @@ RingBuffer::Put(void* buffer, int toCopy, unsigned short volume) {
copied
=
0
;
copied
=
0
;
pos
=
mEnd
;
pos
=
mEnd
;
//fprintf(stderr, "P");
while
(
toCopy
)
{
while
(
toCopy
)
{
block
=
toCopy
;
block
=
toCopy
;
if
(
block
>
(
mBufferSize
-
pos
))
{
// from current pos. to end of buffer
// Wrap block around ring ?
if
(
block
>
(
mBufferSize
-
pos
))
{
// Fill in to the end of the buffer
block
=
mBufferSize
-
pos
;
block
=
mBufferSize
-
pos
;
}
}
//
put the data inside the buffer.
//
Gain adjustment (when Mic vol. is changed)
if
(
volume
!=
100
)
{
if
(
volume
!=
100
)
{
SFLDataFormat
*
start
=
(
SFLDataFormat
*
)
src
;
SFLDataFormat
*
start
=
(
SFLDataFormat
*
)
src
;
int
nbSample
=
block
/
sizeof
(
SFLDataFormat
);
int
nbSample
=
block
/
sizeof
(
SFLDataFormat
);
for
(
int
i
=
0
;
i
<
nbSample
;
i
++
)
{
start
[
i
]
=
start
[
i
]
*
volume
/
100
;
}
for
(
int
i
=
0
;
i
<
nbSample
;
i
++
)
{
start
[
i
]
=
start
[
i
]
*
volume
/
100
;
}
}
}
// bcopy(src, dest, len)
// bcopy(src, dest, len)
//fprintf(stderr, "has %d put %d\t", len, block);
//fprintf(stderr, "has %d put %d\t", len, block);
bcopy
(
src
,
mBuffer
+
pos
,
block
);
bcopy
(
src
,
mBuffer
+
pos
,
block
);
...
...
src/global.h
View file @
a7d25038
...
@@ -44,7 +44,7 @@ typedef short int16;
...
@@ -44,7 +44,7 @@ typedef short int16;
#ifdef SFLDEBUG
#ifdef SFLDEBUG
#define _debug(...) fprintf(stderr, "[sfl-debug] " __VA_ARGS__)
#define _debug(...) fprintf(stderr, "[sfl-debug] " __VA_ARGS__)
#define _debugStart(...)
fprintf(stderr, "[sfl-debug] " __VA_ARGS__)
#define _debugStart(...) fprintf(stderr, "[sfl-debug] " __VA_ARGS__)
#define _debugMid(...) fprintf(stderr, __VA_ARGS__)
#define _debugMid(...) fprintf(stderr, __VA_ARGS__)
#define _debugEnd(...) fprintf(stderr, __VA_ARGS__)
#define _debugEnd(...) fprintf(stderr, __VA_ARGS__)
#define _debugException(...) fprintf(stderr, "[sfl-excep] " __VA_ARGS__ "\n")
#define _debugException(...) fprintf(stderr, "[sfl-excep] " __VA_ARGS__ "\n")
...
...
src/sipvoiplink.cpp
View file @
a7d25038
...
@@ -339,7 +339,7 @@ SIPVoIPLink::getEvent()
...
@@ -339,7 +339,7 @@ SIPVoIPLink::getEvent()
case
EXOSIP_SUBSCRIPTION_GLOBALFAILURE
:
/** 43 < announce a global failure */
case
EXOSIP_SUBSCRIPTION_GLOBALFAILURE
:
/** 43 < announce a global failure */
case
EXOSIP_SUBSCRIPTION_NOTIFY
:
/** 44 < announce new NOTIFY request */
case
EXOSIP_SUBSCRIPTION_NOTIFY
:
/** 44 < announce new NOTIFY request */
case
EXOSIP_SUBSCRIPTION_RELEASED
:
/** 45 < call context is cleared. */
case
EXOSIP_SUBSCRIPTION_RELEASED
:
/** 45 < call context is cleared. */
Manager
::
instance
().
displayError
(
" !EXOSIP Subscription respo
s
ne not implemented yet"
);
Manager
::
instance
().
displayError
(
" !EXOSIP Subscription respon
s
e not implemented yet
.
"
);
break
;
break
;
case
EXOSIP_IN_SUBSCRIPTION_NEW
:
/** 46 < announce new incoming SUBSCRIBE.*/
case
EXOSIP_IN_SUBSCRIPTION_NEW
:
/** 46 < announce new incoming SUBSCRIBE.*/
...
@@ -521,7 +521,7 @@ SIPVoIPLink::answer(const CallID& id)
...
@@ -521,7 +521,7 @@ SIPVoIPLink::answer(const CallID& id)
eXosip_lock
();
eXosip_lock
();
int
i
=
eXosip_call_build_answer
(
call
->
getTid
(),
SIP_OK
,
&
answerMessage
);
int
i
=
eXosip_call_build_answer
(
call
->
getTid
(),
SIP_OK
,
&
answerMessage
);
if
(
i
!=
0
)
{
if
(
i
!=
0
)
{
_debug
(
"< SIP Building Error: send 400 Bad Request
\n
"
);
_debug
(
"< SIP Building Error: send 400 Bad Request
\n
"
);
eXosip_call_send_answer
(
call
->
getTid
(),
SIP_BAD_REQUEST
,
NULL
);
eXosip_call_send_answer
(
call
->
getTid
(),
SIP_BAD_REQUEST
,
NULL
);
}
else
{
}
else
{
// use exosip, bug locked
// use exosip, bug locked
...
...
src/sipvoiplink.h
View file @
a7d25038
...
@@ -29,15 +29,16 @@ class EventThread;
...
@@ -29,15 +29,16 @@ class EventThread;
class
SIPCall
;
class
SIPCall
;
/**
/**
* Specific VoIPLink for SIP (SIP core for incoming and out
com
ing events)
* Specific VoIPLink for SIP (SIP core for incoming and out
go
ing events)
* @author Yan Morin <yan.morin@gmail.com>
* @author Yan Morin <yan.morin@gmail.com>
*/
*/
class
SIPVoIPLink
:
public
VoIPLink
class
SIPVoIPLink
:
public
VoIPLink
{
{
public:
public:
SIPVoIPLink
(
const
AccountID
&
accountID
);
SIPVoIPLink
(
const
AccountID
&
accountID
);
~
SIPVoIPLink
();
~
SIPVoIPLink
();
/** try to initiate the eXosip engine/thread and set config */
/** try to initiate the eXosip engine/thread and set config */
bool
init
(
void
);
bool
init
(
void
);
...
@@ -63,11 +64,20 @@ public:
...
@@ -63,11 +64,20 @@ public:
// SIP Specific
// SIP Specific
/** If set to true, we check for a firewall
/** If set to true, we check for a firewall
* @param use true if we use STUN
* @param use true if we use STUN
*/
*/
void
setUseStun
(
bool
use
)
{
_useStun
=
use
;
}
void
setUseStun
(
bool
use
)
{
_useStun
=
use
;
}
/** The name of the STUN server
* @param server Server FQDN/IP
*/
void
setStunServer
(
const
std
::
string
&
server
)
{
_stunServer
=
server
;
}
void
setStunServer
(
const
std
::
string
&
server
)
{
_stunServer
=
server
;
}
/** Set the SIP proxy
* @param proxy Proxy FQDN/IP
*/
void
setProxy
(
const
std
::
string
&
proxy
)
{
_proxy
=
proxy
;
}
void
setProxy
(
const
std
::
string
&
proxy
)
{
_proxy
=
proxy
;
}
void
setUserPart
(
const
std
::
string
&
userpart
)
{
_userpart
=
userpart
;
}
void
setUserPart
(
const
std
::
string
&
userpart
)
{
_userpart
=
userpart
;
}
void
setAuthName
(
const
std
::
string
&
authname
)
{
_authname
=
authname
;
}
void
setAuthName
(
const
std
::
string
&
authname
)
{
_authname
=
authname
;
}
...
@@ -234,8 +244,10 @@ private:
...
@@ -234,8 +244,10 @@ private:
EventThread
*
_evThread
;
EventThread
*
_evThread
;
/** Tell if eXosip was stared (eXosip_init) */
/** Tell if eXosip was stared (eXosip_init) */
bool
_eXosipStarted
;
bool
_eXosipStarted
;
/** Registration identifier, needed by unregister to build message */
/** Registration identifier, needed by unregister to build message */
int
_eXosipRegID
;
int
_eXosipRegID
;
/** Number of voicemail */
/** Number of voicemail */
int
_nMsgVoicemail
;
int
_nMsgVoicemail
;
...
@@ -244,17 +256,19 @@ private:
...
@@ -244,17 +256,19 @@ private:
/** Do we use stun? */
/** Do we use stun? */
bool
_useStun
;
bool
_useStun
;
/** What is the stun server? */
/** What is the stun server? */
std
::
string
_stunServer
;
std
::
string
_stunServer
;
/** Local Extern Address is the IP address seen
s
by peers for SIP listener */
/** Local Extern Address is the IP address seen by peers for SIP listener */
std
::
string
_localExternAddress
;
std
::
string
_localExternAddress
;
/** Local Extern Port is the port seen
s
by peers for SIP listener */
/** Local Extern Port is the port seen by peers for SIP listener */
unsigned
int
_localExternPort
;
unsigned
int
_localExternPort
;
/** SIP Proxy URL */
/** SIP Proxy URL */
std
::
string
_proxy
;
std
::
string
_proxy
;
/** SIP UserPart */
/** SIP UserPart */
std
::
string
_userpart
;
std
::
string
_userpart
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment