OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/client/gpu_video_encode_accelerator_host.h" | 5 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "content/common/gpu/client/gpu_channel_host.h" | 9 #include "content/common/gpu/client/gpu_channel_host.h" |
10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_HIGH422PROFILE); | 95 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_HIGH422PROFILE); |
96 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_HIGH444PREDICTIVEPROFILE); | 96 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_HIGH444PREDICTIVEPROFILE); |
97 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_SCALABLEBASELINE); | 97 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_SCALABLEBASELINE); |
98 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_SCALABLEHIGH); | 98 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_SCALABLEHIGH); |
99 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_STEREOHIGH); | 99 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_STEREOHIGH); |
100 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_MULTIVIEWHIGH); | 100 STATIC_ASSERT_ENUM_MATCH(H264PROFILE_MULTIVIEWHIGH); |
101 STATIC_ASSERT_ENUM_MATCH(VP8PROFILE_ANY); | 101 STATIC_ASSERT_ENUM_MATCH(VP8PROFILE_ANY); |
102 STATIC_ASSERT_ENUM_MATCH(VP9PROFILE_ANY); | 102 STATIC_ASSERT_ENUM_MATCH(VP9PROFILE_ANY); |
103 STATIC_ASSERT_ENUM_MATCH(VIDEO_CODEC_PROFILE_MAX); | 103 STATIC_ASSERT_ENUM_MATCH(VIDEO_CODEC_PROFILE_MAX); |
104 | 104 |
| 105 // static |
105 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 106 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
106 GpuVideoEncodeAcceleratorHost::ConvertGpuToMediaProfiles(const std::vector< | 107 GpuVideoEncodeAcceleratorHost::ConvertGpuToMediaProfiles(const std::vector< |
107 gpu::VideoEncodeAcceleratorSupportedProfile>& gpu_profiles) { | 108 gpu::VideoEncodeAcceleratorSupportedProfile>& gpu_profiles) { |
108 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; | 109 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; |
109 for (size_t i = 0; i < gpu_profiles.size(); i++) { | 110 for (size_t i = 0; i < gpu_profiles.size(); i++) { |
110 media::VideoEncodeAccelerator::SupportedProfile profile; | 111 media::VideoEncodeAccelerator::SupportedProfile profile; |
111 profile.profile = | 112 profile.profile = |
112 static_cast<media::VideoCodecProfile>(gpu_profiles[i].profile); | 113 static_cast<media::VideoCodecProfile>(gpu_profiles[i].profile); |
113 profile.max_resolution = gpu_profiles[i].max_resolution; | 114 profile.max_resolution = gpu_profiles[i].max_resolution; |
114 profile.max_framerate_numerator = gpu_profiles[i].max_framerate_numerator; | 115 profile.max_framerate_numerator = gpu_profiles[i].max_framerate_numerator; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 weak_this_factory_.InvalidateWeakPtrs(); | 312 weak_this_factory_.InvalidateWeakPtrs(); |
312 | 313 |
313 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 314 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
314 // last thing done on this stack! | 315 // last thing done on this stack! |
315 media::VideoEncodeAccelerator::Client* client = NULL; | 316 media::VideoEncodeAccelerator::Client* client = NULL; |
316 std::swap(client_, client); | 317 std::swap(client_, client); |
317 client->NotifyError(error); | 318 client->NotifyError(error); |
318 } | 319 } |
319 | 320 |
320 } // namespace content | 321 } // namespace content |
OLD | NEW |