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
b4390a3f
Commit
b4390a3f
authored
14 years ago
by
asavard
Browse files
Options
Downloads
Patches
Plain Diff
[#4367] Refactor mic data encoding in rtp session
parent
00fc6a21
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/AudioRtpRecordHandler.cpp
+6
-12
6 additions, 12 deletions
sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
+4
-7
4 additions, 7 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
with
10 additions
and
19 deletions
sflphone-common/src/audio/audiortp/AudioRtpRecordHandler.cpp
+
6
−
12
View file @
b4390a3f
...
...
@@ -405,26 +405,19 @@ int AudioRtpRecordHandler::processDataEncode(void)
float
fixedCodecFramesize
=
computeCodecFrameSize
(
getCodecFrameSize
(),
getCodecSampleRate
());
// compute nb of byte to get coresponding to 20 ms at audio layer frame size (44.1 khz)
int
maxBytesToGet
=
computeNbByteAudioLayer
(
fixedCodecFramesize
);
int
bytesToGet
=
computeNbByteAudioLayer
(
fixedCodecFramesize
);
_debug
(
" byte to get %d"
,
bytesToGet
);
// available bytes inside ringbuffer
int
availBytesFromMic
=
audioLayer
->
getMainBuffer
()
->
availForGet
(
_ca
->
getCallId
());
_debug
(
" avail byte from mic %d"
,
availBytesFromMic
);
if
(
!
(
availBytesFromMic
>
320
)
)
if
(
availBytesFromMic
<
bytesToGet
)
return
0
;
// set available byte to maxByteToGet
int
bytesAvail
=
(
availBytesFromMic
<
maxBytesToGet
)
?
availBytesFromMic
:
maxBytesToGet
;
if
(
bytesAvail
==
0
){
memset
(
micDataEncoded
,
0
,
sizeof
(
SFLDataFormat
));
return
getCodecFrameSize
();
}
// Get bytes from micRingBuffer to data_from_mic
// int nbSample = audioLayer->getMainBuffer()->getData(micData, bytesAvail, 100, _ca->getCallId()) / sizeof (SFLDataFormat);
int
nbSample
=
audioLayer
->
getMainBuffer
()
->
getData
(
micData
,
320
,
100
,
_ca
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
int
nbSample
=
audioLayer
->
getMainBuffer
()
->
getData
(
micData
,
bytesToGet
,
100
,
_ca
->
getCallId
())
/
sizeof
(
SFLDataFormat
);
// process mic fade in
if
(
!
_audioRtpRecord
.
getMicFadeInComplete
())
...
...
@@ -453,6 +446,7 @@ int AudioRtpRecordHandler::processDataEncode(void)
// no resampling required
compSize
=
audioCodec
->
codecEncode
(
micDataEncoded
,
micData
,
nbSample
*
sizeof
(
SFLDataFormat
));
}
return
compSize
;
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/audio/audiortp/AudioRtpSession.cpp
+
4
−
7
View file @
b4390a3f
...
...
@@ -235,7 +235,7 @@ bool AudioRtpSession::onRTPPacketRecv (ost::IncomingRTPPkt&)
void
AudioRtpSession
::
sendMicData
()
{
//
_debug("============== sendMicData ===============");
_debug
(
"============== sendMicData ==============="
);
int
compSize
=
processDataEncode
();
...
...
@@ -246,8 +246,8 @@ void AudioRtpSession::sendMicData()
// Increment timestamp for outgoing packet
_timestamp
+=
_timestampIncrement
;
//
_debug(" compSize: %d", compSize);
//
_debug(" timestamp: %d", _timestamp);
_debug
(
" compSize: %d"
,
compSize
);
_debug
(
" timestamp: %d"
,
_timestamp
);
// putData put the data on RTP queue, sendImmediate bypass this queue
putData
(
_timestamp
,
getMicDataEncoded
(),
compSize
);
...
...
@@ -357,10 +357,7 @@ void AudioRtpSession::run ()
sendMicData
();
}
// Recv session
// TODO should not be called here anymore
// receiveSpeakerData ();
// This also should be moved
notifyIncomingCall
();
_manager
->
getAudioLayerMutex
()
->
leave
();
...
...
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