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

Unified Diff: chromecast/renderer/media/hole_frame_factory.cc

Issue 1431193005: [Chromecast] Adds Browser test for media playback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit rm blank line Created 5 years, 1 month 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
« no previous file with comments | « chromecast/chromecast_tests.gypi ('k') | testing/buildbot/chromium.linux.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/renderer/media/hole_frame_factory.cc
diff --git a/chromecast/renderer/media/hole_frame_factory.cc b/chromecast/renderer/media/hole_frame_factory.cc
index 62dad087725ea5d4830e34b8a0ede07269599d5a..5d9addac80b8c489abfecc111cc2a45b074b6494 100644
--- a/chromecast/renderer/media/hole_frame_factory.cc
+++ b/chromecast/renderer/media/hole_frame_factory.cc
@@ -27,12 +27,14 @@ HoleFrameFactory::HoleFrameFactory(
gl->BindTexture(GL_TEXTURE_2D, texture_);
image_id_ = gl->CreateGpuMemoryBufferImageCHROMIUM(1, 1, GL_RGBA,
GL_READ_WRITE_CHROMIUM);
- gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id_);
+ if (image_id_) {
+ gl->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id_);
- gl->GenMailboxCHROMIUM(mailbox_.name);
- gl->ProduceTextureDirectCHROMIUM(texture_, GL_TEXTURE_2D, mailbox_.name);
+ gl->GenMailboxCHROMIUM(mailbox_.name);
+ gl->ProduceTextureDirectCHROMIUM(texture_, GL_TEXTURE_2D, mailbox_.name);
- sync_token_ = gpu::SyncToken(gl->InsertSyncPointCHROMIUM());
+ sync_token_ = gpu::SyncToken(gl->InsertSyncPointCHROMIUM());
+ }
}
}
@@ -43,15 +45,17 @@ HoleFrameFactory::~HoleFrameFactory() {
CHECK(lock);
gpu::gles2::GLES2Interface* gl = lock->ContextGL();
gl->BindTexture(GL_TEXTURE_2D, texture_);
- gl->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id_);
+ if (image_id_)
+ gl->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id_);
gl->DeleteTextures(1, &texture_);
- gl->DestroyImageCHROMIUM(image_id_);
+ if (image_id_)
+ gl->DestroyImageCHROMIUM(image_id_);
}
}
scoped_refptr<::media::VideoFrame> HoleFrameFactory::CreateHoleFrame(
const gfx::Size& size) {
- if (texture_) {
+ if (texture_ && image_id_) {
scoped_refptr<::media::VideoFrame> frame =
::media::VideoFrame::WrapNativeTexture(
::media::PIXEL_FORMAT_XRGB,
« no previous file with comments | « chromecast/chromecast_tests.gypi ('k') | testing/buildbot/chromium.linux.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698