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
56371288
Commit
56371288
authored
14 years ago
by
asavard
Browse files
Options
Downloads
Patches
Plain Diff
[#4367] Fix g722 codec clock rate
parent
e71e1ec9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
+12
-4
12 additions, 4 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+7
-2
7 additions, 2 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.h
with
19 additions
and
6 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
+
12
−
4
View file @
56371288
...
...
@@ -111,8 +111,8 @@ void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec)
bool
dynamic
=
getHasDynamicPayload
();
// G722 requires timestamp to be incremented at 8 kHz
if
(
payloadType
==
9
)
_timestampIncrement
=
160
;
if
(
payloadType
==
g722PayloadType
)
_timestampIncrement
=
g722RtpTimeincrement
;
else
_timestampIncrement
=
frameSize
;
...
...
@@ -122,9 +122,9 @@ void AudioRtpSession::setSessionMedia (AudioCodec* audioCodec)
_debug
(
"AudioRtpSession: RTP timestamp increment: %d"
,
_timestampIncrement
);
// Even if specified as a 16 kHz codec, G722 requires rtp sending rate to be 8 kHz
if
(
payloadType
==
9
)
{
if
(
payloadType
==
g722PayloadType
)
{
_debug
(
"AudioRtpSession: Setting G722 payload format"
);
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
payloadType
,
smpl
Rate
));
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
payloadType
,
g722RtpClock
Rate
));
}
else
if
(
dynamic
)
{
_debug
(
"AudioRtpSession: Setting dynamic payload format"
);
setPayloadFormat
(
ost
::
DynamicPayloadFormat
(
(
ost
::
PayloadType
)
payloadType
,
smplRate
));
...
...
@@ -243,6 +243,14 @@ void AudioRtpSession::sendMicData()
if
(
!
compSize
)
return
;
// Reset timestamp to make sure the timing information are up to date
/*
if (_timestampCount > RTP_TIMESTAMP_RESET_FREQ) {
_timestamp = getCurrentTimestamp();
_timestampCount = 0;
}
*/
// Increment timestamp for outgoing packet
_timestamp
+=
_timestampIncrement
;
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+
7
−
2
View file @
56371288
...
...
@@ -57,8 +57,13 @@
namespace
sfl
{
// class AudioRtpSession : public ost::Thread, public ost::TimerPort, public AudioRtpRecordHandler, public ost::SymmetricRTPSession
// class AudioRtpSession : public ost::Thread, public ost::TimerPort, public ost::SymmetricRTPSession, public AudioRtpRecordHandler
// G.722 VoIP is typically carried in RTP payload type 9.[2] Note that IANA records the clock rate for type 9 G.722 as 8 kHz
// (instead of 16 kHz), RFC3551[3] clarifies that this is due to a historical error and is retained in order to maintain backward
// compatibility. Consequently correct implementations represent the value 8,000 where required but encode and decode audio at 16 kHz.
static
const
int
g722PayloadType
=
9
;
static
const
int
g722RtpClockRate
=
8000
;
static
const
int
g722RtpTimeincrement
=
160
;
class
AudioRtpSession
:
protected
ost
::
Thread
,
public
ost
::
TimerPort
,
public
AudioRtpRecordHandler
,
public
ost
::
TRTPSessionBase
<
ost
::
DualRTPUDPIPv4Channel
,
ost
::
DualRTPUDPIPv4Channel
,
ost
::
AVPQueue
>
{
public:
...
...
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