| 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 // 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 std::string remote_ip_address = | 408 std::string remote_ip_address = |
| 409 media::cast::GetIpAddress("Enter receiver IP."); | 409 media::cast::GetIpAddress("Enter receiver IP."); |
| 410 | 410 |
| 411 media::cast::AudioSenderConfig audio_config = | 411 media::cast::AudioSenderConfig audio_config = |
| 412 media::cast::GetAudioSenderConfig(); | 412 media::cast::GetAudioSenderConfig(); |
| 413 media::cast::VideoSenderConfig video_config = | 413 media::cast::VideoSenderConfig video_config = |
| 414 media::cast::GetVideoSenderConfig(); | 414 media::cast::GetVideoSenderConfig(); |
| 415 | 415 |
| 416 // Setting up transport config. | 416 // Setting up transport config. |
| 417 media::cast::transport::CastTransportConfig config; | 417 media::cast::transport::CastTransportAudioConfig transport_audio_config; |
| 418 config.receiver_endpoint = CreateUDPAddress(remote_ip_address, remote_port); | 418 media::cast::transport::CastTransportVideoConfig transport_video_config; |
| 419 config.local_endpoint = CreateUDPAddress("0.0.0.0", 0); | 419 net::IPEndPoint remote_endpoint = |
| 420 config.audio_ssrc = audio_config.sender_ssrc; | 420 CreateUDPAddress(remote_ip_address, remote_port); |
| 421 config.video_ssrc = video_config.sender_ssrc; | 421 net::IPEndPoint local_endpoint = CreateUDPAddress("0.0.0.0", 0); |
| 422 config.audio_rtp_config = audio_config.rtp_config; | 422 transport_audio_config.base.ssrc = audio_config.sender_ssrc; |
| 423 config.video_rtp_config = video_config.rtp_config; | 423 transport_audio_config.base.rtp_config = audio_config.rtp_config; |
| 424 transport_video_config.base.ssrc = video_config.sender_ssrc; |
| 425 transport_video_config.base.rtp_config = video_config.rtp_config; |
| 424 | 426 |
| 425 scoped_ptr<media::cast::transport::CastTransportSender> transport_sender( | 427 scoped_ptr<media::cast::transport::CastTransportSender> transport_sender = |
| 426 media::cast::transport::CastTransportSender::CreateCastTransportSender( | 428 media::cast::transport::CastTransportSender::Create( |
| 427 clock.get(), | 429 clock.get(), |
| 428 config, | 430 local_endpoint, |
| 431 remote_endpoint, |
| 429 base::Bind(&UpdateCastTransportStatus), | 432 base::Bind(&UpdateCastTransportStatus), |
| 430 io_message_loop.message_loop_proxy())); | 433 io_message_loop.message_loop_proxy()); |
| 434 |
| 435 transport_sender->InitializeAudio(transport_audio_config); |
| 436 transport_sender->InitializeVideo(transport_video_config); |
| 431 | 437 |
| 432 // Enable main and send side threads only. Enable raw event logging. | 438 // Enable main and send side threads only. Enable raw event logging. |
| 433 // Running transport on the main thread. | 439 // Running transport on the main thread. |
| 434 media::cast::CastLoggingConfig logging_config; | 440 media::cast::CastLoggingConfig logging_config; |
| 435 logging_config.enable_raw_data_collection = true; | 441 logging_config.enable_raw_data_collection = true; |
| 436 | 442 |
| 437 scoped_refptr<media::cast::CastEnvironment> cast_environment( | 443 scoped_refptr<media::cast::CastEnvironment> cast_environment( |
| 438 new media::cast::CastEnvironment(clock.Pass(), | 444 new media::cast::CastEnvironment(clock.Pass(), |
| 439 io_message_loop.message_loop_proxy(), | 445 io_message_loop.message_loop_proxy(), |
| 440 audio_thread.message_loop_proxy(), | 446 audio_thread.message_loop_proxy(), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 501 |
| 496 test_thread.message_loop_proxy()->PostTask( | 502 test_thread.message_loop_proxy()->PostTask( |
| 497 FROM_HERE, | 503 FROM_HERE, |
| 498 base::Bind(&media::cast::SendProcess::SendFrame, | 504 base::Bind(&media::cast::SendProcess::SendFrame, |
| 499 base::Unretained(send_process.get()))); | 505 base::Unretained(send_process.get()))); |
| 500 | 506 |
| 501 io_message_loop.Run(); | 507 io_message_loop.Run(); |
| 502 | 508 |
| 503 return 0; | 509 return 0; |
| 504 } | 510 } |
| OLD | NEW |