| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/debug/trace_event.h" | 6 #include "base/debug/trace_event.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 bool VaapiVideoDecodeAccelerator::TFPPicture::Bind() { | 205 bool VaapiVideoDecodeAccelerator::TFPPicture::Bind() { |
| 206 DCHECK(CalledOnValidThread()); | 206 DCHECK(CalledOnValidThread()); |
| 207 DCHECK(x_pixmap_); | 207 DCHECK(x_pixmap_); |
| 208 DCHECK(glx_pixmap_); | 208 DCHECK(glx_pixmap_); |
| 209 if (!make_context_current_.Run()) | 209 if (!make_context_current_.Run()) |
| 210 return false; | 210 return false; |
| 211 | 211 |
| 212 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); | 212 gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); |
| 213 glXBindTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL); | 213 glXBindTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT, nullptr); |
| 214 | 214 |
| 215 return true; | 215 return true; |
| 216 } | 216 } |
| 217 | 217 |
| 218 VaapiVideoDecodeAccelerator::TFPPicture* | 218 VaapiVideoDecodeAccelerator::TFPPicture* |
| 219 VaapiVideoDecodeAccelerator::TFPPictureById(int32 picture_buffer_id) { | 219 VaapiVideoDecodeAccelerator::TFPPictureById(int32 picture_buffer_id) { |
| 220 TFPPictures::iterator it = tfp_pictures_.find(picture_buffer_id); | 220 TFPPictures::iterator it = tfp_pictures_.find(picture_buffer_id); |
| 221 if (it == tfp_pictures_.end()) { | 221 if (it == tfp_pictures_.end()) { |
| 222 LOG(ERROR) << "Picture id " << picture_buffer_id << " does not exist"; | 222 LOG(ERROR) << "Picture id " << picture_buffer_id << " does not exist"; |
| 223 return NULL; | 223 return nullptr; |
| 224 } | 224 } |
| 225 | 225 |
| 226 return it->second.get(); | 226 return it->second.get(); |
| 227 } | 227 } |
| 228 | 228 |
| 229 VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( | 229 VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( |
| 230 Display* x_display, | 230 Display* x_display, |
| 231 const base::Callback<bool(void)>& make_context_current) | 231 const base::Callback<bool(void)>& make_context_current) |
| 232 : x_display_(x_display), | 232 : x_display_(x_display), |
| 233 make_context_current_(make_context_current), | 233 make_context_current_(make_context_current), |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 917 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
| 918 Cleanup(); | 918 Cleanup(); |
| 919 delete this; | 919 delete this; |
| 920 } | 920 } |
| 921 | 921 |
| 922 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { | 922 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { |
| 923 return false; | 923 return false; |
| 924 } | 924 } |
| 925 | 925 |
| 926 } // namespace content | 926 } // namespace content |
| OLD | NEW |