Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
af0f7245
Commit
af0f7245
authored
Apr 20, 2012
by
Tristan Matthews
Browse files
* #9903: cleanup
parent
3d56db32
Changes
2
Hide whitespace changes
Inline
Side-by-side
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
View file @
af0f7245
...
...
@@ -114,10 +114,6 @@ void AudioRtpRecordHandler::putDtmfEvent(int digit)
audioRtpRecord_
.
dtmfQueue_
.
push_back
(
digit
);
}
#ifdef DUMP_PROCESS_DATA_ENCODE
std
::
ofstream
teststream
(
"test_process_data_encode.raw"
);
#endif
int
AudioRtpRecordHandler
::
processDataEncode
()
{
SFLDataFormat
*
micData
=
audioRtpRecord_
.
decData_
;
...
...
@@ -150,15 +146,12 @@ int AudioRtpRecordHandler::processDataEncode()
if
(
Manager
::
instance
().
getEchoCancelState
())
echoCanceller
.
getData
(
micData
);
#ifdef DUMP_PROCESS_DATA_ENCODE
teststream
.
write
(
reinterpret_cast
<
char
*>
(
micData
),
bytesToGet
);
#endif
SFLDataFormat
*
out
=
micData
;
if
(
codecSampleRate
!=
mainBufferSampleRate
)
{
out
=
micDataConverted
;
audioRtpRecord_
.
converter_
->
resample
(
micData
,
micDataConverted
,
codecSampleRate
,
mainBufferSampleRate
,
samplesToGet
);
audioRtpRecord_
.
converter_
->
resample
(
micData
,
micDataConverted
,
codecSampleRate
,
mainBufferSampleRate
,
samplesToGet
);
}
if
(
Manager
::
instance
().
audioPreference
.
getNoiseReduce
())
{
...
...
@@ -166,16 +159,13 @@ int AudioRtpRecordHandler::processDataEncode()
audioRtpRecord_
.
noiseSuppress_
->
process
(
micData
,
getCodecFrameSize
());
}
int
compSize
;
{
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
)
return
;
...
...
@@ -216,13 +206,13 @@ void AudioRtpRecordHandler::processDataDecode(unsigned char *spkrData, unsigned
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
<=
0
)
// if factor reach
es
0, this function should have no effect
if
(
!
audio
or
!
factor
or
*
factor
<=
0
)
return
;
while
(
size
)
while
(
size
>
0
)
audio
[
--
size
]
/=
*
factor
;
*
factor
/=
FADEIN_STEP_SIZE
;
...
...
daemon/src/audio/audiortp/audio_rtp_record_handler.h
View file @
af0f7245
...
...
@@ -151,12 +151,12 @@ class AudioRtpRecordHandler {
/**
* 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
*/
void
fadeIn
(
SFLDataFormat
*
audio
,
in
t
size
,
SFLDataFormat
*
factor
);
void
fadeIn
(
SFLDataFormat
*
audio
,
size_
t
size
,
SFLDataFormat
*
factor
);
void
setDtmfPayloadType
(
unsigned
int
payloadType
)
{
audioRtpRecord_
.
dtmfPayloadType_
=
payloadType
;
...
...
@@ -169,7 +169,7 @@ class AudioRtpRecordHandler {
void
putDtmfEvent
(
int
digit
);
protected:
AudioRtpRecord
audioRtpRecord_
;
AudioRtpRecord
audioRtpRecord_
;
private:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment