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

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

Issue 174183003: Cast:Transport: Dividing A/V Initialization pipeline (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing errors and yet another rebase Created 6 years, 9 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 | « media/cast/test/end2end_unittest.cc ('k') | media/cast/transport/cast_transport_config.h » ('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 // Test application that simulates a cast sender - Data can be either generated 5 // Test application that simulates a cast sender - Data can be either generated
6 // or read from a file. 6 // or read from a file.
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 std::string remote_ip_address = 405 std::string remote_ip_address =
406 media::cast::GetIpAddress("Enter receiver IP."); 406 media::cast::GetIpAddress("Enter receiver IP.");
407 407
408 media::cast::AudioSenderConfig audio_config = 408 media::cast::AudioSenderConfig audio_config =
409 media::cast::GetAudioSenderConfig(); 409 media::cast::GetAudioSenderConfig();
410 media::cast::VideoSenderConfig video_config = 410 media::cast::VideoSenderConfig video_config =
411 media::cast::GetVideoSenderConfig(); 411 media::cast::GetVideoSenderConfig();
412 412
413 // Setting up transport config. 413 // Setting up transport config.
414 media::cast::transport::CastTransportConfig config; 414 media::cast::transport::CastTransportAudioConfig transport_audio_config;
415 config.receiver_endpoint = CreateUDPAddress(remote_ip_address, remote_port); 415 media::cast::transport::CastTransportVideoConfig transport_video_config;
416 config.local_endpoint = CreateUDPAddress("0.0.0.0", 0); 416 net::IPEndPoint remote_endpoint =
417 config.audio_ssrc = audio_config.sender_ssrc; 417 CreateUDPAddress(remote_ip_address, remote_port);
418 config.video_ssrc = video_config.sender_ssrc; 418 net::IPEndPoint local_endpoint = CreateUDPAddress("0.0.0.0", 0);
419 config.audio_rtp_config = audio_config.rtp_config; 419 transport_audio_config.base.ssrc = audio_config.sender_ssrc;
420 config.video_rtp_config = video_config.rtp_config; 420 transport_audio_config.base.rtp_config = audio_config.rtp_config;
421 transport_video_config.base.ssrc = video_config.sender_ssrc;
422 transport_video_config.base.rtp_config = video_config.rtp_config;
421 423
422 scoped_ptr<media::cast::transport::CastTransportSender> transport_sender( 424 scoped_ptr<media::cast::transport::CastTransportSender> transport_sender =
423 media::cast::transport::CastTransportSender::CreateCastTransportSender( 425 media::cast::transport::CastTransportSender::Create(
424 NULL, 426 NULL, // net log.
425 clock.get(), 427 clock.get(),
426 config, 428 local_endpoint,
429 remote_endpoint,
427 base::Bind(&UpdateCastTransportStatus), 430 base::Bind(&UpdateCastTransportStatus),
428 io_message_loop.message_loop_proxy())); 431 io_message_loop.message_loop_proxy());
432
433 transport_sender->InitializeAudio(transport_audio_config);
434 transport_sender->InitializeVideo(transport_video_config);
429 435
430 // Enable main and send side threads only. Enable raw event and stats logging. 436 // Enable main and send side threads only. Enable raw event and stats logging.
431 // Running transport on the main thread. 437 // Running transport on the main thread.
432 scoped_refptr<media::cast::CastEnvironment> cast_environment( 438 scoped_refptr<media::cast::CastEnvironment> cast_environment(
433 new media::cast::CastEnvironment( 439 new media::cast::CastEnvironment(
434 clock.Pass(), 440 clock.Pass(),
435 io_message_loop.message_loop_proxy(), 441 io_message_loop.message_loop_proxy(),
436 audio_thread.message_loop_proxy(), 442 audio_thread.message_loop_proxy(),
437 NULL, 443 NULL,
438 video_thread.message_loop_proxy(), 444 video_thread.message_loop_proxy(),
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 497
492 test_thread.message_loop_proxy()->PostTask( 498 test_thread.message_loop_proxy()->PostTask(
493 FROM_HERE, 499 FROM_HERE,
494 base::Bind(&media::cast::SendProcess::SendFrame, 500 base::Bind(&media::cast::SendProcess::SendFrame,
495 base::Unretained(send_process.get()))); 501 base::Unretained(send_process.get())));
496 502
497 io_message_loop.Run(); 503 io_message_loop.Run();
498 504
499 return 0; 505 return 0;
500 } 506 }
OLDNEW
« no previous file with comments | « media/cast/test/end2end_unittest.cc ('k') | media/cast/transport/cast_transport_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698