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

Side by Side Diff: content/renderer/media/android/stream_texture_wrapper_impl.cc

Issue 2530443002: Fix OnChannelError() in StreamTextureHost (Closed)
Patch Set: Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/renderer/media/android/stream_texture_wrapper_impl.h" 5 #include "content/renderer/media/android/stream_texture_wrapper_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "cc/layers/video_frame_provider.h" 8 #include "cc/layers/video_frame_provider.h"
9 #include "gpu/GLES2/gl2extchromium.h" 9 #include "gpu/GLES2/gl2extchromium.h"
10 #include "gpu/command_buffer/client/gles2_interface.h" 10 #include "gpu/command_buffer/client/gles2_interface.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 weak_factory_.GetWeakPtr(), received_frame_cb, 153 weak_factory_.GetWeakPtr(), received_frame_cb,
154 media::BindToCurrentLoop(init_cb))); 154 media::BindToCurrentLoop(init_cb)));
155 } 155 }
156 156
157 void StreamTextureWrapperImpl::InitializeOnMainThread( 157 void StreamTextureWrapperImpl::InitializeOnMainThread(
158 const base::Closure& received_frame_cb, 158 const base::Closure& received_frame_cb,
159 const base::Closure& init_cb) { 159 const base::Closure& init_cb) {
160 DCHECK(main_task_runner_->BelongsToCurrentThread()); 160 DCHECK(main_task_runner_->BelongsToCurrentThread());
161 DVLOG(2) << __FUNCTION__; 161 DVLOG(2) << __FUNCTION__;
162 162
163 stream_texture_proxy_.reset(factory_->CreateProxy( 163 stream_texture_proxy_ = factory_->CreateProxy(
164 kGLTextureExternalOES, &texture_id_, &texture_mailbox_)); 164 kGLTextureExternalOES, &texture_id_, &texture_mailbox_);
165 if (!stream_texture_proxy_) 165 if (!stream_texture_proxy_)
166 return; 166 return;
167 167
168 ReallocateVideoFrame(natural_size_); 168 ReallocateVideoFrame(natural_size_);
169 169
170 stream_texture_proxy_->BindToTaskRunner(received_frame_cb, 170 stream_texture_proxy_->BindToTaskRunner(received_frame_cb,
171 compositor_task_runner_); 171 compositor_task_runner_);
172 172
173 // TODO(tguilbert): Register the surface properly. See crbug.com/627658. 173 // TODO(tguilbert): Register the surface properly. See crbug.com/627658.
174 174
(...skipping 12 matching lines...) Expand all
187 main_task_runner_->PostTask( 187 main_task_runner_->PostTask(
188 FROM_HERE, 188 FROM_HERE,
189 base::Bind(&StreamTextureWrapperImpl::Destroy, base::Unretained(this))); 189 base::Bind(&StreamTextureWrapperImpl::Destroy, base::Unretained(this)));
190 return; 190 return;
191 } 191 }
192 192
193 delete this; 193 delete this;
194 } 194 }
195 195
196 } // namespace content 196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698