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

Side by Side Diff: content/common/gpu/media/vt_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: fix compile error Created 5 years, 8 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 | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | content/content_common.gypi » ('j') | 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 <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 10
(...skipping 15 matching lines...) Expand all
26 using content_common_gpu_media::StubPathMap; 26 using content_common_gpu_media::StubPathMap;
27 27
28 #define NOTIFY_STATUS(name, status, session_failure) \ 28 #define NOTIFY_STATUS(name, status, session_failure) \
29 do { \ 29 do { \
30 OSSTATUS_DLOG(ERROR, status) << name; \ 30 OSSTATUS_DLOG(ERROR, status) << name; \
31 NotifyError(PLATFORM_FAILURE, session_failure); \ 31 NotifyError(PLATFORM_FAILURE, session_failure); \
32 } while (0) 32 } while (0)
33 33
34 namespace content { 34 namespace content {
35 35
36 // Only H.264 with 4:2:0 chroma sampling is supported.
37 static const media::VideoCodecProfile kSupportedProfiles[] = {
38 media::H264PROFILE_BASELINE,
39 media::H264PROFILE_MAIN,
40 media::H264PROFILE_EXTENDED,
41 media::H264PROFILE_HIGH,
42 media::H264PROFILE_HIGH10PROFILE,
43 media::H264PROFILE_SCALABLEBASELINE,
44 media::H264PROFILE_SCALABLEHIGH,
45 media::H264PROFILE_STEREOHIGH,
46 media::H264PROFILE_MULTIVIEWHIGH,
47 };
48
36 // Size to use for NALU length headers in AVC format (can be 1, 2, or 4). 49 // Size to use for NALU length headers in AVC format (can be 1, 2, or 4).
37 static const int kNALUHeaderLength = 4; 50 static const int kNALUHeaderLength = 4;
38 51
39 // We request 5 picture buffers from the client, each of which has a texture ID 52 // We request 5 picture buffers from the client, each of which has a texture ID
40 // that we can bind decoded frames to. We need enough to satisfy preroll, and 53 // that we can bind decoded frames to. We need enough to satisfy preroll, and
41 // enough to avoid unnecessary stalling, but no more than that. The resource 54 // enough to avoid unnecessary stalling, but no more than that. The resource
42 // requirements are low, as we don't need the textures to be backed by storage. 55 // requirements are low, as we don't need the textures to be backed by storage.
43 static const int kNumPictureBuffers = media::limits::kMaxVideoFrames + 1; 56 static const int kNumPictureBuffers = media::limits::kMaxVideoFrames + 1;
44 57
45 // Maximum number of frames to queue for reordering before we stop asking for 58 // Maximum number of frames to queue for reordering before we stop asking for
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 295
283 bool VTVideoDecodeAccelerator::Initialize( 296 bool VTVideoDecodeAccelerator::Initialize(
284 media::VideoCodecProfile profile, 297 media::VideoCodecProfile profile,
285 Client* client) { 298 Client* client) {
286 DCHECK(gpu_thread_checker_.CalledOnValidThread()); 299 DCHECK(gpu_thread_checker_.CalledOnValidThread());
287 client_ = client; 300 client_ = client;
288 301
289 if (!InitializeVideoToolbox()) 302 if (!InitializeVideoToolbox())
290 return false; 303 return false;
291 304
292 // Only H.264 with 4:2:0 chroma sampling is supported. 305 bool profile_supported = false;
293 if (profile < media::H264PROFILE_MIN || 306 for (const auto& supported_profile : kSupportedProfiles) {
294 profile > media::H264PROFILE_MAX || 307 if (profile == supported_profile) {
295 profile == media::H264PROFILE_HIGH422PROFILE || 308 profile_supported = true;
296 profile == media::H264PROFILE_HIGH444PREDICTIVEPROFILE) { 309 break;
310 }
311 }
312 if (!profile_supported)
297 return false; 313 return false;
298 }
299 314
300 // Spawn a thread to handle parsing and calling VideoToolbox. 315 // Spawn a thread to handle parsing and calling VideoToolbox.
301 if (!decoder_thread_.Start()) 316 if (!decoder_thread_.Start())
302 return false; 317 return false;
303 318
304 // Count the session as successfully initialized. 319 // Count the session as successfully initialized.
305 UMA_HISTOGRAM_ENUMERATION("Media.VTVDA.SessionFailureReason", 320 UMA_HISTOGRAM_ENUMERATION("Media.VTVDA.SessionFailureReason",
306 SFT_SUCCESSFULLY_INITIALIZED, 321 SFT_SUCCESSFULLY_INITIALIZED,
307 SFT_MAX + 1); 322 SFT_MAX + 1);
308 return true; 323 return true;
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 client_->NotifyEndOfBitstreamBuffer(bitstream_id); 1040 client_->NotifyEndOfBitstreamBuffer(bitstream_id);
1026 assigned_bitstream_ids_.clear(); 1041 assigned_bitstream_ids_.clear();
1027 state_ = STATE_DESTROYING; 1042 state_ = STATE_DESTROYING;
1028 QueueFlush(TASK_DESTROY); 1043 QueueFlush(TASK_DESTROY);
1029 } 1044 }
1030 1045
1031 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() { 1046 bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() {
1032 return false; 1047 return false;
1033 } 1048 }
1034 1049
1050 // static
1051 media::VideoDecodeAccelerator::SupportedProfiles
1052 VTVideoDecodeAccelerator::GetSupportedProfiles() {
1053 SupportedProfiles profiles;
1054 for (const auto& supported_profile : kSupportedProfiles) {
1055 SupportedProfile profile;
1056 profile.profile = supported_profile;
1057 profile.min_resolution.SetSize(480, 360);
1058 profile.max_resolution.SetSize(4096, 2160);
1059 profiles.push_back(profile);
1060 }
1061 return profiles;
1062 }
1063
1035 } // namespace content 1064 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698