| OLD | NEW |
| 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 "content/common/gpu/media/vt_video_decode_accelerator_mac.h" | 5 #include "content/common/gpu/media/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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 // they will be broken if they are used before that happens. So, schedule | 861 // they will be broken if they are used before that happens. So, schedule |
| 862 // future work after that happens. | 862 // future work after that happens. |
| 863 gpu_task_runner_->PostTask(FROM_HERE, base::Bind( | 863 gpu_task_runner_->PostTask(FROM_HERE, base::Bind( |
| 864 &VTVideoDecodeAccelerator::ProcessWorkQueues, weak_this_)); | 864 &VTVideoDecodeAccelerator::ProcessWorkQueues, weak_this_)); |
| 865 } | 865 } |
| 866 | 866 |
| 867 void VTVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_id) { | 867 void VTVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_id) { |
| 868 DCHECK(gpu_thread_checker_.CalledOnValidThread()); | 868 DCHECK(gpu_thread_checker_.CalledOnValidThread()); |
| 869 DCHECK(picture_info_map_.count(picture_id)); | 869 DCHECK(picture_info_map_.count(picture_id)); |
| 870 PictureInfo* picture_info = picture_info_map_.find(picture_id)->second.get(); | 870 PictureInfo* picture_info = picture_info_map_.find(picture_id)->second.get(); |
| 871 DCHECK_EQ(CFGetRetainCount(picture_info->cv_image), 2); | |
| 872 picture_info->cv_image.reset(); | 871 picture_info->cv_image.reset(); |
| 873 picture_info->gl_image->Destroy(false); | 872 picture_info->gl_image->Destroy(false); |
| 874 picture_info->gl_image = nullptr; | 873 picture_info->gl_image = nullptr; |
| 875 | 874 |
| 876 if (assigned_picture_ids_.count(picture_id) != 0) { | 875 if (assigned_picture_ids_.count(picture_id) != 0) { |
| 877 available_picture_ids_.push_back(picture_id); | 876 available_picture_ids_.push_back(picture_id); |
| 878 ProcessWorkQueues(); | 877 ProcessWorkQueues(); |
| 879 } else { | 878 } else { |
| 880 client_->DismissPictureBuffer(picture_id); | 879 client_->DismissPictureBuffer(picture_id); |
| 881 } | 880 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 SupportedProfile profile; | 1145 SupportedProfile profile; |
| 1147 profile.profile = supported_profile; | 1146 profile.profile = supported_profile; |
| 1148 profile.min_resolution.SetSize(16, 16); | 1147 profile.min_resolution.SetSize(16, 16); |
| 1149 profile.max_resolution.SetSize(4096, 2160); | 1148 profile.max_resolution.SetSize(4096, 2160); |
| 1150 profiles.push_back(profile); | 1149 profiles.push_back(profile); |
| 1151 } | 1150 } |
| 1152 return profiles; | 1151 return profiles; |
| 1153 } | 1152 } |
| 1154 | 1153 |
| 1155 } // namespace content | 1154 } // namespace content |
| OLD | NEW |