| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 base::Bind(&OnReleaseTexture, factory_, texture_id_ref)), | 97 base::Bind(&OnReleaseTexture, factory_, texture_id_ref)), |
| 98 natural_size, gfx::Rect(natural_size), natural_size, | 98 natural_size, gfx::Rect(natural_size), natural_size, |
| 99 base::TimeDelta()); | 99 base::TimeDelta()); |
| 100 | 100 |
| 101 // TODO(tguilbert): Create and pipe the enable_texture_copy_ flag for Webview | 101 // TODO(tguilbert): Create and pipe the enable_texture_copy_ flag for Webview |
| 102 // scenarios. See crbug.com/628066. | 102 // scenarios. See crbug.com/628066. |
| 103 | 103 |
| 104 SetCurrentFrameInternal(new_frame); | 104 SetCurrentFrameInternal(new_frame); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void StreamTextureWrapperImpl::ForwardStreamTextureForSurfaceRequest( |
| 108 base::Nonce request_token) { |
| 109 return factory_->ForwardStreamTextureForSurfaceRequest(stream_id_, |
| 110 request_token); |
| 111 } |
| 112 |
| 107 void StreamTextureWrapperImpl::SetCurrentFrameInternal( | 113 void StreamTextureWrapperImpl::SetCurrentFrameInternal( |
| 108 const scoped_refptr<media::VideoFrame>& video_frame) { | 114 const scoped_refptr<media::VideoFrame>& video_frame) { |
| 109 base::AutoLock auto_lock(current_frame_lock_); | 115 base::AutoLock auto_lock(current_frame_lock_); |
| 110 current_frame_ = video_frame; | 116 current_frame_ = video_frame; |
| 111 } | 117 } |
| 112 | 118 |
| 113 void StreamTextureWrapperImpl::UpdateTextureSize(const gfx::Size& new_size) { | 119 void StreamTextureWrapperImpl::UpdateTextureSize(const gfx::Size& new_size) { |
| 114 DVLOG(2) << __FUNCTION__; | 120 DVLOG(2) << __FUNCTION__; |
| 115 | 121 |
| 116 if (!main_task_runner_->BelongsToCurrentThread()) { | 122 if (!main_task_runner_->BelongsToCurrentThread()) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 main_task_runner_->PostTask( | 183 main_task_runner_->PostTask( |
| 178 FROM_HERE, | 184 FROM_HERE, |
| 179 base::Bind(&StreamTextureWrapperImpl::Destroy, base::Unretained(this))); | 185 base::Bind(&StreamTextureWrapperImpl::Destroy, base::Unretained(this))); |
| 180 return; | 186 return; |
| 181 } | 187 } |
| 182 | 188 |
| 183 delete this; | 189 delete this; |
| 184 } | 190 } |
| 185 | 191 |
| 186 } // namespace content | 192 } // namespace content |
| OLD | NEW |