| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_descriptor_posix.h" | 5 #include "base/file_descriptor_posix.h" |
| 6 #include "content/common/gpu/media/va_surface.h" | 6 #include "media/gpu/va_surface.h" |
| 7 #include "content/common/gpu/media/vaapi_drm_picture.h" | 7 #include "media/gpu/vaapi_drm_picture.h" |
| 8 #include "content/common/gpu/media/vaapi_wrapper.h" | 8 #include "media/gpu/vaapi_wrapper.h" |
| 9 #include "third_party/libva/va/drm/va_drm.h" | 9 #include "third_party/libva/va/drm/va_drm.h" |
| 10 #include "third_party/libva/va/va.h" | 10 #include "third_party/libva/va/va.h" |
| 11 #include "ui/gfx/gpu_memory_buffer.h" | 11 #include "ui/gfx/gpu_memory_buffer.h" |
| 12 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
| 13 #include "ui/gl/gl_image_ozone_native_pixmap.h" | 13 #include "ui/gl/gl_image_ozone_native_pixmap.h" |
| 14 #include "ui/gl/scoped_binders.h" | 14 #include "ui/gl/scoped_binders.h" |
| 15 #include "ui/ozone/public/native_pixmap.h" | 15 #include "ui/ozone/public/native_pixmap.h" |
| 16 #include "ui/ozone/public/ozone_platform.h" | 16 #include "ui/ozone/public/ozone_platform.h" |
| 17 #include "ui/ozone/public/surface_factory_ozone.h" | 17 #include "ui/ozone/public/surface_factory_ozone.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 // We decode video into YUV420, but for usage with GLImages we have to convert | 20 // We decode video into YUV420, but for usage with GLImages we have to convert |
| 21 // to BGRX_8888. | 21 // to BGRX_8888. |
| 22 const gfx::BufferFormat kPictureForGLImageFormat = gfx::BufferFormat::BGRX_8888; | 22 const gfx::BufferFormat kPictureForGLImageFormat = gfx::BufferFormat::BGRX_8888; |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 namespace content { | 26 namespace media { |
| 27 | 27 |
| 28 VaapiDrmPicture::VaapiDrmPicture( | 28 VaapiDrmPicture::VaapiDrmPicture( |
| 29 const scoped_refptr<VaapiWrapper>& vaapi_wrapper, | 29 const scoped_refptr<VaapiWrapper>& vaapi_wrapper, |
| 30 const MakeGLContextCurrentCallback& make_context_current_cb, | 30 const MakeGLContextCurrentCallback& make_context_current_cb, |
| 31 int32_t picture_buffer_id, | 31 int32_t picture_buffer_id, |
| 32 uint32_t texture_id, | 32 uint32_t texture_id, |
| 33 const gfx::Size& size) | 33 const gfx::Size& size) |
| 34 : VaapiPicture(picture_buffer_id, texture_id, size), | 34 : VaapiPicture(picture_buffer_id, texture_id, size), |
| 35 vaapi_wrapper_(vaapi_wrapper), | 35 vaapi_wrapper_(vaapi_wrapper), |
| 36 make_context_current_cb_(make_context_current_cb) {} | 36 make_context_current_cb_(make_context_current_cb) {} |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 scoped_refptr<gl::GLImage> VaapiDrmPicture::GetImageToBind() { | 95 scoped_refptr<gl::GLImage> VaapiDrmPicture::GetImageToBind() { |
| 96 return gl_image_; | 96 return gl_image_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool VaapiDrmPicture::AllowOverlay() const { | 99 bool VaapiDrmPicture::AllowOverlay() const { |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace | 103 } // namespace |
| OLD | NEW |