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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (remote_ip_address.empty()) | 216 if (remote_ip_address.empty()) |
217 remote_ip_address = "127.0.0.1"; | 217 remote_ip_address = "127.0.0.1"; |
218 int remote_port = 0; | 218 int remote_port = 0; |
219 if (!base::StringToInt(cmd->GetSwitchValueASCII(kSwitchPort), &remote_port) || | 219 if (!base::StringToInt(cmd->GetSwitchValueASCII(kSwitchPort), &remote_port) || |
220 remote_port < 0 || remote_port > 65535) { | 220 remote_port < 0 || remote_port > 65535) { |
221 remote_port = 2344; | 221 remote_port = 2344; |
222 } | 222 } |
223 LOG(INFO) << "Sending to " << remote_ip_address << ":" << remote_port | 223 LOG(INFO) << "Sending to " << remote_ip_address << ":" << remote_port |
224 << "."; | 224 << "."; |
225 | 225 |
226 media::cast::AudioSenderConfig audio_config = | 226 media::cast::FrameSenderConfig audio_config = |
227 media::cast::GetDefaultAudioSenderConfig(); | 227 media::cast::GetDefaultAudioSenderConfig(); |
228 media::cast::VideoSenderConfig video_config = | 228 media::cast::FrameSenderConfig video_config = |
229 media::cast::GetDefaultVideoSenderConfig(); | 229 media::cast::GetDefaultVideoSenderConfig(); |
230 | 230 |
231 // Running transport on the main thread. | 231 // Running transport on the main thread. |
232 // Setting up transport config. | 232 // Setting up transport config. |
233 net::IPEndPoint remote_endpoint = | 233 net::IPEndPoint remote_endpoint = |
234 CreateUDPAddress(remote_ip_address, static_cast<uint16_t>(remote_port)); | 234 CreateUDPAddress(remote_ip_address, static_cast<uint16_t>(remote_port)); |
235 | 235 |
236 // Enable raw event and stats logging. | 236 // Enable raw event and stats logging. |
237 // Running transport on the main thread. | 237 // Running transport on the main thread. |
238 scoped_refptr<media::cast::CastEnvironment> cast_environment( | 238 scoped_refptr<media::cast::CastEnvironment> cast_environment( |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 base::Unretained(cast_sender.get()), | 349 base::Unretained(cast_sender.get()), |
350 audio_config, | 350 audio_config, |
351 base::Bind(&QuitLoopOnInitializationResult))); | 351 base::Bind(&QuitLoopOnInitializationResult))); |
352 io_message_loop.Run(); // Wait for audio initialization. | 352 io_message_loop.Run(); // Wait for audio initialization. |
353 | 353 |
354 fake_media_source->Start(cast_sender->audio_frame_input(), | 354 fake_media_source->Start(cast_sender->audio_frame_input(), |
355 cast_sender->video_frame_input()); | 355 cast_sender->video_frame_input()); |
356 io_message_loop.Run(); | 356 io_message_loop.Run(); |
357 return 0; | 357 return 0; |
358 } | 358 } |
OLD | NEW |