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 "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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // size passed to ProvidePictureBuffers() is meaningless. | 1000 // size passed to ProvidePictureBuffers() is meaningless. |
1001 if (picture_size_ != frame.coded_size) { | 1001 if (picture_size_ != frame.coded_size) { |
1002 // Dismiss current pictures. | 1002 // Dismiss current pictures. |
1003 for (int32_t picture_id : assigned_picture_ids_) | 1003 for (int32_t picture_id : assigned_picture_ids_) |
1004 client_->DismissPictureBuffer(picture_id); | 1004 client_->DismissPictureBuffer(picture_id); |
1005 assigned_picture_ids_.clear(); | 1005 assigned_picture_ids_.clear(); |
1006 available_picture_ids_.clear(); | 1006 available_picture_ids_.clear(); |
1007 | 1007 |
1008 // Request new pictures. | 1008 // Request new pictures. |
1009 picture_size_ = frame.coded_size; | 1009 picture_size_ = frame.coded_size; |
1010 client_->ProvidePictureBuffers(kNumPictureBuffers, 1, coded_size_, | 1010 client_->ProvidePictureBuffers(kNumPictureBuffers, PIXEL_FORMAT_UNKNOWN, |
1011 GL_TEXTURE_RECTANGLE_ARB); | 1011 1, coded_size_, GL_TEXTURE_RECTANGLE_ARB); |
1012 return false; | 1012 return false; |
1013 } | 1013 } |
1014 if (!SendFrame(frame)) | 1014 if (!SendFrame(frame)) |
1015 return false; | 1015 return false; |
1016 } | 1016 } |
1017 | 1017 |
1018 return true; | 1018 return true; |
1019 } | 1019 } |
1020 | 1020 |
1021 bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) { | 1021 bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 SupportedProfile profile; | 1141 SupportedProfile profile; |
1142 profile.profile = supported_profile; | 1142 profile.profile = supported_profile; |
1143 profile.min_resolution.SetSize(16, 16); | 1143 profile.min_resolution.SetSize(16, 16); |
1144 profile.max_resolution.SetSize(4096, 2160); | 1144 profile.max_resolution.SetSize(4096, 2160); |
1145 profiles.push_back(profile); | 1145 profiles.push_back(profile); |
1146 } | 1146 } |
1147 return profiles; | 1147 return profiles; |
1148 } | 1148 } |
1149 | 1149 |
1150 } // namespace media | 1150 } // namespace media |
OLD | NEW |