Commit 78edec28 authored by Dan Sanders's avatar Dan Sanders Committed by Commit Bot

[media] Fix video frame copy when context is lost.

If a GPU channel cannot be established, a WebMediaPlayerImpl can be
constructed without a |context_provider_|. Handle that case correctly
in CopyVideoTextureToPlatformTexture().

Bug: 819914
Change-Id: I620b602ee0c092cc31273b4f513133bf8af7e1d0
Reviewed-on: https://chromium-review.googlesource.com/1250137
Commit-Queue: Dan Sanders <sandersd@chromium.org>
Reviewed-by: default avatarFredrik Hubinette <hubbe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594939}
parent 0fdb763c
...@@ -1239,14 +1239,15 @@ bool WebMediaPlayerImpl::CopyVideoTextureToPlatformTexture( ...@@ -1239,14 +1239,15 @@ bool WebMediaPlayerImpl::CopyVideoTextureToPlatformTexture(
} }
Context3D context_3d; Context3D context_3d;
gpu::ContextSupport* context_support = nullptr;
if (context_provider_) { if (context_provider_) {
context_3d = Context3D(context_provider_->ContextGL(), context_3d = Context3D(context_provider_->ContextGL(),
context_provider_->GrContext()); context_provider_->GrContext());
context_support = context_provider_->ContextSupport();
} }
return video_renderer_.CopyVideoFrameTexturesToGLTexture( return video_renderer_.CopyVideoFrameTexturesToGLTexture(
context_3d, context_provider_->ContextSupport(), gl, video_frame.get(), context_3d, context_support, gl, video_frame.get(), target, texture,
target, texture, internal_format, format, type, level, premultiply_alpha, internal_format, format, type, level, premultiply_alpha, flip_y);
flip_y);
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment