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