| 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 "media/gpu/vaapi_tfp_picture.h" | 5 #include "media/gpu/vaapi_tfp_picture.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include "media/gpu/va_surface.h" | 9 #include "media/gpu/va_surface.h" |
| 10 #include "media/gpu/vaapi_wrapper.h" | 10 #include "media/gpu/vaapi_wrapper.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return false; | 51 return false; |
| 52 | 52 |
| 53 glx_image_ = new gl::GLImageGLX(size_, GL_RGB); | 53 glx_image_ = new gl::GLImageGLX(size_, GL_RGB); |
| 54 if (!glx_image_->Initialize(x_pixmap_)) { | 54 if (!glx_image_->Initialize(x_pixmap_)) { |
| 55 // x_pixmap_ will be freed in the destructor. | 55 // x_pixmap_ will be freed in the destructor. |
| 56 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; | 56 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 | 59 |
| 60 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); | 60 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); |
| 61 if (!glx_image_->BindTexImage(GL_TEXTURE_2D)) { | 61 if (!glx_image_->BindTexImage(GL_TEXTURE_2D, nullptr)) { |
| 62 LOG(ERROR) << "Failed to bind texture to glx image"; | 62 LOG(ERROR) << "Failed to bind texture to glx image"; |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 return true; | 67 return true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) { | 70 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) { |
| 71 if (format != gfx::BufferFormat::BGRX_8888 && | 71 if (format != gfx::BufferFormat::BGRX_8888 && |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool VaapiTFPPicture::DownloadFromSurface( | 99 bool VaapiTFPPicture::DownloadFromSurface( |
| 100 const scoped_refptr<VASurface>& va_surface) { | 100 const scoped_refptr<VASurface>& va_surface) { |
| 101 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_, | 101 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_, |
| 102 va_surface->size()); | 102 va_surface->size()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace media | 105 } // namespace media |
| OLD | NEW |