| 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 "media/gpu/va_surface.h" | 6 #include "media/gpu/va_surface.h" |
| 7 #include "media/gpu/vaapi_drm_picture.h" | 7 #include "media/gpu/vaapi_drm_picture.h" |
| 8 #include "media/gpu/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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { | 44 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { |
| 45 switch (format) { | 45 switch (format) { |
| 46 case gfx::BufferFormat::BGRA_8888: | 46 case gfx::BufferFormat::BGRA_8888: |
| 47 return GL_BGRA_EXT; | 47 return GL_BGRA_EXT; |
| 48 | 48 |
| 49 case gfx::BufferFormat::YVU_420: | 49 case gfx::BufferFormat::YVU_420: |
| 50 return GL_RGB_YCRCB_420_CHROMIUM; | 50 return GL_RGB_YCRCB_420_CHROMIUM; |
| 51 | 51 |
| 52 case gfx::BufferFormat::UYVY_422: |
| 53 case gfx::BufferFormat::YUYV_422: |
| 54 return GL_RGB_YCBCR_422_CHROMIUM; |
| 55 |
| 52 default: | 56 default: |
| 53 NOTREACHED(); | 57 NOTREACHED(); |
| 54 return GL_BGRA_EXT; | 58 return GL_BGRA_EXT; |
| 55 } | 59 } |
| 56 } | 60 } |
| 57 | 61 |
| 58 bool VaapiDrmPicture::Initialize() { | 62 bool VaapiDrmPicture::Initialize() { |
| 59 DCHECK(pixmap_); | 63 DCHECK(pixmap_); |
| 60 | 64 |
| 61 va_surface_ = vaapi_wrapper_->CreateVASurfaceForPixmap(pixmap_); | 65 va_surface_ = vaapi_wrapper_->CreateVASurfaceForPixmap(pixmap_); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool VaapiDrmPicture::DownloadFromSurface( | 138 bool VaapiDrmPicture::DownloadFromSurface( |
| 135 const scoped_refptr<VASurface>& va_surface) { | 139 const scoped_refptr<VASurface>& va_surface) { |
| 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); | 140 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); |
| 137 } | 141 } |
| 138 | 142 |
| 139 bool VaapiDrmPicture::AllowOverlay() const { | 143 bool VaapiDrmPicture::AllowOverlay() const { |
| 140 return true; | 144 return true; |
| 141 } | 145 } |
| 142 | 146 |
| 143 } // namespace media | 147 } // namespace media |
| OLD | NEW |