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

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

Issue 614893004: Refactor AppendToFile and WriteFileDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Simulate end to end streaming. 5 // Simulate end to end streaming.
6 // 6 //
7 // Input: 7 // Input:
8 // --source= 8 // --source=
9 // WebM used as the source of video and audio frames. 9 // WebM used as the source of video and audio frames.
10 // --output= 10 // --output=
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 true, 179 true,
180 media::cast::kMaxSerializedBytes, 180 media::cast::kMaxSerializedBytes,
181 serialized_log.get(), 181 serialized_log.get(),
182 &output_bytes); 182 &output_bytes);
183 183
184 if (!success) { 184 if (!success) {
185 LOG(ERROR) << "Failed to serialize log."; 185 LOG(ERROR) << "Failed to serialize log.";
186 return; 186 return;
187 } 187 }
188 188
189 if (AppendToFile(output_path, serialized_log.get(), output_bytes) == -1) { 189 if (!AppendToFile(output_path, serialized_log.get(), output_bytes)) {
190 LOG(ERROR) << "Failed to append to log."; 190 LOG(ERROR) << "Failed to append to log.";
191 } 191 }
192 } 192 }
193 193
194 // Run simulation once. 194 // Run simulation once.
195 // 195 //
196 // |output_path| is the path to write serialized log. 196 // |output_path| is the path to write serialized log.
197 // |extra_data| is extra tagging information to write to log. 197 // |extra_data| is extra tagging information to write to log.
198 void RunSimulation(const base::FilePath& source_path, 198 void RunSimulation(const base::FilePath& source_path,
199 const base::FilePath& output_path, 199 const base::FilePath& output_path,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 values.SetBoolean("sim", true); 537 values.SetBoolean("sim", true);
538 values.SetString("sim-id", sim_id); 538 values.SetString("sim-id", sim_id);
539 539
540 std::string extra_data; 540 std::string extra_data;
541 base::JSONWriter::Write(&values, &extra_data); 541 base::JSONWriter::Write(&values, &extra_data);
542 542
543 // Run. 543 // Run.
544 media::cast::RunSimulation(source_path, output_path, extra_data, model); 544 media::cast::RunSimulation(source_path, output_path, extra_data, model);
545 return 0; 545 return 0;
546 } 546 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/video_encode_accelerator_unittest.cc ('k') | third_party/zlib/google/zip_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698