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 "content/common/gpu/media/vaapi_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/vaapi_video_encode_accelerator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 | 107 |
108 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 108 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
109 VaapiVideoEncodeAccelerator::GetSupportedProfiles() { | 109 VaapiVideoEncodeAccelerator::GetSupportedProfiles() { |
110 std::vector<SupportedProfile> profiles; | 110 std::vector<SupportedProfile> profiles; |
111 | 111 |
112 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 112 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
113 if (cmd_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode)) | 113 if (cmd_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode)) |
114 return profiles; | 114 return profiles; |
115 | 115 |
116 std::vector<media::VideoCodecProfile> hw_profiles = | 116 std::vector<media::VideoCodecProfile> hw_profiles = |
117 VaapiWrapper::GetSupportedEncodeProfiles(base::Bind(&base::DoNothing)); | 117 VaapiWrapper::GetSupportedProfiles(VaapiWrapper::kEncode); |
118 | 118 |
119 media::VideoEncodeAccelerator::SupportedProfile profile; | 119 media::VideoEncodeAccelerator::SupportedProfile profile; |
120 profile.max_resolution.SetSize(1920, 1088); | 120 profile.max_resolution.SetSize(1920, 1088); |
wuchengli
2015/02/03 03:17:33
remove
henryhsu
2015/02/13 04:01:03
Done.
| |
121 profile.max_framerate_numerator = kDefaultFramerate; | 121 profile.max_framerate_numerator = kDefaultFramerate; |
122 profile.max_framerate_denominator = 1; | 122 profile.max_framerate_denominator = 1; |
123 for (size_t i = 0; i < hw_profiles.size(); i++) { | 123 for (size_t i = 0; i < hw_profiles.size(); i++) { |
124 profile.profile = hw_profiles[i]; | 124 profile.profile = hw_profiles[i]; |
125 profile.max_resolution = VaapiWrapper::GetCodecMaxResolution( | |
126 profile.profile, | |
127 VaapiWrapper::kEncode); | |
125 profiles.push_back(profile); | 128 profiles.push_back(profile); |
126 } | 129 } |
127 return profiles; | 130 return profiles; |
128 } | 131 } |
129 | 132 |
130 static unsigned int Log2OfPowerOf2(unsigned int x) { | 133 static unsigned int Log2OfPowerOf2(unsigned int x) { |
131 CHECK_GT(x, 0u); | 134 CHECK_GT(x, 0u); |
132 DCHECK_EQ(x & (x - 1), 0u); | 135 DCHECK_EQ(x & (x - 1), 0u); |
133 | 136 |
134 int log = 0; | 137 int log = 0; |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1080 } | 1083 } |
1081 | 1084 |
1082 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() | 1085 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() |
1083 : coded_buffer(VA_INVALID_ID), keyframe(false) { | 1086 : coded_buffer(VA_INVALID_ID), keyframe(false) { |
1084 } | 1087 } |
1085 | 1088 |
1086 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { | 1089 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { |
1087 } | 1090 } |
1088 | 1091 |
1089 } // namespace content | 1092 } // namespace content |
OLD | NEW |