gpu_video_encode_accelerator_factory.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_GPU_GPU_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_
  5. #define MEDIA_GPU_GPU_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_
  6. #include <memory>
  7. #include "gpu/config/gpu_info.h"
  8. #include "media/gpu/media_gpu_export.h"
  9. #include "media/video/video_encode_accelerator.h"
  10. namespace gpu {
  11. struct GpuPreferences;
  12. class GpuDriverBugWorkarounds;
  13. } // namespace gpu
  14. namespace media {
  15. class MEDIA_GPU_EXPORT GpuVideoEncodeAcceleratorFactory {
  16. public:
  17. GpuVideoEncodeAcceleratorFactory() = delete;
  18. GpuVideoEncodeAcceleratorFactory(const GpuVideoEncodeAcceleratorFactory&) =
  19. delete;
  20. GpuVideoEncodeAcceleratorFactory& operator=(
  21. const GpuVideoEncodeAcceleratorFactory&) = delete;
  22. // Creates and Initializes a VideoEncodeAccelerator. Returns nullptr
  23. // if there is no implementation available on the platform or calling
  24. // VideoEncodeAccelerator::Initialize() returns false.
  25. static std::unique_ptr<VideoEncodeAccelerator> CreateVEA(
  26. const VideoEncodeAccelerator::Config& config,
  27. VideoEncodeAccelerator::Client* client,
  28. const gpu::GpuPreferences& gpu_perferences,
  29. const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
  30. const gpu::GPUInfo::GPUDevice& gpu_device,
  31. std::unique_ptr<MediaLog> media_log = nullptr);
  32. // Gets the supported codec profiles for video encoding on the platform.
  33. // If |populate_extended_info| it false, this function will only populate:
  34. // codec, framerate range and resolution range. It's faster.
  35. static VideoEncodeAccelerator::SupportedProfiles GetSupportedProfiles(
  36. const gpu::GpuPreferences& gpu_preferences,
  37. const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
  38. const gpu::GPUInfo::GPUDevice& gpu_device,
  39. bool populate_extended_info = true);
  40. };
  41. } // namespace media
  42. #endif // MEDIA_GPU_GPU_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_