| 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 {
|
|
|