| 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 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 int main(int argc, char** argv) { | 195 int main(int argc, char** argv) { |
| 196 base::AtExitManager at_exit; | 196 base::AtExitManager at_exit; |
| 197 base::MessageLoopForIO main_message_loop; | 197 base::MessageLoopForIO main_message_loop; |
| 198 VLOG(1) << "Cast Receiver"; | 198 VLOG(1) << "Cast Receiver"; |
| 199 | 199 |
| 200 // Set up environment. | 200 // Set up environment. |
| 201 base::DefaultTickClock clock; | 201 base::DefaultTickClock clock; |
| 202 scoped_refptr<base::SequencedTaskRunner> | 202 scoped_refptr<base::SequencedTaskRunner> |
| 203 task_runner(main_message_loop.message_loop_proxy()); | 203 task_runner(main_message_loop.message_loop_proxy()); |
| 204 // Enable receiver side threads, and disable logging. |
| 204 scoped_refptr<media::cast::CastEnvironment> cast_environment(new | 205 scoped_refptr<media::cast::CastEnvironment> cast_environment(new |
| 205 media::cast::CastEnvironment(&clock, | 206 media::cast::CastEnvironment(&clock, |
| 206 task_runner, NULL, task_runner, NULL, task_runner)); | 207 task_runner, NULL, task_runner, NULL, task_runner, false, false, false)); |
| 207 | 208 |
| 208 media::cast::AudioReceiverConfig audio_config = | 209 media::cast::AudioReceiverConfig audio_config = |
| 209 media::cast::GetAudioReceiverConfig(); | 210 media::cast::GetAudioReceiverConfig(); |
| 210 media::cast::VideoReceiverConfig video_config = | 211 media::cast::VideoReceiverConfig video_config = |
| 211 media::cast::GetVideoReceiverConfig(); | 212 media::cast::GetVideoReceiverConfig(); |
| 212 | 213 |
| 213 scoped_ptr<media::cast::test::Transport> transport( | 214 scoped_ptr<media::cast::test::Transport> transport( |
| 214 new media::cast::test::Transport(cast_environment)); | 215 new media::cast::test::Transport(cast_environment)); |
| 215 scoped_ptr<media::cast::CastReceiver> cast_receiver( | 216 scoped_ptr<media::cast::CastReceiver> cast_receiver( |
| 216 media::cast::CastReceiver::CreateCastReceiver( | 217 media::cast::CastReceiver::CreateCastReceiver( |
| (...skipping 12 matching lines...) Expand all Loading... |
| 229 std::string ip_address = media::cast::GetIpAddress(); | 230 std::string ip_address = media::cast::GetIpAddress(); |
| 230 transport->SetLocalReceiver(packet_receiver, ip_address, receive_port); | 231 transport->SetLocalReceiver(packet_receiver, ip_address, receive_port); |
| 231 transport->SetSendDestination(ip_address, send_to_port); | 232 transport->SetSendDestination(ip_address, send_to_port); |
| 232 | 233 |
| 233 media::cast::ReceiveProcess receive_process(cast_environment, frame_receiver); | 234 media::cast::ReceiveProcess receive_process(cast_environment, frame_receiver); |
| 234 receive_process.Start(); | 235 receive_process.Start(); |
| 235 main_message_loop.Run(); | 236 main_message_loop.Run(); |
| 236 transport->StopReceiving(); | 237 transport->StopReceiving(); |
| 237 return 0; | 238 return 0; |
| 238 } | 239 } |
| OLD | NEW |