| 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 19 matching lines...) Expand all Loading... |
| 30 make_context_current_cb, | 30 make_context_current_cb, |
| 31 bind_image_cb, | 31 bind_image_cb, |
| 32 picture_buffer_id, | 32 picture_buffer_id, |
| 33 size, | 33 size, |
| 34 texture_id, | 34 texture_id, |
| 35 client_texture_id) {} | 35 client_texture_id) {} |
| 36 | 36 |
| 37 VaapiDrmPicture::~VaapiDrmPicture() { | 37 VaapiDrmPicture::~VaapiDrmPicture() { |
| 38 if (gl_image_ && make_context_current_cb_.Run()) { | 38 if (gl_image_ && make_context_current_cb_.Run()) { |
| 39 gl_image_->ReleaseTexImage(GL_TEXTURE_EXTERNAL_OES); | 39 gl_image_->ReleaseTexImage(GL_TEXTURE_EXTERNAL_OES); |
| 40 gl_image_->Destroy(true); | |
| 41 | |
| 42 DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR)); | 40 DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR)); |
| 43 } | 41 } |
| 44 } | 42 } |
| 45 | 43 |
| 46 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { | 44 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { |
| 47 switch (format) { | 45 switch (format) { |
| 48 case gfx::BufferFormat::BGRA_8888: | 46 case gfx::BufferFormat::BGRA_8888: |
| 49 return GL_BGRA_EXT; | 47 return GL_BGRA_EXT; |
| 50 | 48 |
| 51 case gfx::BufferFormat::YVU_420: | 49 case gfx::BufferFormat::YVU_420: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 bool VaapiDrmPicture::DownloadFromSurface( | 134 bool VaapiDrmPicture::DownloadFromSurface( |
| 137 const scoped_refptr<VASurface>& va_surface) { | 135 const scoped_refptr<VASurface>& va_surface) { |
| 138 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); | 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); |
| 139 } | 137 } |
| 140 | 138 |
| 141 bool VaapiDrmPicture::AllowOverlay() const { | 139 bool VaapiDrmPicture::AllowOverlay() const { |
| 142 return true; | 140 return true; |
| 143 } | 141 } |
| 144 | 142 |
| 145 } // namespace media | 143 } // namespace media |
| OLD | NEW |