Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Unified Diff: remoting/host/audio_capturer_win.cc

Issue 10827324: Changed AudioPacket data to a repeated field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/audio_capturer_win.cc
diff --git a/remoting/host/audio_capturer_win.cc b/remoting/host/audio_capturer_win.cc
index b450a9a543e770582de73cfc94e0c95800b49e33..ed83e9156854cc07210907a23e2a943bf774d7db 100644
--- a/remoting/host/audio_capturer_win.cc
+++ b/remoting/host/audio_capturer_win.cc
@@ -275,7 +275,7 @@ void AudioCapturerWin::DoCapture() {
}
scoped_ptr<AudioPacket> packet = scoped_ptr<AudioPacket>(new AudioPacket());
- packet->set_data(data, frames * wave_format_ex_->nBlockAlign);
+ packet->add_data(data, frames * wave_format_ex_->nBlockAlign);
packet->set_sampling_rate(sampling_rate_);
packet->set_bytes_per_sample(
static_cast<AudioPacket::BytesPerSample>(sizeof(int16)));
@@ -298,8 +298,10 @@ void AudioCapturerWin::DoCapture() {
bool AudioCapturerWin::IsPacketOfSilence(const AudioPacket* packet) {
Sergey Ulanov 2012/08/14 18:50:05 Maybe change this method to look at raw data inste
kxing 2012/08/14 20:56:15 Done.
DCHECK_EQ(static_cast<AudioPacket::BytesPerSample>(sizeof(int16)),
packet->bytes_per_sample());
- const int16* data = reinterpret_cast<const int16*>(packet->data().data());
- int number_of_samples = packet->data().size() * kBitsPerByte / kBitsPerSample;
+ DCHECK_EQ(1, packet->data_size());
+ const int16* data = reinterpret_cast<const int16*>(packet->data(0).data());
+ int number_of_samples =
+ packet->data(0).size() * kBitsPerByte / kBitsPerSample;
for (int i = 0; i < number_of_samples; i++) {
if (abs(data[i]) > kSilenceThreshold)

Powered by Google App Engine
This is Rietveld 408576698