Chromium Code Reviews| 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.h" | 5 #include "chrome/renderer/media/cast_session.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 base::Unretained(delegate_.get()), | 78 base::Unretained(delegate_.get()), |
| 79 config, | 79 config, |
| 80 media::BindToCurrentLoop(callback), | 80 media::BindToCurrentLoop(callback), |
| 81 media::BindToCurrentLoop(error_callback), | 81 media::BindToCurrentLoop(error_callback), |
| 82 media::BindToCurrentLoop( | 82 media::BindToCurrentLoop( |
| 83 base::Bind(&CreateVideoEncodeAccelerator)), | 83 base::Bind(&CreateVideoEncodeAccelerator)), |
| 84 media::BindToCurrentLoop( | 84 media::BindToCurrentLoop( |
| 85 base::Bind(&CreateVideoEncodeMemory)))); | 85 base::Bind(&CreateVideoEncodeMemory)))); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CastSession::StartRemotingStream( | |
| 89 int32_t stream_id, | |
| 90 const media::cast::FrameSenderConfig& config, | |
| 91 const ErrorCallback& error_callback) { | |
| 92 DCHECK(content::RenderThread::Get()); | |
| 93 | |
| 94 io_task_runner_->PostTask( | |
| 95 FROM_HERE, base::Bind(&CastSessionDelegate::StartRemotingStream, | |
| 96 base::Unretained(delegate_.get()), stream_id, | |
|
dcheng
2016/09/10 02:31:36
How will this get cancelled if CastSession is dest
xjz
2016/09/12 18:22:06
It is always safe to post task on the IO thread to
| |
| 97 config, media::BindToCurrentLoop(error_callback))); | |
| 98 } | |
| 99 | |
| 88 void CastSession::StartUDP(const net::IPEndPoint& remote_endpoint, | 100 void CastSession::StartUDP(const net::IPEndPoint& remote_endpoint, |
| 89 std::unique_ptr<base::DictionaryValue> options, | 101 std::unique_ptr<base::DictionaryValue> options, |
| 90 const ErrorCallback& error_callback) { | 102 const ErrorCallback& error_callback) { |
| 91 io_task_runner_->PostTask( | 103 io_task_runner_->PostTask( |
| 92 FROM_HERE, | 104 FROM_HERE, |
| 93 base::Bind( | 105 base::Bind( |
| 94 &CastSessionDelegate::StartUDP, | 106 &CastSessionDelegate::StartUDP, |
| 95 base::Unretained(delegate_.get()), | 107 base::Unretained(delegate_.get()), |
| 96 net::IPEndPoint(), | 108 net::IPEndPoint(), |
| 97 remote_endpoint, | 109 remote_endpoint, |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 122 | 134 |
| 123 void CastSession::GetStatsAndReset(bool is_audio, | 135 void CastSession::GetStatsAndReset(bool is_audio, |
| 124 const StatsCallback& callback) { | 136 const StatsCallback& callback) { |
| 125 io_task_runner_->PostTask( | 137 io_task_runner_->PostTask( |
| 126 FROM_HERE, | 138 FROM_HERE, |
| 127 base::Bind(&CastSessionDelegate::GetStatsAndReset, | 139 base::Bind(&CastSessionDelegate::GetStatsAndReset, |
| 128 base::Unretained(delegate_.get()), | 140 base::Unretained(delegate_.get()), |
| 129 is_audio, | 141 is_audio, |
| 130 media::BindToCurrentLoop(callback))); | 142 media::BindToCurrentLoop(callback))); |
| 131 } | 143 } |
| OLD | NEW |