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

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

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dispatch GetSupportedResolution to each vda Created 5 years, 12 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 <dlfcn.h> 5 #include <dlfcn.h>
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <linux/videodev2.h> 8 #include <linux/videodev2.h>
9 #include <poll.h> 9 #include <poll.h>
10 #include <sys/eventfd.h> 10 #include <sys/eventfd.h>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 DestroyInputBuffers(); 199 DestroyInputBuffers();
200 DestroyOutputBuffers(); 200 DestroyOutputBuffers();
201 201
202 // These maps have members that should be manually destroyed, e.g. file 202 // These maps have members that should be manually destroyed, e.g. file
203 // descriptors, mmap() segments, etc. 203 // descriptors, mmap() segments, etc.
204 DCHECK(input_buffer_map_.empty()); 204 DCHECK(input_buffer_map_.empty());
205 DCHECK(output_buffer_map_.empty()); 205 DCHECK(output_buffer_map_.empty());
206 } 206 }
207 207
208 // static
209 media::VideoDecodeAccelerator::SupportedResolution
210 V4L2VideoDecodeAccelerator::GetSupportedResolution() {
wuchengli 2014/12/26 09:37:07 Use the same order in the header file.
henryhsu 2014/12/26 10:25:18 Done.
211 // NOTE: additional autodetection logic may require updating input buffer size
212 // selection in platform-specific implementations, such as
213 // V4L2VideoDecodeAccelerator.
wuchengli 2014/12/26 09:37:07 Update the comment. This is already V4L2VDA.
henryhsu 2014/12/26 10:25:18 Done.
214 media::VideoDecodeAccelerator::SupportedResolution resolution;
215 resolution.min.SetSize(16, 16);
216 if (CommandLine::ForCurrentProcess()->HasSwitch(
217 switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode))
218 resolution.max.SetSize(4096, 2160);
219 else
220 resolution.max.SetSize(1920, 1088);
221 return resolution;
222 }
223
208 bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, 224 bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
209 Client* client) { 225 Client* client) {
210 DVLOG(3) << "Initialize()"; 226 DVLOG(3) << "Initialize()";
211 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); 227 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
212 DCHECK_EQ(decoder_state_, kUninitialized); 228 DCHECK_EQ(decoder_state_, kUninitialized);
213 229
214 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); 230 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client));
215 client_ = client_ptr_factory_->GetWeakPtr(); 231 client_ = client_ptr_factory_->GetWeakPtr();
216 232
217 switch (profile) { 233 switch (profile) {
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), 1950 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width),
1935 base::checked_cast<int>(format.fmt.pix_mp.height)); 1951 base::checked_cast<int>(format.fmt.pix_mp.height));
1936 if (frame_buffer_size_ != new_size) { 1952 if (frame_buffer_size_ != new_size) {
1937 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; 1953 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected";
1938 return true; 1954 return true;
1939 } 1955 }
1940 return false; 1956 return false;
1941 } 1957 }
1942 1958
1943 } // namespace content 1959 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698