New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2018-04-16 11:17:10 +02:00
|
|
|
#include <string.h>
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
#include <limits>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "common_audio/wav_header.h"
|
|
|
|
|
#include "test/gtest.h"
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
|
2014-12-16 20:17:21 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// Doesn't take ownership of the buffer.
|
|
|
|
|
class ReadableWavBuffer : public ReadableWav {
|
|
|
|
|
public:
|
|
|
|
|
ReadableWavBuffer(const uint8_t* buf, size_t size)
|
|
|
|
|
: buf_(buf),
|
|
|
|
|
size_(size),
|
|
|
|
|
pos_(0),
|
|
|
|
|
buf_exhausted_(false),
|
|
|
|
|
check_read_size_(true) {}
|
|
|
|
|
ReadableWavBuffer(const uint8_t* buf, size_t size, bool check_read_size)
|
|
|
|
|
: buf_(buf),
|
|
|
|
|
size_(size),
|
|
|
|
|
pos_(0),
|
|
|
|
|
buf_exhausted_(false),
|
|
|
|
|
check_read_size_(check_read_size) {}
|
|
|
|
|
|
2018-07-17 11:08:15 +02:00
|
|
|
~ReadableWavBuffer() override {
|
2014-12-16 20:17:21 +00:00
|
|
|
// Verify the entire buffer has been read.
|
|
|
|
|
if (check_read_size_)
|
|
|
|
|
EXPECT_EQ(size_, pos_);
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 11:08:15 +02:00
|
|
|
size_t Read(void* buf, size_t num_bytes) override {
|
2014-12-16 20:17:21 +00:00
|
|
|
// Verify we don't try to read outside of a properly sized header.
|
|
|
|
|
if (size_ >= kWavHeaderSize)
|
|
|
|
|
EXPECT_GE(size_, pos_ + num_bytes);
|
|
|
|
|
EXPECT_FALSE(buf_exhausted_);
|
|
|
|
|
|
|
|
|
|
const size_t bytes_remaining = size_ - pos_;
|
|
|
|
|
if (num_bytes > bytes_remaining) {
|
|
|
|
|
// The caller is signalled about an exhausted buffer when we return fewer
|
|
|
|
|
// bytes than requested. There should not be another read attempt after
|
|
|
|
|
// this point.
|
|
|
|
|
buf_exhausted_ = true;
|
|
|
|
|
num_bytes = bytes_remaining;
|
|
|
|
|
}
|
|
|
|
|
memcpy(buf, &buf_[pos_], num_bytes);
|
|
|
|
|
pos_ += num_bytes;
|
|
|
|
|
return num_bytes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
const uint8_t* buf_;
|
|
|
|
|
const size_t size_;
|
|
|
|
|
size_t pos_;
|
|
|
|
|
bool buf_exhausted_;
|
|
|
|
|
const bool check_read_size_;
|
|
|
|
|
};
|
|
|
|
|
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
// Try various choices of WAV header parameters, and make sure that the good
|
|
|
|
|
// ones are accepted and the bad ones rejected.
|
|
|
|
|
TEST(WavHeaderTest, CheckWavParameters) {
|
|
|
|
|
// Try some really stupid values for one parameter at a time.
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_TRUE(CheckWavParameters(1, 8000, kWavFormatPcm, 1, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(0, 8000, kWavFormatPcm, 1, 0));
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
EXPECT_FALSE(CheckWavParameters(0x10000, 8000, kWavFormatPcm, 1, 0));
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 0, kWavFormatPcm, 1, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, WavFormat(0), 1, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, kWavFormatPcm, 0, 0));
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
|
|
|
|
|
// Try invalid format/bytes-per-sample combinations.
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_TRUE(CheckWavParameters(1, 8000, kWavFormatPcm, 2, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, kWavFormatPcm, 4, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, kWavFormatALaw, 2, 0));
|
|
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, kWavFormatMuLaw, 2, 0));
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
|
|
|
|
|
// Too large values.
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_FALSE(CheckWavParameters(1 << 20, 1 << 20, kWavFormatPcm, 1, 0));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(CheckWavParameters(1, 8000, kWavFormatPcm, 1,
|
|
|
|
|
std::numeric_limits<uint32_t>::max()));
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
|
|
|
|
|
// Not the same number of samples for each channel.
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_FALSE(CheckWavParameters(3, 8000, kWavFormatPcm, 1, 5));
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-03 18:20:06 +00:00
|
|
|
TEST(WavHeaderTest, ReadWavHeaderWithErrors) {
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_channels = 0;
|
2014-10-31 21:51:03 +00:00
|
|
|
int sample_rate = 0;
|
2014-12-16 20:17:21 +00:00
|
|
|
WavFormat format = kWavFormatPcm;
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
size_t bytes_per_sample = 0;
|
|
|
|
|
size_t num_samples = 0;
|
2014-10-31 21:51:03 +00:00
|
|
|
|
|
|
|
|
// Test a few ways the header can be invalid. We start with the valid header
|
|
|
|
|
// used in WriteAndReadWavHeader, and invalidate one field per test. The
|
|
|
|
|
// invalid field is indicated in the array name, and in the comments with
|
|
|
|
|
// *BAD*.
|
2014-12-16 20:17:21 +00:00
|
|
|
{
|
|
|
|
|
static const uint8_t kBadRiffID[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'i', 'f', 'f', // *BAD*
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
16, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kBadRiffID, sizeof(kBadRiffID));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kBadBitsPerSample[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
16, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
1, 0, // bits per sample: *BAD*
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kBadBitsPerSample, sizeof(kBadBitsPerSample));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kBadByteRate[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
16, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0x00, 0x33, 0x03, 0, // byte rate: *BAD*
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kBadByteRate, sizeof(kBadByteRate));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kBadFmtHeaderSize[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
17, 0, 0, 0, // size of fmt block *BAD*. Only 16 and 18 permitted.
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
|
|
|
|
0, // extra (though invalid) header byte
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kBadFmtHeaderSize, sizeof(kBadFmtHeaderSize), false);
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kNonZeroExtensionField[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
18, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
|
|
|
|
1, 0, // non-zero extension field *BAD*
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kNonZeroExtensionField, sizeof(kNonZeroExtensionField),
|
|
|
|
|
false);
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kMissingDataChunk[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
16, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kMissingDataChunk, sizeof(kMissingDataChunk));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
static const uint8_t kMissingFmtAndDataChunks[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-12-16 20:17:21 +00:00
|
|
|
};
|
|
|
|
|
ReadableWavBuffer r(kMissingFmtAndDataChunks,
|
|
|
|
|
sizeof(kMissingFmtAndDataChunks));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_FALSE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
2014-12-16 20:17:21 +00:00
|
|
|
}
|
|
|
|
|
}
|
2014-10-31 21:51:03 +00:00
|
|
|
|
2014-12-16 20:17:21 +00:00
|
|
|
// Try writing and reading a valid WAV header and make sure it looks OK.
|
|
|
|
|
TEST(WavHeaderTest, WriteAndReadWavHeader) {
|
|
|
|
|
static const int kSize = 4 + kWavHeaderSize + 4;
|
|
|
|
|
uint8_t buf[kSize];
|
|
|
|
|
memset(buf, 0xa4, sizeof(buf));
|
|
|
|
|
WriteWavHeader(buf + 4, 17, 12345, kWavFormatALaw, 1, 123457689);
|
|
|
|
|
static const uint8_t kExpectedBuf[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
2014-12-16 20:17:21 +00:00
|
|
|
0xa4, 0xa4, 0xa4, 0xa4, // untouched bytes before header
|
2014-10-31 21:51:03 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
|
|
|
|
0xbd, 0xd0, 0x5b, 0x07, // size of whole file - 8: 123457689 + 44 - 8
|
|
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
|
|
|
|
16, 0, 0, 0, // size of fmt block - 8: 24 - 8
|
|
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
|
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
|
|
|
|
0xa4, 0xa4, 0xa4, 0xa4, // untouched bytes after header
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
2014-10-31 21:51:03 +00:00
|
|
|
};
|
2015-01-14 10:51:54 +00:00
|
|
|
static_assert(sizeof(kExpectedBuf) == kSize, "buffer size");
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_EQ(0, memcmp(kExpectedBuf, buf, kSize));
|
|
|
|
|
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_channels = 0;
|
2014-12-16 20:17:21 +00:00
|
|
|
int sample_rate = 0;
|
|
|
|
|
WavFormat format = kWavFormatPcm;
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
size_t bytes_per_sample = 0;
|
|
|
|
|
size_t num_samples = 0;
|
2014-12-16 20:17:21 +00:00
|
|
|
ReadableWavBuffer r(buf + 4, sizeof(buf) - 8);
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_TRUE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
EXPECT_EQ(17u, num_channels);
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_EQ(12345, sample_rate);
|
|
|
|
|
EXPECT_EQ(kWavFormatALaw, format);
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
EXPECT_EQ(1u, bytes_per_sample);
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_EQ(123457689u, num_samples);
|
2014-10-31 21:51:03 +00:00
|
|
|
}
|
|
|
|
|
|
2014-12-16 20:17:21 +00:00
|
|
|
// Try reading an atypical but valid WAV header and make sure it's parsed OK.
|
|
|
|
|
TEST(WavHeaderTest, ReadAtypicalWavHeader) {
|
|
|
|
|
static const uint8_t kBuf[] = {
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format off
|
|
|
|
|
// clang formatting doesn't respect inline comments.
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
'R', 'I', 'F', 'F',
|
2014-12-16 20:17:21 +00:00
|
|
|
0x3d, 0xd1, 0x5b, 0x07, // size of whole file - 8 + an extra 128 bytes of
|
|
|
|
|
// "metadata": 123457689 + 44 - 8 + 128. (atypical)
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
'W', 'A', 'V', 'E',
|
|
|
|
|
'f', 'm', 't', ' ',
|
2014-12-16 20:17:21 +00:00
|
|
|
18, 0, 0, 0, // size of fmt block (with an atypical extension size field)
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
6, 0, // format: A-law (6)
|
|
|
|
|
17, 0, // channels: 17
|
|
|
|
|
0x39, 0x30, 0, 0, // sample rate: 12345
|
|
|
|
|
0xc9, 0x33, 0x03, 0, // byte rate: 1 * 17 * 12345
|
|
|
|
|
17, 0, // block align: NumChannels * BytesPerSample
|
|
|
|
|
8, 0, // bits per sample: 1 * 8
|
2014-12-16 20:17:21 +00:00
|
|
|
0, 0, // zero extension size field (atypical)
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
'd', 'a', 't', 'a',
|
|
|
|
|
0x99, 0xd0, 0x5b, 0x07, // size of payload: 123457689
|
2018-06-19 15:03:05 +02:00
|
|
|
// clang-format on
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
};
|
2014-10-31 21:51:03 +00:00
|
|
|
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_channels = 0;
|
2014-10-31 21:51:03 +00:00
|
|
|
int sample_rate = 0;
|
2014-12-16 20:17:21 +00:00
|
|
|
WavFormat format = kWavFormatPcm;
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
size_t bytes_per_sample = 0;
|
|
|
|
|
size_t num_samples = 0;
|
2014-12-16 20:17:21 +00:00
|
|
|
ReadableWavBuffer r(kBuf, sizeof(kBuf));
|
2018-06-19 15:03:05 +02:00
|
|
|
EXPECT_TRUE(ReadWavHeader(&r, &num_channels, &sample_rate, &format,
|
|
|
|
|
&bytes_per_sample, &num_samples));
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
EXPECT_EQ(17u, num_channels);
|
2014-10-31 21:51:03 +00:00
|
|
|
EXPECT_EQ(12345, sample_rate);
|
2014-12-16 20:17:21 +00:00
|
|
|
EXPECT_EQ(kWavFormatALaw, format);
|
Misc. small cleanups.
* Better param names
* Avoid using negative values for (bogus) placeholder channel counts (mostly in tests). Since channels will be changing to size_t, negative values will be illegal; it's sufficient to use 0 in these cases.
* Use arraysize()
* Use size_t for counting frames, samples, blocks, buffers, and bytes -- most of these are already size_t in most places, this just fixes some stragglers
* reinterpret_cast<int64_t>(void*) is not necessarily safe; use uintptr_t instead
* Remove unnecessary code, e.g. dead code, needlessly long/repetitive code, or function overrides that exactly match the base definition
* Fix indenting
* Use uint32_t for timestamps (matching how it's already a uint32_t in most places)
* Spelling
* RTC_CHECK_EQ(expected, actual)
* Rewrap
* Use .empty()
* Be more pedantic about matching int/int32_t/
* Remove pointless consts on input parameters to functions
* Add missing sanity checks
All this was found in the course of constructing https://codereview.webrtc.org/1316523002/ , and is being landed separately first.
BUG=none
TEST=none
Review URL: https://codereview.webrtc.org/1534193008
Cr-Commit-Position: refs/heads/master@{#11191}
2016-01-08 13:50:27 -08:00
|
|
|
EXPECT_EQ(1u, bytes_per_sample);
|
2014-10-31 21:51:03 +00:00
|
|
|
EXPECT_EQ(123457689u, num_samples);
|
New utility class for easy debug dumping to WAV files
There are currently a number of places in the code where we dump audio
data in various stages of processing for debug purposes. Currently
these all write raw, uncompressed PCM files, which isn't supported by
the most common audio players, and requires the user to supply
metadata such as sample rate, sample size and endianness, etc.
This patch adds a simple class that makes it easy to write WAV files
instead. WAV files still contain the same uncompressed PCM data, but
they have a small header that contains all the requisite metadata, and
are supported by virtually all audio players.
Since some of the debug code that will be writing WAV files is written
in plain C, a C API is included as well.
R=andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16809004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6932 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-20 07:42:46 +00:00
|
|
|
}
|
2014-12-16 20:17:21 +00:00
|
|
|
|
|
|
|
|
} // namespace webrtc
|