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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 InitLogging(logging::LoggingSettings()); | 226 InitLogging(logging::LoggingSettings()); |
227 | 227 |
228 VLOG(1) << "Cast Receiver"; | 228 VLOG(1) << "Cast Receiver"; |
229 base::Thread audio_thread("Cast audio decoder thread"); | 229 base::Thread audio_thread("Cast audio decoder thread"); |
230 base::Thread video_thread("Cast video decoder thread"); | 230 base::Thread video_thread("Cast video decoder thread"); |
231 audio_thread.Start(); | 231 audio_thread.Start(); |
232 video_thread.Start(); | 232 video_thread.Start(); |
233 | 233 |
234 scoped_ptr<base::TickClock> clock(new base::DefaultTickClock()); | 234 scoped_ptr<base::TickClock> clock(new base::DefaultTickClock()); |
235 | 235 |
236 // Enable main and receiver side threads only. Enable raw event logging. | 236 // Enable receiver side threads, and disable logging. |
237 // Running transport on the main thread. | 237 // Running transport on main thread. |
238 media::cast::CastLoggingConfig logging_config; | |
239 logging_config.enable_raw_data_collection = true; | |
240 | |
241 scoped_refptr<media::cast::CastEnvironment> cast_environment( | 238 scoped_refptr<media::cast::CastEnvironment> cast_environment( |
242 new media::cast::CastEnvironment( | 239 new media::cast::CastEnvironment( |
243 clock.Pass(), | 240 clock.Pass(), |
244 main_message_loop.message_loop_proxy(), | 241 main_message_loop.message_loop_proxy(), |
245 NULL, | 242 NULL, |
246 audio_thread.message_loop_proxy(), | 243 audio_thread.message_loop_proxy(), |
247 NULL, | 244 NULL, |
248 video_thread.message_loop_proxy(), | 245 video_thread.message_loop_proxy(), |
249 main_message_loop.message_loop_proxy(), | 246 main_message_loop.message_loop_proxy(), |
250 logging_config)); | 247 media::cast::GetDefaultCastReceiverLoggingConfig())); |
251 | 248 |
252 media::cast::AudioReceiverConfig audio_config = | 249 media::cast::AudioReceiverConfig audio_config = |
253 media::cast::GetAudioReceiverConfig(); | 250 media::cast::GetAudioReceiverConfig(); |
254 media::cast::VideoReceiverConfig video_config = | 251 media::cast::VideoReceiverConfig video_config = |
255 media::cast::GetVideoReceiverConfig(); | 252 media::cast::GetVideoReceiverConfig(); |
256 | 253 |
257 int remote_port, local_port; | 254 int remote_port, local_port; |
258 media::cast::GetPorts(&remote_port, &local_port); | 255 media::cast::GetPorts(&remote_port, &local_port); |
259 if (!local_port) { | 256 if (!local_port) { |
260 LOG(ERROR) << "Invalid local port."; | 257 LOG(ERROR) << "Invalid local port."; |
(...skipping 30 matching lines...) Expand all Loading... |
291 | 288 |
292 // TODO(hubbe): Make the cast receiver do this automatically. | 289 // TODO(hubbe): Make the cast receiver do this automatically. |
293 transport->StartReceiving(cast_receiver->packet_receiver()); | 290 transport->StartReceiving(cast_receiver->packet_receiver()); |
294 | 291 |
295 scoped_refptr<media::cast::ReceiveProcess> receive_process( | 292 scoped_refptr<media::cast::ReceiveProcess> receive_process( |
296 new media::cast::ReceiveProcess(cast_receiver->frame_receiver())); | 293 new media::cast::ReceiveProcess(cast_receiver->frame_receiver())); |
297 receive_process->Start(); | 294 receive_process->Start(); |
298 main_message_loop.Run(); | 295 main_message_loop.Run(); |
299 return 0; | 296 return 0; |
300 } | 297 } |
OLD | NEW |