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

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator_mac.cc

Issue 1822153002: Attempt at suspend fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vt_video_decode_accelerator_mac.cc
diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
index e4ea5cdf4fdbbf35e0e3c8fe1f6ae2b2c6c8949c..260f2252efccf298b1f5f88907c05775fecd7f1d 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
@@ -861,7 +861,7 @@ void VTVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_id) {
DCHECK(gpu_thread_checker_.CalledOnValidThread());
DCHECK(picture_info_map_.count(picture_id));
PictureInfo* picture_info = picture_info_map_.find(picture_id)->second.get();
- DCHECK_EQ(CFGetRetainCount(picture_info->cv_image), 1);
+ DCHECK_EQ(CFGetRetainCount(picture_info->cv_image), 2);
picture_info->cv_image.reset();
picture_info->gl_image->Destroy(false);
picture_info->gl_image = nullptr;
@@ -1034,7 +1034,8 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
return false;
}
- IOSurfaceRef surface = CVPixelBufferGetIOSurface(frame.image.get());
+ CVPixelBufferRef cv_pixel_buffer = frame.image.get();
+ IOSurfaceRef io_surface = CVPixelBufferGetIOSurface(cv_pixel_buffer);
if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile)
glEnable(GL_TEXTURE_RECTANGLE_ARB);
gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_RECTANGLE_ARB,
@@ -1049,7 +1050,7 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
frame.coded_size.height(), // height
GL_YCBCR_422_APPLE, // format
GL_UNSIGNED_SHORT_8_8_APPLE, // type
- surface, // io_surface
+ io_surface, // io_surface
0); // plane
if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGLCoreProfile)
glDisable(GL_TEXTURE_RECTANGLE_ARB);
@@ -1061,7 +1062,8 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
bool allow_overlay = false;
scoped_refptr<gl::GLImageIOSurface> gl_image(
new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT));
- if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(),
+ if (gl_image->Initialize(io_surface, cv_pixel_buffer,
+ gfx::GenericSharedMemoryId(),
gfx::BufferFormat::BGRA_8888)) {
allow_overlay = true;
} else {
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698