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

Unified Diff: content/renderer/media/android/stream_texture_wrapper_impl.cc

Issue 2390783003: Make stream_id internal to StreamTextureHost. (Closed)
Patch Set: Handle failure conditions of route_id. Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/android/stream_texture_wrapper_impl.cc
diff --git a/content/renderer/media/android/stream_texture_wrapper_impl.cc b/content/renderer/media/android/stream_texture_wrapper_impl.cc
index 0662a61ba91bb904fb6a92c2152ae99c27d3e4c5..db0428d10bd3166364f6b0478b62b405efea6ff8 100644
--- a/content/renderer/media/android/stream_texture_wrapper_impl.cc
+++ b/content/renderer/media/android/stream_texture_wrapper_impl.cc
@@ -33,7 +33,6 @@ StreamTextureWrapperImpl::StreamTextureWrapperImpl(
scoped_refptr<StreamTextureFactory> factory,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner)
: texture_id_(0),
- stream_id_(0),
factory_(factory),
main_task_runner_(main_task_runner),
weak_factory_(this) {}
@@ -41,7 +40,7 @@ StreamTextureWrapperImpl::StreamTextureWrapperImpl(
StreamTextureWrapperImpl::~StreamTextureWrapperImpl() {
DCHECK(main_task_runner_->BelongsToCurrentThread());
- if (stream_id_) {
+ if (texture_id_) {
GLES2Interface* gl = factory_->ContextGL();
gl->DeleteTextures(1, &texture_id_);
// Flush to ensure that the stream texture gets deleted in a timely fashion.
@@ -106,8 +105,7 @@ void StreamTextureWrapperImpl::ReallocateVideoFrame(
void StreamTextureWrapperImpl::ForwardStreamTextureForSurfaceRequest(
const base::UnguessableToken& request_token) {
- return factory_->ForwardStreamTextureForSurfaceRequest(stream_id_,
- request_token);
+ stream_texture_proxy_->ForwardStreamTextureForSurfaceRequest(request_token);
}
void StreamTextureWrapperImpl::SetCurrentFrameInternal(
@@ -132,7 +130,7 @@ void StreamTextureWrapperImpl::UpdateTextureSize(const gfx::Size& new_size) {
natural_size_ = new_size;
ReallocateVideoFrame(new_size);
- factory_->SetStreamTextureSize(stream_id_, new_size);
+ stream_texture_proxy_->SetStreamTextureSize(new_size);
}
void StreamTextureWrapperImpl::Initialize(
@@ -157,13 +155,14 @@ void StreamTextureWrapperImpl::InitializeOnMainThread(
DCHECK(main_task_runner_->BelongsToCurrentThread());
DVLOG(2) << __FUNCTION__;
- stream_texture_proxy_.reset(factory_->CreateProxy());
+ stream_texture_proxy_.reset(factory_->CreateProxy(
+ kGLTextureExternalOES, &texture_id_, &texture_mailbox_));
+ if (!stream_texture_proxy_)
+ return;
- stream_id_ = factory_->CreateStreamTexture(kGLTextureExternalOES,
- &texture_id_, &texture_mailbox_);
ReallocateVideoFrame(natural_size_);
- stream_texture_proxy_->BindToTaskRunner(stream_id_, received_frame_cb,
+ stream_texture_proxy_->BindToTaskRunner(received_frame_cb,
compositor_task_runner_);
// TODO(tguilbert): Register the surface properly. See crbug.com/627658.
« no previous file with comments | « content/renderer/media/android/stream_texture_wrapper_impl.h ('k') | content/renderer/media/android/webmediaplayer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698