Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1017)

Side by Side Diff: chrome/renderer/media/cast_session_delegate.cc

Issue 765643006: Cast: Make receiver use cast_transport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix end2end test Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(
103 net::IPEndPoint(),
103 remote_endpoint, 104 remote_endpoint,
104 options.Pass(), 105 options.Pass(),
106 media::cast::PacketReceiverCallback(),
105 base::Bind(&CastSessionDelegate::StatusNotificationCB, 107 base::Bind(&CastSessionDelegate::StatusNotificationCB,
106 base::Unretained(this)), 108 base::Unretained(this)),
107 base::Bind(&CastSessionDelegate::LogRawEvents, base::Unretained(this)))); 109 base::Bind(&CastSessionDelegate::LogRawEvents, base::Unretained(this))));
108 110
109 cast_sender_ = CastSender::Create(cast_environment_, cast_transport_.get()); 111 cast_sender_ = CastSender::Create(cast_environment_, cast_transport_.get());
110 } 112 }
111 113
112 void CastSessionDelegate::ToggleLogging(bool is_audio, bool enable) { 114 void CastSessionDelegate::ToggleLogging(bool is_audio, bool enable) {
113 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); 115 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
114 if (!event_subscribers_.get()) 116 if (!event_subscribers_.get())
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } else { 281 } else {
280 cast_environment_->Logging()->InsertFrameEvent( 282 cast_environment_->Logging()->InsertFrameEvent(
281 it->timestamp, 283 it->timestamp,
282 it->type, 284 it->type,
283 it->media_type, 285 it->media_type,
284 it->rtp_timestamp, 286 it->rtp_timestamp,
285 it->frame_id); 287 it->frame_id);
286 } 288 }
287 } 289 }
288 } 290 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698