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

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

Issue 463373003: Cast: Fix use after free in a testing tool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 const IPPModel& ipp_model = model.ipp(); 276 const IPPModel& ipp_model = model.ipp();
277 277
278 std::vector<double> average_rates(ipp_model.average_rate_size()); 278 std::vector<double> average_rates(ipp_model.average_rate_size());
279 std::copy(ipp_model.average_rate().begin(), ipp_model.average_rate().end(), 279 std::copy(ipp_model.average_rate().begin(), ipp_model.average_rate().end(),
280 average_rates.begin()); 280 average_rates.begin());
281 test::InterruptedPoissonProcess ipp(average_rates, 281 test::InterruptedPoissonProcess ipp(average_rates,
282 ipp_model.coef_burstiness(), ipp_model.coef_variance(), 0); 282 ipp_model.coef_burstiness(), ipp_model.coef_variance(), 0);
283 283
284 // Connect sender to receiver. This initializes the pipe. 284 // Connect sender to receiver. This initializes the pipe.
285 receiver_to_sender.Initialize( 285 receiver_to_sender.Initialize(
286 ipp.NewBuffer(128 * 1024), transport_sender->PacketReceiverForTesting(), 286 ipp.NewBuffer(128 * 1024).Pass(),
miu 2014/08/13 22:33:45 Huh. Weird. I'm surprised it compiled the way it
287 transport_sender->PacketReceiverForTesting(),
287 task_runner, &testing_clock); 288 task_runner, &testing_clock);
288 sender_to_receiver.Initialize( 289 sender_to_receiver.Initialize(
289 ipp.NewBuffer(128 * 1024), cast_receiver->packet_receiver(), task_runner, 290 ipp.NewBuffer(128 * 1024).Pass(),
291 cast_receiver->packet_receiver(), task_runner,
290 &testing_clock); 292 &testing_clock);
291 293
292 // Start receiver. 294 // Start receiver.
293 int audio_frame_count = 0; 295 int audio_frame_count = 0;
294 int video_frame_count = 0; 296 int video_frame_count = 0;
295 cast_receiver->RequestDecodedVideoFrame( 297 cast_receiver->RequestDecodedVideoFrame(
296 base::Bind(&GotVideoFrame, &video_frame_count, cast_receiver.get())); 298 base::Bind(&GotVideoFrame, &video_frame_count, cast_receiver.get()));
297 cast_receiver->RequestDecodedAudioFrame( 299 cast_receiver->RequestDecodedAudioFrame(
298 base::Bind(&GotAudioFrame, &audio_frame_count, cast_receiver.get())); 300 base::Bind(&GotAudioFrame, &audio_frame_count, cast_receiver.get()));
299 301
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 values.SetBoolean("sim", true); 511 values.SetBoolean("sim", true);
510 values.SetString("sim-id", sim_id); 512 values.SetString("sim-id", sim_id);
511 513
512 std::string extra_data; 514 std::string extra_data;
513 base::JSONWriter::Write(&values, &extra_data); 515 base::JSONWriter::Write(&values, &extra_data);
514 516
515 // Run. 517 // Run.
516 media::cast::RunSimulation(source_path, output_path, extra_data, model); 518 media::cast::RunSimulation(source_path, output_path, extra_data, model);
517 return 0; 519 return 0;
518 } 520 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698