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

Side by Side Diff: media/cast/test/end2end_unittest.cc

Issue 1360523002: Cleanup: Pass std::string as const reference from media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « media/cast/common/transport_encryption_handler.cc ('k') | media/cast/test/receiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/cast/common/transport_encryption_handler.cc ('k') | media/cast/test/receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698