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/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
17 #include "base/time/default_tick_clock.h" | 17 #include "base/time/default_tick_clock.h" |
18 #include "media/cast/cast_config.h" | 18 #include "media/cast/cast_config.h" |
19 #include "media/cast/cast_environment.h" | 19 #include "media/cast/cast_environment.h" |
20 #include "media/cast/cast_receiver.h" | 20 #include "media/cast/cast_receiver.h" |
| 21 #include "media/cast/logging/logging_defines.h" |
21 #include "media/cast/test/transport/transport.h" | 22 #include "media/cast/test/transport/transport.h" |
22 #include "media/cast/test/utility/input_helper.h" | 23 #include "media/cast/test/utility/input_helper.h" |
23 | 24 |
24 #if defined(OS_LINUX) | 25 #if defined(OS_LINUX) |
25 #include "media/cast/test/linux_output_window.h" | 26 #include "media/cast/test/linux_output_window.h" |
26 #endif // OS_LINUX | 27 #endif // OS_LINUX |
27 | 28 |
28 namespace media { | 29 namespace media { |
29 namespace cast { | 30 namespace cast { |
30 | 31 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 195 |
195 int main(int argc, char** argv) { | 196 int main(int argc, char** argv) { |
196 base::AtExitManager at_exit; | 197 base::AtExitManager at_exit; |
197 base::MessageLoopForIO main_message_loop; | 198 base::MessageLoopForIO main_message_loop; |
198 VLOG(1) << "Cast Receiver"; | 199 VLOG(1) << "Cast Receiver"; |
199 | 200 |
200 // Set up environment. | 201 // Set up environment. |
201 base::DefaultTickClock clock; | 202 base::DefaultTickClock clock; |
202 scoped_refptr<base::SequencedTaskRunner> | 203 scoped_refptr<base::SequencedTaskRunner> |
203 task_runner(main_message_loop.message_loop_proxy()); | 204 task_runner(main_message_loop.message_loop_proxy()); |
| 205 // Enable receiver side threads, and disable logging. |
204 scoped_refptr<media::cast::CastEnvironment> cast_environment(new | 206 scoped_refptr<media::cast::CastEnvironment> cast_environment(new |
205 media::cast::CastEnvironment(&clock, | 207 media::cast::CastEnvironment(&clock, |
206 task_runner, NULL, task_runner, NULL, task_runner)); | 208 task_runner, NULL, task_runner, NULL, task_runner, |
| 209 media::cast::GetDefaultCastLoggingConfig())); |
207 | 210 |
208 media::cast::AudioReceiverConfig audio_config = | 211 media::cast::AudioReceiverConfig audio_config = |
209 media::cast::GetAudioReceiverConfig(); | 212 media::cast::GetAudioReceiverConfig(); |
210 media::cast::VideoReceiverConfig video_config = | 213 media::cast::VideoReceiverConfig video_config = |
211 media::cast::GetVideoReceiverConfig(); | 214 media::cast::GetVideoReceiverConfig(); |
212 | 215 |
213 scoped_ptr<media::cast::test::Transport> transport( | 216 scoped_ptr<media::cast::test::Transport> transport( |
214 new media::cast::test::Transport(cast_environment)); | 217 new media::cast::test::Transport(cast_environment)); |
215 scoped_ptr<media::cast::CastReceiver> cast_receiver( | 218 scoped_ptr<media::cast::CastReceiver> cast_receiver( |
216 media::cast::CastReceiver::CreateCastReceiver( | 219 media::cast::CastReceiver::CreateCastReceiver( |
(...skipping 14 matching lines...) Expand all Loading... |
231 transport->SetLocalReceiver(packet_receiver, ip_address, local_ip_address, | 234 transport->SetLocalReceiver(packet_receiver, ip_address, local_ip_address, |
232 receive_port); | 235 receive_port); |
233 transport->SetSendDestination(ip_address, send_to_port); | 236 transport->SetSendDestination(ip_address, send_to_port); |
234 | 237 |
235 media::cast::ReceiveProcess receive_process(cast_environment, frame_receiver); | 238 media::cast::ReceiveProcess receive_process(cast_environment, frame_receiver); |
236 receive_process.Start(); | 239 receive_process.Start(); |
237 main_message_loop.Run(); | 240 main_message_loop.Run(); |
238 transport->StopReceiving(); | 241 transport->StopReceiving(); |
239 return 0; | 242 return 0; |
240 } | 243 } |
OLD | NEW |