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

Side by Side Diff: media/gpu/vt_video_decode_accelerator_mac.cc

Issue 2197893002: Mac h264: Do not retain CVPixelBufferRefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/vt_video_decode_accelerator_mac.h" 5 #include "media/gpu/vt_video_decode_accelerator_mac.h"
6 6
7 #include <CoreVideo/CoreVideo.h> 7 #include <CoreVideo/CoreVideo.h>
8 #include <OpenGL/CGLIOSurface.h> 8 #include <OpenGL/CGLIOSurface.h>
9 #include <OpenGL/gl.h> 9 #include <OpenGL/gl.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 PictureInfo* picture_info = picture_info_map_.find(picture_id)->second.get(); 1030 PictureInfo* picture_info = picture_info_map_.find(picture_id)->second.get();
1031 DCHECK(!picture_info->cv_image); 1031 DCHECK(!picture_info->cv_image);
1032 DCHECK(!picture_info->gl_image); 1032 DCHECK(!picture_info->gl_image);
1033 1033
1034 if (!make_context_current_cb_.Run()) { 1034 if (!make_context_current_cb_.Run()) {
1035 DLOG(ERROR) << "Failed to make GL context current"; 1035 DLOG(ERROR) << "Failed to make GL context current";
1036 NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR); 1036 NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
1037 return false; 1037 return false;
1038 } 1038 }
1039 1039
1040 IOSurfaceRef io_surface = CVPixelBufferGetIOSurface(frame.image.get());
1041
1040 scoped_refptr<gl::GLImageIOSurface> gl_image( 1042 scoped_refptr<gl::GLImageIOSurface> gl_image(
1041 new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT)); 1043 new gl::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT));
1042 if (!gl_image->InitializeWithCVPixelBuffer( 1044 if (!gl_image->Initialize(io_surface, gfx::GenericSharedMemoryId(),
1043 frame.image.get(), gfx::GenericSharedMemoryId(), 1045 gfx::BufferFormat::YUV_420_BIPLANAR)) {
1044 gfx::BufferFormat::YUV_420_BIPLANAR)) {
1045 NOTIFY_STATUS("Failed to initialize GLImageIOSurface", PLATFORM_FAILURE, 1046 NOTIFY_STATUS("Failed to initialize GLImageIOSurface", PLATFORM_FAILURE,
1046 SFT_PLATFORM_ERROR); 1047 SFT_PLATFORM_ERROR);
1047 } 1048 }
1048 1049
1049 if (!bind_image_cb_.Run(picture_info->client_texture_id, 1050 if (!bind_image_cb_.Run(picture_info->client_texture_id,
1050 GL_TEXTURE_RECTANGLE_ARB, gl_image, false)) { 1051 GL_TEXTURE_RECTANGLE_ARB, gl_image, false)) {
1051 DLOG(ERROR) << "Failed to bind image"; 1052 DLOG(ERROR) << "Failed to bind image";
1052 NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR); 1053 NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
1053 return false; 1054 return false;
1054 } 1055 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 SupportedProfile profile; 1142 SupportedProfile profile;
1142 profile.profile = supported_profile; 1143 profile.profile = supported_profile;
1143 profile.min_resolution.SetSize(16, 16); 1144 profile.min_resolution.SetSize(16, 16);
1144 profile.max_resolution.SetSize(4096, 2160); 1145 profile.max_resolution.SetSize(4096, 2160);
1145 profiles.push_back(profile); 1146 profiles.push_back(profile);
1146 } 1147 }
1147 return profiles; 1148 return profiles;
1148 } 1149 }
1149 1150
1150 } // namespace media 1151 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698