| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), | 364 vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), |
| 365 tfp_picture->x_pixmap(), | 365 tfp_picture->x_pixmap(), |
| 366 tfp_picture->size()), | 366 tfp_picture->size()), |
| 367 "Failed putting surface into pixmap", PLATFORM_FAILURE, ); | 367 "Failed putting surface into pixmap", PLATFORM_FAILURE, ); |
| 368 | 368 |
| 369 // Notify the client a picture is ready to be displayed. | 369 // Notify the client a picture is ready to be displayed. |
| 370 ++num_frames_at_client_; | 370 ++num_frames_at_client_; |
| 371 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); | 371 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); |
| 372 DVLOG(4) << "Notifying output picture id " << output_id | 372 DVLOG(4) << "Notifying output picture id " << output_id |
| 373 << " for input "<< input_id << " is ready"; | 373 << " for input "<< input_id << " is ready"; |
| 374 // TODO(posciak): Use visible size from decoder here instead |
| 375 // (crbug.com/402760). |
| 374 if (client_) | 376 if (client_) |
| 375 client_->PictureReady(media::Picture(output_id, input_id)); | 377 client_->PictureReady( |
| 378 media::Picture(output_id, input_id, tfp_picture->size())); |
| 376 } | 379 } |
| 377 | 380 |
| 378 void VaapiVideoDecodeAccelerator::TryOutputSurface() { | 381 void VaapiVideoDecodeAccelerator::TryOutputSurface() { |
| 379 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 382 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
| 380 | 383 |
| 381 // Handle Destroy() arriving while pictures are queued for output. | 384 // Handle Destroy() arriving while pictures are queued for output. |
| 382 if (!client_) | 385 if (!client_) |
| 383 return; | 386 return; |
| 384 | 387 |
| 385 if (pending_output_cbs_.empty() || output_buffers_.empty()) | 388 if (pending_output_cbs_.empty() || output_buffers_.empty()) |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 917 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
| 915 Cleanup(); | 918 Cleanup(); |
| 916 delete this; | 919 delete this; |
| 917 } | 920 } |
| 918 | 921 |
| 919 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { | 922 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { |
| 920 return false; | 923 return false; |
| 921 } | 924 } |
| 922 | 925 |
| 923 } // namespace content | 926 } // namespace content |
| OLD | NEW |