Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
75c9eab2
Commit
75c9eab2
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2929] Cleanup debug messages in Audio Rtp
parent
100cb622
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+39
-34
39 additions, 34 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.h
with
39 additions
and
34 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+
39
−
34
View file @
75c9eab2
...
@@ -249,7 +249,7 @@ namespace sfl {
...
@@ -249,7 +249,7 @@ namespace sfl {
template
<
typename
D
>
template
<
typename
D
>
AudioRtpSession
<
D
>::~
AudioRtpSession
()
AudioRtpSession
<
D
>::~
AudioRtpSession
()
{
{
_debug
(
"R
tp
: Delete AudioRtpSession instance"
);
_debug
(
"R
TP
: Delete AudioRtpSession instance"
);
try
{
try
{
terminate
();
terminate
();
...
@@ -273,11 +273,9 @@ namespace sfl {
...
@@ -273,11 +273,9 @@ namespace sfl {
void
AudioRtpSession
<
D
>::
initBuffers
()
void
AudioRtpSession
<
D
>::
initBuffers
()
{
{
// Set sampling rate, main buffer choose the highest one
// Set sampling rate, main buffer choose the highest one
// _audiolayer->getMainBuffer()->setInternalSamplingRate(_codecSampleRate);
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
setInternalSamplingRate
(
_codecSampleRate
);
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
setInternalSamplingRate
(
_codecSampleRate
);
// may be different than one already setted
// may be different than one already setted
// converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate();
_converterSamplingRate
=
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
getInternalSamplingRate
();
_converterSamplingRate
=
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
getInternalSamplingRate
();
// initialize SampleRate converter using AudioLayer's sampling rate
// initialize SampleRate converter using AudioLayer's sampling rate
...
@@ -311,28 +309,33 @@ namespace sfl {
...
@@ -311,28 +309,33 @@ namespace sfl {
{
{
assert
(
_ca
);
assert
(
_ca
);
_debug
(
"RTP: Get audio codec for call %s"
,
_ca
->
getCallId
().
c_str
());
AudioCodecType
pl
=
(
AudioCodecType
)
_ca
->
getLocalSDP
()
->
get_session_media
()
->
getPayload
();
AudioCodecType
pl
=
(
AudioCodecType
)
_ca
->
getLocalSDP
()
->
get_session_media
()
->
getPayload
();
_audiocodec
=
_manager
->
getCodecDescriptorMap
().
instantiateCodec
(
pl
);
_audiocodec
=
_manager
->
getCodecDescriptorMap
().
instantiateCodec
(
pl
);
if
(
_audiocodec
==
NULL
)
{
if
(
!
_audiocodec
)
{
_
debug
(
"
No audiocodec, can't init RTP media"
);
_
error
(
"RTP: Error:
No audiocodec, can't init RTP media"
);
throw
AudioRtpSessionException
();
throw
AudioRtpSessionException
();
}
}
_debug
(
"
Init audio RTP session:
codec payload %i"
,
_audiocodec
->
getPayload
());
_debug
(
"
RTP: Init
codec payload %i"
,
_audiocodec
->
getPayload
());
_codecSampleRate
=
_audiocodec
->
getClockRate
();
_codecSampleRate
=
_audiocodec
->
getClockRate
();
_codecFrameSize
=
_audiocodec
->
getFrameSize
();
_codecFrameSize
=
_audiocodec
->
getFrameSize
();
_debug
(
"RTP: Codec sampling rate: %d"
,
_codecSampleRate
);
_debug
(
"RTP: Codec frame size: %d"
,
_codecFrameSize
);
//TODO: figure out why this is necessary.
//TODO: figure out why this is necessary.
if
(
_audiocodec
->
getPayload
()
==
9
)
{
if
(
_audiocodec
->
getPayload
()
==
9
)
{
_debug
(
"Setting payload format to G722"
);
_debug
(
"
RTP:
Setting payload format to G722"
);
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
_audiocodec
->
getPayload
(),
_audiocodec
->
getClockRate
()));
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
_audiocodec
->
getPayload
(),
_audiocodec
->
getClockRate
()));
}
else
if
(
_audiocodec
->
hasDynamicPayload
())
{
}
else
if
(
_audiocodec
->
hasDynamicPayload
())
{
_debug
(
"Setting a dynamic payload format"
);
_debug
(
"
RTP:
Setting a dynamic payload format"
);
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
_audiocodec
->
getPayload
(),
_audiocodec
->
getClockRate
()));
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
_audiocodec
->
getPayload
(),
_audiocodec
->
getClockRate
()));
}
else
if
(
!
_audiocodec
->
hasDynamicPayload
()
&&
_audiocodec
->
getPayload
()
!=
9
)
{
}
else
if
(
!
_audiocodec
->
hasDynamicPayload
()
&&
_audiocodec
->
getPayload
()
!=
9
)
{
_debug
(
"Setting a static payload format"
);
_debug
(
"
RTP:
Setting a static payload format"
);
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
StaticPayloadFormat
(
(
ost
::
StaticPayloadType
)
_audiocodec
->
getPayload
()));
static_cast
<
D
*>
(
this
)
->
setPayloadFormat
(
ost
::
StaticPayloadFormat
(
(
ost
::
StaticPayloadType
)
_audiocodec
->
getPayload
()));
}
}
}
}
...
@@ -341,7 +344,7 @@ namespace sfl {
...
@@ -341,7 +344,7 @@ namespace sfl {
void
AudioRtpSession
<
D
>::
setDestinationIpAddress
(
void
)
void
AudioRtpSession
<
D
>::
setDestinationIpAddress
(
void
)
{
{
if
(
_ca
==
NULL
)
{
if
(
_ca
==
NULL
)
{
_
warn
(
"R
tp
: Sipcall is gone."
);
_
error
(
"R
TP
: Sipcall is gone."
);
throw
AudioRtpSessionException
();
throw
AudioRtpSessionException
();
}
}
...
@@ -351,7 +354,7 @@ namespace sfl {
...
@@ -351,7 +354,7 @@ namespace sfl {
_remote_ip
=
ost
::
InetHostAddress
(
_ca
->
getLocalSDP
()
->
get_remote_ip
().
c_str
());
_remote_ip
=
ost
::
InetHostAddress
(
_ca
->
getLocalSDP
()
->
get_remote_ip
().
c_str
());
if
(
!
_remote_ip
)
{
if
(
!
_remote_ip
)
{
_warn
(
"R
tp
: Target IP address (%s) is not correct!"
,
_warn
(
"R
TP
: Target IP address (%s) is not correct!"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
());
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
());
return
;
return
;
}
}
...
@@ -363,7 +366,7 @@ namespace sfl {
...
@@ -363,7 +366,7 @@ namespace sfl {
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
(),
_remote_port
);
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
(),
_remote_port
);
if
(
!
static_cast
<
D
*>
(
this
)
->
addDestination
(
_remote_ip
,
_remote_port
))
{
if
(
!
static_cast
<
D
*>
(
this
)
->
addDestination
(
_remote_ip
,
_remote_port
))
{
_warn
(
"R
tp
: Can't add new destination to session!"
);
_warn
(
"R
TP
: Can't add new destination to session!"
);
return
;
return
;
}
}
}
}
...
@@ -375,7 +378,7 @@ namespace sfl {
...
@@ -375,7 +378,7 @@ namespace sfl {
// This method remove the current destination entry
// This method remove the current destination entry
if
(
!
static_cast
<
D
*>
(
this
)
->
forgetDestination
(
_remote_ip
,
_remote_port
,
_remote_port
+
1
))
if
(
!
static_cast
<
D
*>
(
this
)
->
forgetDestination
(
_remote_ip
,
_remote_port
,
_remote_port
+
1
))
_warn
(
"R
tp
: Could not remove previous destination"
);
_warn
(
"R
TP
: Could not remove previous destination"
);
// new destination is stored in call
// new destination is stored in call
// we just need to recall this method
// we just need to recall this method
...
@@ -619,7 +622,7 @@ namespace sfl {
...
@@ -619,7 +622,7 @@ namespace sfl {
template
<
typename
D
>
template
<
typename
D
>
int
AudioRtpSession
<
D
>::
startRtpThread
()
int
AudioRtpSession
<
D
>::
startRtpThread
()
{
{
_debug
(
"Starting main thread"
);
_debug
(
"
RTP:
Starting main thread"
);
return
start
(
_mainloopSemaphore
);
return
start
(
_mainloopSemaphore
);
}
}
...
@@ -638,16 +641,17 @@ namespace sfl {
...
@@ -638,16 +641,17 @@ namespace sfl {
int
sessionWaiting
;
int
sessionWaiting
;
int
threadSleep
=
0
;
int
threadSleep
=
0
;
if
(
_codecSampleRate
!=
0
)
if
(
_codecSampleRate
!=
0
){
{
threadSleep
=
(
_codecFrameSize
*
1000
)
/
_codecSampleRate
;
}
threadSleep
=
(
_codecFrameSize
*
1000
)
/
_codecSampleRate
;
else
}
{
threadSleep
=
_layerFrameSize
;
}
else
{
threadSleep
=
_layerFrameSize
;
}
TimerPort
::
setTimer
(
threadSleep
);
TimerPort
::
setTimer
(
threadSleep
);
if
(
_audiolayer
==
NULL
)
{
if
(
_audiolayer
==
NULL
)
{
_debug
(
"For some unknown reason, audiolayer is null, just as \
_error
(
"RTP: Error: Audiolayer is null, cannot start the audio stream"
);
we were about to start the audio stream"
);
throw
AudioRtpSessionException
();
throw
AudioRtpSessionException
();
}
}
...
@@ -658,7 +662,7 @@ namespace sfl {
...
@@ -658,7 +662,7 @@ namespace sfl {
static_cast
<
D
*>
(
this
)
->
startRunning
();
static_cast
<
D
*>
(
this
)
->
startRunning
();
_debug
(
"Entering
RTP
mainloop for call
id
%s"
,
_ca
->
getCallId
().
c_str
());
_debug
(
"
RTP:
Entering mainloop for call %s"
,
_ca
->
getCallId
().
c_str
());
while
(
!
testCancel
())
{
while
(
!
testCancel
())
{
...
@@ -667,11 +671,12 @@ namespace sfl {
...
@@ -667,11 +671,12 @@ namespace sfl {
_manager
->
getAudioLayerMutex
()
->
enter
();
_manager
->
getAudioLayerMutex
()
->
enter
();
// converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate();
// converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate();
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
getInternalSamplingRate
();
_converterSamplingRate
=
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
getInternalSamplingRate
();
// Send session
sessionWaiting
=
static_cast
<
D
*>
(
this
)
->
isWaiting
();
sessionWaiting
=
static_cast
<
D
*>
(
this
)
->
isWaiting
();
// Send session
if
(
_eventQueue
.
size
()
>
0
)
{
if
(
_eventQueue
.
size
()
>
0
)
{
sendDtmfEvent
(
_eventQueue
.
front
());
sendDtmfEvent
(
_eventQueue
.
front
());
}
}
...
@@ -698,7 +703,7 @@ namespace sfl {
...
@@ -698,7 +703,7 @@ namespace sfl {
TimerPort
::
incTimer
(
threadSleep
);
TimerPort
::
incTimer
(
threadSleep
);
}
}
_debug
(
"Left
RTP
main loop for call
id
%s"
,
_ca
->
getCallId
().
c_str
());
_debug
(
"
RTP:
Left main loop for call%s"
,
_ca
->
getCallId
().
c_str
());
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment