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

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

Issue 1490333005: Don't require VDAs to return all PictureBuffers at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/gpu_video_accelerator_util.h" 5 #include "content/common/gpu/media/gpu_video_accelerator_util.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 // Make sure the enum values of media::VideoCodecProfile and 9 // Make sure the enum values of media::VideoCodecProfile and
10 // gpu::VideoCodecProfile match. 10 // gpu::VideoCodecProfile match.
(...skipping 23 matching lines...) Expand all
34 media::VideoDecodeAccelerator::SupportedProfiles 34 media::VideoDecodeAccelerator::SupportedProfiles
35 GpuVideoAcceleratorUtil::ConvertGpuToMediaDecodeProfiles(const 35 GpuVideoAcceleratorUtil::ConvertGpuToMediaDecodeProfiles(const
36 gpu::VideoDecodeAcceleratorSupportedProfiles& gpu_profiles) { 36 gpu::VideoDecodeAcceleratorSupportedProfiles& gpu_profiles) {
37 media::VideoDecodeAccelerator::SupportedProfiles profiles; 37 media::VideoDecodeAccelerator::SupportedProfiles profiles;
38 for (const auto& gpu_profile : gpu_profiles) { 38 for (const auto& gpu_profile : gpu_profiles) {
39 media::VideoDecodeAccelerator::SupportedProfile profile; 39 media::VideoDecodeAccelerator::SupportedProfile profile;
40 profile.profile = 40 profile.profile =
41 static_cast<media::VideoCodecProfile>(gpu_profile.profile); 41 static_cast<media::VideoCodecProfile>(gpu_profile.profile);
42 profile.max_resolution = gpu_profile.max_resolution; 42 profile.max_resolution = gpu_profile.max_resolution;
43 profile.min_resolution = gpu_profile.min_resolution; 43 profile.min_resolution = gpu_profile.min_resolution;
44 profile.flags = static_cast<
45 media::VideoDecodeAccelerator::SupportedProfile::ProfileFlags>(
46 gpu_profile.flags);
44 profiles.push_back(profile); 47 profiles.push_back(profile);
45 } 48 }
46 return profiles; 49 return profiles;
47 } 50 }
48 51
49 // static 52 // static
50 gpu::VideoDecodeAcceleratorSupportedProfiles 53 gpu::VideoDecodeAcceleratorSupportedProfiles
51 GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(const 54 GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(const
52 media::VideoDecodeAccelerator::SupportedProfiles& media_profiles) { 55 media::VideoDecodeAccelerator::SupportedProfiles& media_profiles) {
53 gpu::VideoDecodeAcceleratorSupportedProfiles profiles; 56 gpu::VideoDecodeAcceleratorSupportedProfiles profiles;
54 for (const auto& media_profile : media_profiles) { 57 for (const auto& media_profile : media_profiles) {
55 gpu::VideoDecodeAcceleratorSupportedProfile profile; 58 gpu::VideoDecodeAcceleratorSupportedProfile profile;
56 profile.profile = 59 profile.profile =
57 static_cast<gpu::VideoCodecProfile>(media_profile.profile); 60 static_cast<gpu::VideoCodecProfile>(media_profile.profile);
58 profile.max_resolution = media_profile.max_resolution; 61 profile.max_resolution = media_profile.max_resolution;
59 profile.min_resolution = media_profile.min_resolution; 62 profile.min_resolution = media_profile.min_resolution;
63 profile.flags = static_cast<uint32>(media_profile.flags);
60 profiles.push_back(profile); 64 profiles.push_back(profile);
61 } 65 }
62 return profiles; 66 return profiles;
63 } 67 }
64 68
65 // static 69 // static
66 media::VideoEncodeAccelerator::SupportedProfiles 70 media::VideoEncodeAccelerator::SupportedProfiles
67 GpuVideoAcceleratorUtil::ConvertGpuToMediaEncodeProfiles(const 71 GpuVideoAcceleratorUtil::ConvertGpuToMediaEncodeProfiles(const
68 gpu::VideoEncodeAcceleratorSupportedProfiles& gpu_profiles) { 72 gpu::VideoEncodeAcceleratorSupportedProfiles& gpu_profiles) {
69 media::VideoEncodeAccelerator::SupportedProfiles profiles; 73 media::VideoEncodeAccelerator::SupportedProfiles profiles;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 duplicate = true; 128 duplicate = true;
125 break; 129 break;
126 } 130 }
127 } 131 }
128 if (!duplicate) 132 if (!duplicate)
129 media_profiles->push_back(profile); 133 media_profiles->push_back(profile);
130 } 134 }
131 } 135 }
132 136
133 } // namespace content 137 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698