generic_dmabuf_video_frame_mapper.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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_CHROMEOS_GENERIC_DMABUF_VIDEO_FRAME_MAPPER_H_
  5. #define MEDIA_GPU_CHROMEOS_GENERIC_DMABUF_VIDEO_FRAME_MAPPER_H_
  6. #include "media/gpu/media_gpu_export.h"
  7. #include "media/gpu/video_frame_mapper.h"
  8. namespace media {
  9. // The GenericDmaBufVideoFrameMapper implements functionality to map DMABUF-
  10. // backed video frames into memory.
  11. class MEDIA_GPU_EXPORT GenericDmaBufVideoFrameMapper : public VideoFrameMapper {
  12. public:
  13. static std::unique_ptr<GenericDmaBufVideoFrameMapper> Create(
  14. VideoPixelFormat format);
  15. GenericDmaBufVideoFrameMapper(const GenericDmaBufVideoFrameMapper&) = delete;
  16. GenericDmaBufVideoFrameMapper& operator=(
  17. const GenericDmaBufVideoFrameMapper&) = delete;
  18. ~GenericDmaBufVideoFrameMapper() override = default;
  19. // VideoFrameMapper implementation.
  20. scoped_refptr<VideoFrame> Map(scoped_refptr<const VideoFrame> video_frame,
  21. int permissions) const override;
  22. private:
  23. explicit GenericDmaBufVideoFrameMapper(VideoPixelFormat format);
  24. };
  25. } // namespace media
  26. #endif // MEDIA_GPU_CHROMEOS_GENERIC_DMABUF_VIDEO_FRAME_MAPPER_H_