| 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 "chrome/renderer/media/cast_session_delegate.h" | 5 #include "chrome/renderer/media/cast_session_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
| 10 #include "media/cast/cast_config.h" | 10 #include "media/cast/cast_config.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 if (cast_environment_) | 33 if (cast_environment_) |
| 34 return; | 34 return; |
| 35 | 35 |
| 36 audio_encode_thread_.Start(); | 36 audio_encode_thread_.Start(); |
| 37 video_encode_thread_.Start(); | 37 video_encode_thread_.Start(); |
| 38 | 38 |
| 39 // CastSender uses the renderer's IO thread as the main thread. This reduces | 39 // CastSender uses the renderer's IO thread as the main thread. This reduces |
| 40 // thread hopping for incoming video frames and outgoing network packets. | 40 // thread hopping for incoming video frames and outgoing network packets. |
| 41 // There's no need to decode so no thread assigned for decoding. | 41 // There's no need to decode so no thread assigned for decoding. |
| 42 // Disabling cast logging of all types. |
| 42 cast_environment_ = new CastEnvironment( | 43 cast_environment_ = new CastEnvironment( |
| 43 &clock_, | 44 &clock_, |
| 44 base::MessageLoopProxy::current(), | 45 base::MessageLoopProxy::current(), |
| 45 audio_encode_thread_.message_loop_proxy(), | 46 audio_encode_thread_.message_loop_proxy(), |
| 46 NULL, | 47 NULL, |
| 47 video_encode_thread_.message_loop_proxy(), | 48 video_encode_thread_.message_loop_proxy(), |
| 48 NULL); | 49 NULL, |
| 50 false, |
| 51 false, |
| 52 false); |
| 49 | 53 |
| 50 // TODO(hclam): A couple things need to be done here: | 54 // TODO(hclam): A couple things need to be done here: |
| 51 // 1. Pass audio and video configuration to CastSender. | 55 // 1. Pass audio and video configuration to CastSender. |
| 52 // 2. Connect media::cast::PacketSender to net::Socket interface. | 56 // 2. Connect media::cast::PacketSender to net::Socket interface. |
| 53 // 3. Implement VideoEncoderController to configure hardware encoder. | 57 // 3. Implement VideoEncoderController to configure hardware encoder. |
| 54 cast_sender_.reset(CastSender::CreateCastSender( | 58 cast_sender_.reset(CastSender::CreateCastSender( |
| 55 cast_environment_, | 59 cast_environment_, |
| 56 AudioSenderConfig(), | 60 AudioSenderConfig(), |
| 57 VideoSenderConfig(), | 61 VideoSenderConfig(), |
| 58 NULL, | 62 NULL, |
| 59 NULL)); | 63 NULL)); |
| 60 } | 64 } |
| OLD | NEW |