Chromium Code Reviews| Index: content/common/gpu/media/gpu_video_accelerator_util.h |
| diff --git a/content/common/gpu/media/gpu_video_accelerator_util.h b/content/common/gpu/media/gpu_video_accelerator_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1d3507c0fc5f321cefdd46f85f7f7746e060d83 |
| --- /dev/null |
| +++ b/content/common/gpu/media/gpu_video_accelerator_util.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ACCELERATOR_UTIL_H_ |
| +#define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ACCELERATOR_UTIL_H_ |
| + |
| +#include <vector> |
| + |
| +#include "gpu/config/gpu_info.h" |
| +#include "media/video/video_decode_accelerator.h" |
| +#include "media/video/video_encode_accelerator.h" |
| + |
| +namespace content { |
| + |
| +class GpuVideoAcceleratorUtil { |
| + public: |
| + // Convert decoder gpu profiles to media profiles. |
| + static std::vector<media::VideoDecodeAccelerator::SupportedProfile> |
| + ConvertGpuToMediaDecodeProfiles(const std::vector< |
| + gpu::VideoDecodeAcceleratorSupportedProfile>& gpu_profiles); |
| + |
| + // Convert decoder media profiles to gpu profiles. |
| + static std::vector<gpu::VideoDecodeAcceleratorSupportedProfile> |
| + ConvertMediaToGpuDecodeProfiles(const std::vector< |
| + media::VideoDecodeAccelerator::SupportedProfile>& media_profiles); |
| + |
| + // Convert encoder gpu profiles to media profiles. |
| + static std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
| + ConvertGpuToMediaEncodeProfiles(const std::vector< |
| + gpu::VideoEncodeAcceleratorSupportedProfile>& gpu_profiles); |
| + |
| + // Convert encoder media profiles to gpu profiles. |
| + static std::vector<gpu::VideoEncodeAcceleratorSupportedProfile> |
| + ConvertMediaToGpuEncodeProfiles(const std::vector< |
| + media::VideoEncodeAccelerator::SupportedProfile>& media_profiles); |
| + |
| + // Insert decoder media profiles without duplicate. |
| + static void UniqueInsertDecodeProfiles( |
|
wuchengli
2015/03/19 15:02:57
s/UniqueInsertDecodeProfiles/InsertUniqueDecodePro
henryhsu
2015/03/23 03:21:07
Done.
|
| + std::vector<media::VideoDecodeAccelerator::SupportedProfile>* |
| + media_profiles, |
| + const std::vector<media::VideoDecodeAccelerator::SupportedProfile>& |
|
wuchengli
2015/03/19 15:02:57
Input should be the first parameter. Output should
henryhsu
2015/03/23 03:21:07
Done.
|
| + new_profiles); |
| + |
| + // Insert encoder media profiles without duplicate. |
| + static void UniqueInsertEncodeProfiles( |
| + std::vector<media::VideoEncodeAccelerator::SupportedProfile>* |
| + media_profiles, |
| + const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& |
| + new_profiles); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ACCELERATOR_UTIL_H_ |