video_frame_mapper_factory.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2018 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_VIDEO_FRAME_MAPPER_FACTORY_H_
  5. #define MEDIA_GPU_VIDEO_FRAME_MAPPER_FACTORY_H_
  6. #include <memory>
  7. #include "media/base/video_types.h"
  8. #include "media/gpu/media_gpu_export.h"
  9. #include "media/gpu/video_frame_mapper.h"
  10. namespace media {
  11. // A factory function for VideoFrameMapper.
  12. // The appropriate VideoFrameMapper is a platform-dependent.
  13. class MEDIA_GPU_EXPORT VideoFrameMapperFactory {
  14. public:
  15. // Create an instance of the frame mapper that maps a video frame whose format
  16. // is |format| and storage type is |storage_type|.
  17. static std::unique_ptr<VideoFrameMapper> CreateMapper(
  18. VideoPixelFormat format,
  19. VideoFrame::StorageType storage_type);
  20. // |linear_buffer_mapper| stands for a created mapper type. If true, the
  21. // mapper will expect frames passed to it to be in linear format.
  22. static std::unique_ptr<VideoFrameMapper> CreateMapper(
  23. VideoPixelFormat format,
  24. VideoFrame::StorageType storage_type,
  25. bool force_linear_buffer_mapper);
  26. };
  27. } // namespace media
  28. #endif // MEDIA_GPU_VIDEO_FRAME_MAPPER_FACTORY_H_