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..e664b1ff590010c1c0dd97d05e612329ff7147ec |
| --- /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. |
|
Pawel Osciak
2015/03/26 08:36:39
Convert |new_profiles| to their media equivalents
henryhsu_tw
2015/03/26 09:38:34
This function doesn't do convert. Only insert to a
|
| + static void InsertUniqueDecodeProfiles( |
| + const std::vector<media::VideoDecodeAccelerator::SupportedProfile>& |
| + new_profiles, |
| + std::vector<media::VideoDecodeAccelerator::SupportedProfile>* |
| + media_profiles); |
| + |
| + // Insert encoder media profiles without duplicate. |
|
Pawel Osciak
2015/03/26 08:36:39
Similarly here.
henryhsu_tw
2015/03/26 09:38:34
Done.
|
| + static void InsertUniqueEncodeProfiles( |
| + const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& |
| + new_profiles, |
| + std::vector<media::VideoEncodeAccelerator::SupportedProfile>* |
| + media_profiles); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_ACCELERATOR_UTIL_H_ |