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
af0f7245
Commit
af0f7245
authored
13 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9903: cleanup
parent
3d56db32
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
+8
-18
8 additions, 18 deletions
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
daemon/src/audio/audiortp/audio_rtp_record_handler.h
+3
-3
3 additions, 3 deletions
daemon/src/audio/audiortp/audio_rtp_record_handler.h
with
11 additions
and
21 deletions
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
+
8
−
18
View file @
af0f7245
...
@@ -114,10 +114,6 @@ void AudioRtpRecordHandler::putDtmfEvent(int digit)
...
@@ -114,10 +114,6 @@ void AudioRtpRecordHandler::putDtmfEvent(int digit)
audioRtpRecord_
.
dtmfQueue_
.
push_back
(
digit
);
audioRtpRecord_
.
dtmfQueue_
.
push_back
(
digit
);
}
}
#ifdef DUMP_PROCESS_DATA_ENCODE
std
::
ofstream
teststream
(
"test_process_data_encode.raw"
);
#endif
int
AudioRtpRecordHandler
::
processDataEncode
()
int
AudioRtpRecordHandler
::
processDataEncode
()
{
{
SFLDataFormat
*
micData
=
audioRtpRecord_
.
decData_
;
SFLDataFormat
*
micData
=
audioRtpRecord_
.
decData_
;
...
@@ -150,15 +146,12 @@ int AudioRtpRecordHandler::processDataEncode()
...
@@ -150,15 +146,12 @@ int AudioRtpRecordHandler::processDataEncode()
if
(
Manager
::
instance
().
getEchoCancelState
())
if
(
Manager
::
instance
().
getEchoCancelState
())
echoCanceller
.
getData
(
micData
);
echoCanceller
.
getData
(
micData
);
#ifdef DUMP_PROCESS_DATA_ENCODE
teststream
.
write
(
reinterpret_cast
<
char
*>
(
micData
),
bytesToGet
);
#endif
SFLDataFormat
*
out
=
micData
;
SFLDataFormat
*
out
=
micData
;
if
(
codecSampleRate
!=
mainBufferSampleRate
)
{
if
(
codecSampleRate
!=
mainBufferSampleRate
)
{
out
=
micDataConverted
;
out
=
micDataConverted
;
audioRtpRecord_
.
converter_
->
resample
(
micData
,
micDataConverted
,
codecSampleRate
,
mainBufferSampleRate
,
samplesToGet
);
audioRtpRecord_
.
converter_
->
resample
(
micData
,
micDataConverted
,
codecSampleRate
,
mainBufferSampleRate
,
samplesToGet
);
}
}
if
(
Manager
::
instance
().
audioPreference
.
getNoiseReduce
())
{
if
(
Manager
::
instance
().
audioPreference
.
getNoiseReduce
())
{
...
@@ -166,16 +159,13 @@ int AudioRtpRecordHandler::processDataEncode()
...
@@ -166,16 +159,13 @@ int AudioRtpRecordHandler::processDataEncode()
audioRtpRecord_
.
noiseSuppress_
->
process
(
micData
,
getCodecFrameSize
());
audioRtpRecord_
.
noiseSuppress_
->
process
(
micData
,
getCodecFrameSize
());
}
}
int
compSize
;
{
{
ost
::
MutexLock
lock
(
audioRtpRecord_
.
audioCodecMutex_
);
ost
::
MutexLock
lock
(
audioRtpRecord_
.
audioCodecMutex_
);
compSize
=
audioRtpRecord_
.
audioCodec_
->
encode
(
micDataEncoded
,
out
,
getCodecFrameSize
());
return
audioRtpRecord_
.
audioCodec_
->
encode
(
micDataEncoded
,
out
,
getCodecFrameSize
());
}
}
return
compSize
;
}
}
void
AudioRtpRecordHandler
::
processDataDecode
(
unsigned
char
*
spkrData
,
unsigned
in
t
size
,
int
payloadType
)
void
AudioRtpRecordHandler
::
processDataDecode
(
unsigned
char
*
spkrData
,
size_
t
size
,
int
payloadType
)
{
{
if
(
getCodecPayloadType
()
!=
payloadType
)
if
(
getCodecPayloadType
()
!=
payloadType
)
return
;
return
;
...
@@ -216,13 +206,13 @@ void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, unsigned
...
@@ -216,13 +206,13 @@ void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, unsigned
Manager
::
instance
().
getMainBuffer
()
->
putData
(
out
,
outSamples
*
sizeof
(
SFLDataFormat
),
id_
);
Manager
::
instance
().
getMainBuffer
()
->
putData
(
out
,
outSamples
*
sizeof
(
SFLDataFormat
),
id_
);
}
}
void
AudioRtpRecordHandler
::
fadeIn
(
SFLDataFormat
*
audio
,
in
t
size
,
SFLDataFormat
*
factor
)
void
AudioRtpRecordHandler
::
fadeIn
(
SFLDataFormat
*
audio
,
size_
t
size
,
SFLDataFormat
*
factor
)
{
{
// if factor reach 0, this function should have no effect
// if factor reach
es
0, this function should have no effect
if
(
*
factor
<=
0
)
if
(
!
audio
or
!
factor
or
*
factor
<=
0
)
return
;
return
;
while
(
size
)
while
(
size
>
0
)
audio
[
--
size
]
/=
*
factor
;
audio
[
--
size
]
/=
*
factor
;
*
factor
/=
FADEIN_STEP_SIZE
;
*
factor
/=
FADEIN_STEP_SIZE
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/audio/audiortp/audio_rtp_record_handler.h
+
3
−
3
View file @
af0f7245
...
@@ -151,12 +151,12 @@ class AudioRtpRecordHandler {
...
@@ -151,12 +151,12 @@ class AudioRtpRecordHandler {
/**
/**
* Decode audio data received from peer
* Decode audio data received from peer
*/
*/
void
processDataDecode
(
unsigned
char
*
spkrData
,
unsigned
in
t
size
,
int
payloadType
);
void
processDataDecode
(
unsigned
char
*
spkrData
,
size_
t
size
,
int
payloadType
);
/**
/**
* Ramp In audio data to avoid audio click from peer
* Ramp In audio data to avoid audio click from peer
*/
*/
void
fadeIn
(
SFLDataFormat
*
audio
,
in
t
size
,
SFLDataFormat
*
factor
);
void
fadeIn
(
SFLDataFormat
*
audio
,
size_
t
size
,
SFLDataFormat
*
factor
);
void
setDtmfPayloadType
(
unsigned
int
payloadType
)
{
void
setDtmfPayloadType
(
unsigned
int
payloadType
)
{
audioRtpRecord_
.
dtmfPayloadType_
=
payloadType
;
audioRtpRecord_
.
dtmfPayloadType_
=
payloadType
;
...
...
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