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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 create_video_encode_mem_cb); | 82 create_video_encode_mem_cb); |
83 } | 83 } |
84 | 84 |
85 void CastSessionDelegate::StartUDP(const net::IPEndPoint& remote_endpoint, | 85 void CastSessionDelegate::StartUDP(const net::IPEndPoint& remote_endpoint, |
86 scoped_ptr<base::DictionaryValue> options) { | 86 scoped_ptr<base::DictionaryValue> options) { |
87 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); | 87 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); |
88 | 88 |
89 // CastSender uses the renderer's IO thread as the main thread. This reduces | 89 // CastSender uses the renderer's IO thread as the main thread. This reduces |
90 // thread hopping for incoming video frames and outgoing network packets. | 90 // thread hopping for incoming video frames and outgoing network packets. |
91 cast_environment_ = new CastEnvironment( | 91 cast_environment_ = new CastEnvironment( |
92 scoped_ptr<base::TickClock>(new base::DefaultTickClock()).Pass(), | 92 scoped_refptr<base::TickClock>(new base::DefaultTickClock()), |
93 base::MessageLoopProxy::current(), | 93 base::MessageLoopProxy::current(), |
94 g_cast_threads.Get().GetAudioEncodeMessageLoopProxy(), | 94 g_cast_threads.Get().GetAudioEncodeMessageLoopProxy(), |
95 g_cast_threads.Get().GetVideoEncodeMessageLoopProxy()); | 95 g_cast_threads.Get().GetVideoEncodeMessageLoopProxy()); |
96 | 96 |
97 event_subscribers_.reset( | 97 event_subscribers_.reset( |
98 new media::cast::RawEventSubscriberBundle(cast_environment_)); | 98 new media::cast::RawEventSubscriberBundle(cast_environment_)); |
99 | 99 |
100 // Rationale for using unretained: The callback cannot be called after the | 100 // Rationale for using unretained: The callback cannot be called after the |
101 // destruction of CastTransportSenderIPC, and they both share the same thread. | 101 // destruction of CastTransportSenderIPC, and they both share the same thread. |
102 cast_transport_.reset(new CastTransportSenderIPC( | 102 cast_transport_.reset(new CastTransportSenderIPC( |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } else { | 279 } else { |
280 cast_environment_->Logging()->InsertFrameEvent( | 280 cast_environment_->Logging()->InsertFrameEvent( |
281 it->timestamp, | 281 it->timestamp, |
282 it->type, | 282 it->type, |
283 it->media_type, | 283 it->media_type, |
284 it->rtp_timestamp, | 284 it->rtp_timestamp, |
285 it->frame_id); | 285 it->frame_id); |
286 } | 286 } |
287 } | 287 } |
288 } | 288 } |
OLD | NEW |