| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <climits> | 6 #include <climits> |
| 7 #include <cstdarg> | 7 #include <cstdarg> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 18 #include "base/time/default_tick_clock.h" | 18 #include "base/time/default_tick_clock.h" |
| 19 #include "media/base/video_frame.h" | 19 #include "media/base/video_frame.h" |
| 20 #include "media/cast/cast_config.h" | 20 #include "media/cast/cast_config.h" |
| 21 #include "media/cast/cast_environment.h" | 21 #include "media/cast/cast_environment.h" |
| 22 #include "media/cast/cast_receiver.h" | 22 #include "media/cast/cast_receiver.h" |
| 23 #include "media/cast/logging/logging_defines.h" | 23 #include "media/cast/logging/logging_defines.h" |
| 24 #include "media/cast/net/transport/transport.h" | |
| 25 #include "media/cast/test/utility/input_helper.h" | 24 #include "media/cast/test/utility/input_helper.h" |
| 25 #include "media/cast/transport/transport/transport.h" |
| 26 | 26 |
| 27 #if defined(OS_LINUX) | 27 #if defined(OS_LINUX) |
| 28 #include "media/cast/test/linux_output_window.h" | 28 #include "media/cast/test/linux_output_window.h" |
| 29 #endif // OS_LINUX | 29 #endif // OS_LINUX |
| 30 | 30 |
| 31 namespace media { | 31 namespace media { |
| 32 namespace cast { | 32 namespace cast { |
| 33 // Settings chosen to match default sender settings. | 33 // Settings chosen to match default sender settings. |
| 34 #define DEFAULT_SEND_PORT "2346" | 34 #define DEFAULT_SEND_PORT "2346" |
| 35 #define DEFAULT_RECEIVE_PORT "2344" | 35 #define DEFAULT_RECEIVE_PORT "2344" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 audio_thread.message_loop_proxy(), | 232 audio_thread.message_loop_proxy(), |
| 233 NULL, | 233 NULL, |
| 234 video_thread.message_loop_proxy(), | 234 video_thread.message_loop_proxy(), |
| 235 media::cast::GetDefaultCastLoggingConfig())); | 235 media::cast::GetDefaultCastLoggingConfig())); |
| 236 | 236 |
| 237 media::cast::AudioReceiverConfig audio_config = | 237 media::cast::AudioReceiverConfig audio_config = |
| 238 media::cast::GetAudioReceiverConfig(); | 238 media::cast::GetAudioReceiverConfig(); |
| 239 media::cast::VideoReceiverConfig video_config = | 239 media::cast::VideoReceiverConfig video_config = |
| 240 media::cast::GetVideoReceiverConfig(); | 240 media::cast::GetVideoReceiverConfig(); |
| 241 | 241 |
| 242 scoped_ptr<media::cast::Transport> transport( | 242 scoped_ptr<media::cast::transport::Transport> transport( |
| 243 new media::cast::Transport(main_message_loop.message_loop_proxy())); | 243 new media::cast::transport::Transport( |
| 244 main_message_loop.message_loop_proxy())); |
| 244 scoped_ptr<media::cast::CastReceiver> cast_receiver( | 245 scoped_ptr<media::cast::CastReceiver> cast_receiver( |
| 245 media::cast::CastReceiver::CreateCastReceiver( | 246 media::cast::CastReceiver::CreateCastReceiver( |
| 246 cast_environment, | 247 cast_environment, |
| 247 audio_config, | 248 audio_config, |
| 248 video_config, | 249 video_config, |
| 249 transport->packet_sender())); | 250 transport->packet_sender())); |
| 250 | 251 |
| 251 media::cast::PacketReceiver* packet_receiver = | 252 media::cast::PacketReceiver* packet_receiver = |
| 252 cast_receiver->packet_receiver(); | 253 cast_receiver->packet_receiver(); |
| 253 | 254 |
| 254 int send_to_port, receive_port; | 255 int send_to_port, receive_port; |
| 255 media::cast::GetPorts(&send_to_port, &receive_port); | 256 media::cast::GetPorts(&send_to_port, &receive_port); |
| 256 std::string ip_address = media::cast::GetIpAddress("Enter destination IP."); | 257 std::string ip_address = media::cast::GetIpAddress("Enter destination IP."); |
| 257 std::string local_ip_address = media::cast::GetIpAddress("Enter local IP."); | 258 std::string local_ip_address = media::cast::GetIpAddress("Enter local IP."); |
| 258 transport->SetLocalReceiver(packet_receiver, ip_address, local_ip_address, | 259 transport->SetLocalReceiver(packet_receiver, ip_address, local_ip_address, |
| 259 receive_port); | 260 receive_port); |
| 260 transport->SetSendDestination(ip_address, send_to_port); | 261 transport->SetSendDestination(ip_address, send_to_port); |
| 261 | 262 |
| 262 scoped_refptr<media::cast::ReceiveProcess> receive_process( | 263 scoped_refptr<media::cast::ReceiveProcess> receive_process( |
| 263 new media::cast::ReceiveProcess(cast_receiver->frame_receiver())); | 264 new media::cast::ReceiveProcess(cast_receiver->frame_receiver())); |
| 264 receive_process->Start(); | 265 receive_process->Start(); |
| 265 main_message_loop.Run(); | 266 main_message_loop.Run(); |
| 266 transport->StopReceiving(); | 267 transport->StopReceiving(); |
| 267 return 0; | 268 return 0; |
| 268 } | 269 } |
| OLD | NEW |