Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
97e587ad
Commit
97e587ad
authored
Aug 30, 2006
by
yanmorin
Browse files
*** empty log message ***
parent
f8cdc96f
Changes
3
Show whitespace changes
Inline
Side-by-side
src/audio/audiolayer.cpp
View file @
97e587ad
...
...
@@ -411,6 +411,7 @@ AudioLayer::audioCallback (const void *inputBuffer, void *outputBuffer,
// Additionally handle the mic's audio stream
micAvailPut
=
_micRingBuffer
.
AvailForPut
();
toPut
=
(
micAvailPut
<=
(
int
)(
framesPerBuffer
*
sizeof
(
SFLDataFormat
)))
?
micAvailPut
:
framesPerBuffer
*
sizeof
(
SFLDataFormat
);
//_debug("AL: Nb sample: %d char, [0]=%f [1]=%f [2]=%f\n", toPut, in[0], in[1], in[2]);
_micRingBuffer
.
Put
(
in
,
toPut
,
micVolume
);
return
paContinue
;
...
...
src/audio/audiortp.cpp
View file @
97e587ad
...
...
@@ -234,12 +234,12 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
// 3. encode it
// 4. send it
try
{
if
(
_ca
==
0
)
{
return
;
}
// no call, so we do nothing
if
(
_ca
==
0
)
{
_debug
(
" !ARTP: No call associated (mic)
\n
"
);
return
;
}
// no call, so we do nothing
AudioLayer
*
audiolayer
=
Manager
::
instance
().
getAudioDriver
();
if
(
!
audiolayer
)
{
return
;
}
if
(
!
audiolayer
)
{
_debug
(
" !ARTP: No audiolayer available for mic
\n
"
);
return
;
}
AudioCodec
*
audiocodec
=
_ca
->
getAudioCodec
();
if
(
!
audiocodec
)
{
return
;
}
if
(
!
audiocodec
)
{
_debug
(
" !ARTP: No audiocodec available for mic
\n
"
);
return
;
}
// we have to get 20ms of data from the mic *20/1000 = /50
// rate/50 shall be lower than RTP_20S_48KHZ_MAX
...
...
@@ -250,6 +250,7 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
// take the lower
int
bytesAvail
=
(
availBytesFromMic
<
maxBytesToGet
)
?
availBytesFromMic
:
maxBytesToGet
;
//_debug("available = %d, maxBytesToGet = %d\n", availBytesFromMic, maxBytesToGet);
// Get bytes from micRingBuffer to data_from_mic
int
nbSample
=
audiolayer
->
getMic
(
_dataAudioLayer
,
bytesAvail
)
/
sizeof
(
SFLDataFormat
);
...
...
@@ -289,8 +290,9 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
//_debug("begin: %p, nbSample: %d\n", toSIP, nbSample);
//_debug("has to fill: %d chars at %p\n", (RTP_20S_8KHZ_MAX-nbSample)*sizeof(int16), toSIP + nbSample);
memset
(
toSIP
+
nbSample
,
0
,
(
RTP_20S_8KHZ_MAX
-
nbSample
)
*
sizeof
(
int16
));
//
nbSample = RTP_20S_8KHZ_MAX;
nbSample
=
RTP_20S_8KHZ_MAX
;
}
//_debug("AR: Nb sample: %d int, [0]=%d [1]=%d [2]=%d\n", nbSample, toSIP[0], toSIP[1], toSIP[2]);
// for the mono: range = 0 to RTP_FRAME2SEND * sizeof(int16)
// codecEncode(char *dest, int16* src, size in bytes of the src)
...
...
src/global.h
View file @
97e587ad
...
...
@@ -58,8 +58,8 @@ typedef short int16;
#define _debugInit(...)
#endif
#define SFLPHONED_VERSION "0.
6.3
"
#define SFLPHONED_VERSIONNUM 0x000
603
#define SFLPHONED_VERSION "0.
7.0
"
#define SFLPHONED_VERSIONNUM 0x000
700
#define PROGNAME "sflphoned"
#define PROGNAME_GLOBAL "sflphone"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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