vaapi_common.cc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #include "media/gpu/vaapi/vaapi_common.h"
  5. #include "build/chromeos_buildflags.h"
  6. namespace media {
  7. VaapiH264Picture::VaapiH264Picture(scoped_refptr<VASurface> va_surface)
  8. : va_surface_(va_surface) {}
  9. VaapiH264Picture::~VaapiH264Picture() = default;
  10. VaapiH264Picture* VaapiH264Picture::AsVaapiH264Picture() {
  11. return this;
  12. }
  13. #if BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
  14. VaapiH265Picture::VaapiH265Picture(scoped_refptr<VASurface> va_surface)
  15. : va_surface_(va_surface) {}
  16. VaapiH265Picture::~VaapiH265Picture() = default;
  17. VaapiH265Picture* VaapiH265Picture::AsVaapiH265Picture() {
  18. return this;
  19. }
  20. #endif // BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
  21. VaapiVP8Picture::VaapiVP8Picture(scoped_refptr<VASurface> va_surface)
  22. : va_surface_(va_surface) {}
  23. VaapiVP8Picture::~VaapiVP8Picture() = default;
  24. VaapiVP8Picture* VaapiVP8Picture::AsVaapiVP8Picture() {
  25. return this;
  26. }
  27. VaapiVP9Picture::VaapiVP9Picture(scoped_refptr<VASurface> va_surface)
  28. : va_surface_(va_surface) {}
  29. VaapiVP9Picture::~VaapiVP9Picture() = default;
  30. VaapiVP9Picture* VaapiVP9Picture::AsVaapiVP9Picture() {
  31. return this;
  32. }
  33. scoped_refptr<VP9Picture> VaapiVP9Picture::CreateDuplicate() {
  34. return new VaapiVP9Picture(va_surface_);
  35. }
  36. VaapiAV1Picture::VaapiAV1Picture(
  37. scoped_refptr<VASurface> display_va_surface,
  38. scoped_refptr<VASurface> reconstruct_va_surface)
  39. : display_va_surface_(std::move(display_va_surface)),
  40. reconstruct_va_surface_(std::move(reconstruct_va_surface)) {}
  41. VaapiAV1Picture::~VaapiAV1Picture() = default;
  42. scoped_refptr<AV1Picture> VaapiAV1Picture::CreateDuplicate() {
  43. return base::MakeRefCounted<VaapiAV1Picture>(display_va_surface_,
  44. reconstruct_va_surface_);
  45. }
  46. } // namespace media