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
b4bc7ab8
Commit
b4bc7ab8
authored
Sep 10, 2013
by
Tristan Matthews
Browse files
* #29632: audiobuffer: make buffer size an explicit parameter
parent
6ad0780e
Changes
6
Hide whitespace changes
Inline
Side-by-side
daemon/src/audio/audiobuffer.h
View file @
b4bc7ab8
...
...
@@ -42,7 +42,7 @@ class AudioBuffer {
/**
* Default constructor.
*/
AudioBuffer
(
size_t
sample_num
=
0
,
unsigned
channel_num
=
1
,
int
sample_rate
=
8000
);
AudioBuffer
(
size_t
sample_num
,
unsigned
channel_num
=
1
,
int
sample_rate
=
8000
);
/**
* Construtor from existing interleaved data (copied into the buffer).
...
...
daemon/src/audio/audioloop.cpp
View file @
b4bc7ab8
...
...
@@ -46,7 +46,7 @@
AudioLoop
::
AudioLoop
(
unsigned
int
sampleRate
)
:
buffer_
(
0
),
pos_
(
0
)
{
buffer_
=
new
AudioBuffer
;
buffer_
=
new
AudioBuffer
(
0
)
;
buffer_
->
setSampleRate
(
sampleRate
);
}
...
...
daemon/src/audio/audiortp/audio_rtp_record_handler.cpp
View file @
b4bc7ab8
...
...
@@ -100,7 +100,7 @@ AudioRtpRecord::AudioRtpRecord() :
,
decoderPayloadType_
(
0
)
,
hasDynamicPayloadType_
(
false
)
,
decData_
(
DEC_BUFFER_SIZE
)
// std::tr1::arrays will be 0-initialized
,
resampledData_
()
,
resampledData_
(
0
)
,
encodedData_
()
,
converterEncode_
(
0
)
,
converterDecode_
(
0
)
...
...
daemon/src/audio/pulseaudio/pulselayer.cpp
View file @
b4bc7ab8
...
...
@@ -80,7 +80,7 @@ PulseLayer::PulseLayer(AudioPreference &pref)
,
ringtone_
(
0
)
,
sinkList_
()
,
sourceList_
()
,
mic_buffer_
()
,
mic_buffer_
(
0
)
,
context_
(
0
)
,
mainloop_
(
pa_threaded_mainloop_new
())
,
enumeratingSinks_
(
false
)
...
...
daemon/src/audio/sound/tone.cpp
View file @
b4bc7ab8
...
...
@@ -48,7 +48,7 @@ Tone::Tone(const std::string& definition, unsigned int sampleRate) :
{
fillWavetable
();
delete
buffer_
;
buffer_
=
new
AudioBuffer
();
buffer_
=
new
AudioBuffer
(
0
);
buffer_
->
setSampleRate
(
sampleRate
);
genBuffer
(
definition
);
// allocate memory with definition parameter
}
...
...
daemon/test/audiobuffertest.cpp
View file @
b4bc7ab8
...
...
@@ -42,7 +42,7 @@ void AudioBufferTest::testAudioBufferConstructors()
SFLAudioSample
test_samples1
[]
=
{};
SFLAudioSample
test_samples2
[]
=
{
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
};
AudioBuffer
empty_buf
;
AudioBuffer
empty_buf
(
0
)
;
CPPUNIT_ASSERT
(
empty_buf
.
samples
()
==
0
);
CPPUNIT_ASSERT
(
empty_buf
.
channels
()
==
1
);
CPPUNIT_ASSERT
(
empty_buf
.
getChannel
(
0
)
->
size
()
==
0
);
...
...
@@ -84,7 +84,7 @@ void AudioBufferTest::testAudioBufferMix()
test_buf1
.
setChannelNum
(
2
,
true
);
CPPUNIT_ASSERT
((
*
test_buf1
.
getChannel
(
1
))[
0
]
==
test_samples1
[
0
]);
AudioBuffer
test_buf2
;
AudioBuffer
test_buf2
(
0
)
;
test_buf2
.
deinterleave
(
test_samples2
,
3
,
3
);
CPPUNIT_ASSERT
((
*
test_buf2
.
getChannel
(
0
))[
2
]
==
test_samples2
[
6
]);
CPPUNIT_ASSERT
((
*
test_buf2
.
getChannel
(
1
))[
1
]
==
test_samples2
[
4
]);
...
...
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