| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 gfx::BufferFormat format = pixmap_->GetBufferFormat(); | 77 gfx::BufferFormat format = pixmap_->GetBufferFormat(); |
| 78 | 78 |
| 79 scoped_refptr<ui::GLImageOzoneNativePixmap> image( | 79 scoped_refptr<ui::GLImageOzoneNativePixmap> image( |
| 80 new ui::GLImageOzoneNativePixmap(size_, | 80 new ui::GLImageOzoneNativePixmap(size_, |
| 81 BufferFormatToInternalFormat(format))); | 81 BufferFormatToInternalFormat(format))); |
| 82 if (!image->Initialize(pixmap_.get(), format)) { | 82 if (!image->Initialize(pixmap_.get(), format)) { |
| 83 LOG(ERROR) << "Failed to create GLImage"; | 83 LOG(ERROR) << "Failed to create GLImage"; |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 gl_image_ = image; | 86 gl_image_ = image; |
| 87 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) { | 87 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES, nullptr)) { |
| 88 LOG(ERROR) << "Failed to bind texture to GLImage"; | 88 LOG(ERROR) << "Failed to bind texture to GLImage"; |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 if (client_texture_id_ != 0 && !bind_image_cb_.is_null()) { | 93 if (client_texture_id_ != 0 && !bind_image_cb_.is_null()) { |
| 94 if (!bind_image_cb_.Run(client_texture_id_, GL_TEXTURE_EXTERNAL_OES, | 94 if (!bind_image_cb_.Run(client_texture_id_, GL_TEXTURE_EXTERNAL_OES, |
| 95 gl_image_, true)) { | 95 gl_image_, true)) { |
| 96 LOG(ERROR) << "Failed to bind client_texture_id"; | 96 LOG(ERROR) << "Failed to bind client_texture_id"; |
| 97 return false; | 97 return false; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool VaapiDrmPicture::DownloadFromSurface( | 134 bool VaapiDrmPicture::DownloadFromSurface( |
| 135 const scoped_refptr<VASurface>& va_surface) { | 135 const scoped_refptr<VASurface>& va_surface) { |
| 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); | 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool VaapiDrmPicture::AllowOverlay() const { | 139 bool VaapiDrmPicture::AllowOverlay() const { |
| 140 return true; | 140 return true; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace media | 143 } // namespace media |
| OLD | NEW |