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). | |
376 if (client_) | 374 if (client_) |
377 client_->PictureReady( | 375 client_->PictureReady(media::Picture(output_id, input_id)); |
378 media::Picture(output_id, input_id, gfx::Rect(tfp_picture->size()))); | |
379 } | 376 } |
380 | 377 |
381 void VaapiVideoDecodeAccelerator::TryOutputSurface() { | 378 void VaapiVideoDecodeAccelerator::TryOutputSurface() { |
382 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 379 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
383 | 380 |
384 // Handle Destroy() arriving while pictures are queued for output. | 381 // Handle Destroy() arriving while pictures are queued for output. |
385 if (!client_) | 382 if (!client_) |
386 return; | 383 return; |
387 | 384 |
388 if (pending_output_cbs_.empty() || output_buffers_.empty()) | 385 if (pending_output_cbs_.empty() || output_buffers_.empty()) |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 DCHECK_EQ(message_loop_, base::MessageLoop::current()); | 914 DCHECK_EQ(message_loop_, base::MessageLoop::current()); |
918 Cleanup(); | 915 Cleanup(); |
919 delete this; | 916 delete this; |
920 } | 917 } |
921 | 918 |
922 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { | 919 bool VaapiVideoDecodeAccelerator::CanDecodeOnIOThread() { |
923 return false; | 920 return false; |
924 } | 921 } |
925 | 922 |
926 } // namespace content | 923 } // namespace content |
OLD | NEW |