OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This test generate synthetic data. For audio it's a sinusoid waveform with | 5 // This test generate synthetic data. For audio it's a sinusoid waveform with |
6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern | 6 // frequency kSoundFrequency and different amplitudes. For video it's a pattern |
7 // that is shifting by one pixel per frame, each pixels neighbors right and down | 7 // that is shifting by one pixel per frame, each pixels neighbors right and down |
8 // is this pixels value +1, since the pixel value is 8 bit it will wrap | 8 // is this pixels value +1, since the pixel value is 8 bit it will wrap |
9 // frequently within the image. Visually this will create diagonally color bands | 9 // frequently within the image. Visually this will create diagonally color bands |
10 // that moves across the screen | 10 // that moves across the screen |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 static const int kAudioFrameDurationMs = 10; | 75 static const int kAudioFrameDurationMs = 10; |
76 | 76 |
77 // The amount of time between frame capture on the sender and playout on the | 77 // The amount of time between frame capture on the sender and playout on the |
78 // receiver. | 78 // receiver. |
79 static const int kTargetPlayoutDelayMs = 100; | 79 static const int kTargetPlayoutDelayMs = 100; |
80 | 80 |
81 // The maximum amount of deviation expected in the playout times emitted by the | 81 // The maximum amount of deviation expected in the playout times emitted by the |
82 // receiver. | 82 // receiver. |
83 static const int kMaxAllowedPlayoutErrorMs = 30; | 83 static const int kMaxAllowedPlayoutErrorMs = 30; |
84 | 84 |
85 std::string ConvertFromBase16String(const std::string base_16) { | 85 std::string ConvertFromBase16String(const std::string& base_16) { |
86 std::string compressed; | 86 std::string compressed; |
87 DCHECK_EQ(base_16.size() % 2, 0u) << "Must be a multiple of 2"; | 87 DCHECK_EQ(base_16.size() % 2, 0u) << "Must be a multiple of 2"; |
88 compressed.reserve(base_16.size() / 2); | 88 compressed.reserve(base_16.size() / 2); |
89 | 89 |
90 std::vector<uint8> v; | 90 std::vector<uint8> v; |
91 if (!base::HexStringToBytes(base_16, &v)) { | 91 if (!base::HexStringToBytes(base_16, &v)) { |
92 NOTREACHED(); | 92 NOTREACHED(); |
93 } | 93 } |
94 compressed.assign(reinterpret_cast<const char*>(&v[0]), v.size()); | 94 compressed.assign(reinterpret_cast<const char*>(&v[0]), v.size()); |
95 return compressed; | 95 return compressed; |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 EXPECT_LT(jump, 220u); | 1512 EXPECT_LT(jump, 220u); |
1513 } | 1513 } |
1514 | 1514 |
1515 // TODO(pwestin): Add repeatable packet loss test. | 1515 // TODO(pwestin): Add repeatable packet loss test. |
1516 // TODO(pwestin): Add test for misaligned send get calls. | 1516 // TODO(pwestin): Add test for misaligned send get calls. |
1517 // TODO(pwestin): Add more tests that does not resample. | 1517 // TODO(pwestin): Add more tests that does not resample. |
1518 // TODO(pwestin): Add test when we have starvation for our RunTask. | 1518 // TODO(pwestin): Add test when we have starvation for our RunTask. |
1519 | 1519 |
1520 } // namespace cast | 1520 } // namespace cast |
1521 } // namespace media | 1521 } // namespace media |
OLD | NEW |