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

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

Issue 1751323002: Allow multiple texture ids per picture buffer. (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 unified diff | Download patch
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 <algorithm> 5 #include <algorithm>
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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 void VTVideoDecodeAccelerator::AssignPictureBuffers( 839 void VTVideoDecodeAccelerator::AssignPictureBuffers(
840 const std::vector<media::PictureBuffer>& pictures) { 840 const std::vector<media::PictureBuffer>& pictures) {
841 DCHECK(gpu_thread_checker_.CalledOnValidThread()); 841 DCHECK(gpu_thread_checker_.CalledOnValidThread());
842 842
843 for (const media::PictureBuffer& picture : pictures) { 843 for (const media::PictureBuffer& picture : pictures) {
844 DCHECK(!picture_info_map_.count(picture.id())); 844 DCHECK(!picture_info_map_.count(picture.id()));
845 assigned_picture_ids_.insert(picture.id()); 845 assigned_picture_ids_.insert(picture.id());
846 available_picture_ids_.push_back(picture.id()); 846 available_picture_ids_.push_back(picture.id());
847 picture_info_map_.insert(std::make_pair( 847 picture_info_map_.insert(std::make_pair(
848 picture.id(), 848 picture.id(),
849 make_scoped_ptr(new PictureInfo(picture.internal_texture_id(), 849 make_scoped_ptr(new PictureInfo(picture.internal_texture_ids().ids[0],
850 picture.texture_id())))); 850 picture.texture_ids().ids[0]))));
851 } 851 }
852 852
853 // Pictures are not marked as uncleared until after this method returns, and 853 // Pictures are not marked as uncleared until after this method returns, and
854 // they will be broken if they are used before that happens. So, schedule 854 // they will be broken if they are used before that happens. So, schedule
855 // future work after that happens. 855 // future work after that happens.
856 gpu_task_runner_->PostTask(FROM_HERE, base::Bind( 856 gpu_task_runner_->PostTask(FROM_HERE, base::Bind(
857 &VTVideoDecodeAccelerator::ProcessWorkQueues, weak_this_)); 857 &VTVideoDecodeAccelerator::ProcessWorkQueues, weak_this_));
858 } 858 }
859 859
860 void VTVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_id) { 860 void VTVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_id) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 // size passed to ProvidePictureBuffers() is meaningless. 997 // size passed to ProvidePictureBuffers() is meaningless.
998 if (picture_size_ != frame.coded_size) { 998 if (picture_size_ != frame.coded_size) {
999 // Dismiss current pictures. 999 // Dismiss current pictures.
1000 for (int32_t picture_id : assigned_picture_ids_) 1000 for (int32_t picture_id : assigned_picture_ids_)
1001 client_->DismissPictureBuffer(picture_id); 1001 client_->DismissPictureBuffer(picture_id);
1002 assigned_picture_ids_.clear(); 1002 assigned_picture_ids_.clear();
1003 available_picture_ids_.clear(); 1003 available_picture_ids_.clear();
1004 1004
1005 // Request new pictures. 1005 // Request new pictures.
1006 picture_size_ = frame.coded_size; 1006 picture_size_ = frame.coded_size;
1007 client_->ProvidePictureBuffers( 1007 client_->ProvidePictureBuffers(kNumPictureBuffers, 1, coded_size_,
1008 kNumPictureBuffers, coded_size_, GL_TEXTURE_RECTANGLE_ARB); 1008 GL_TEXTURE_RECTANGLE_ARB);
1009 return false; 1009 return false;
1010 } 1010 }
1011 if (!SendFrame(frame)) 1011 if (!SendFrame(frame))
1012 return false; 1012 return false;
1013 } 1013 }
1014 1014
1015 return true; 1015 return true;
1016 } 1016 }
1017 1017
1018 bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) { 1018 bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 SupportedProfile profile; 1157 SupportedProfile profile;
1158 profile.profile = supported_profile; 1158 profile.profile = supported_profile;
1159 profile.min_resolution.SetSize(16, 16); 1159 profile.min_resolution.SetSize(16, 16);
1160 profile.max_resolution.SetSize(4096, 2160); 1160 profile.max_resolution.SetSize(4096, 2160);
1161 profiles.push_back(profile); 1161 profiles.push_back(profile);
1162 } 1162 }
1163 return profiles; 1163 return profiles;
1164 } 1164 }
1165 1165
1166 } // namespace content 1166 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698