vaapi_picture_native_pixmap_ozone.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2014 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_VAAPI_VAAPI_PICTURE_NATIVE_PIXMAP_OZONE_H_
  5. #define MEDIA_GPU_VAAPI_VAAPI_PICTURE_NATIVE_PIXMAP_OZONE_H_
  6. #include <stdint.h>
  7. #include "base/memory/ref_counted.h"
  8. #include "base/memory/weak_ptr.h"
  9. #include "media/gpu/vaapi/vaapi_picture_native_pixmap.h"
  10. #include "ui/gfx/buffer_types.h"
  11. #include "ui/gfx/geometry/size.h"
  12. namespace gfx {
  13. class NativePixmap;
  14. } // namespace gfx
  15. namespace media {
  16. class VaapiWrapper;
  17. // Implementation of VaapiPictureNativePixmap using Ozone.
  18. class VaapiPictureNativePixmapOzone : public VaapiPictureNativePixmap {
  19. public:
  20. VaapiPictureNativePixmapOzone(
  21. scoped_refptr<VaapiWrapper> vaapi_wrapper,
  22. const MakeGLContextCurrentCallback& make_context_current_cb,
  23. const BindGLImageCallback& bind_image_cb_,
  24. int32_t picture_buffer_id,
  25. const gfx::Size& size,
  26. const gfx::Size& visible_size,
  27. uint32_t texture_id,
  28. uint32_t client_texture_id,
  29. uint32_t texture_target);
  30. VaapiPictureNativePixmapOzone(const VaapiPictureNativePixmapOzone&) = delete;
  31. VaapiPictureNativePixmapOzone& operator=(
  32. const VaapiPictureNativePixmapOzone&) = delete;
  33. ~VaapiPictureNativePixmapOzone() override;
  34. // VaapiPicture implementation.
  35. VaapiStatus Allocate(gfx::BufferFormat format) override;
  36. bool ImportGpuMemoryBufferHandle(
  37. gfx::BufferFormat format,
  38. gfx::GpuMemoryBufferHandle gpu_memory_buffer_handle) override;
  39. private:
  40. VaapiStatus Initialize(scoped_refptr<gfx::NativePixmap> pixmap);
  41. };
  42. } // namespace media
  43. #endif // MEDIA_GPU_VAAPI_VAAPI_PICTURE_NATIVE_PIXMAP_OZONE_H_