| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // Send the pending buffers for decoding. | 462 // Send the pending buffers for decoding. |
| 463 RequestBufferDecode(); | 463 RequestBufferDecode(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void RTCVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { | 466 void RTCVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) { |
| 467 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 467 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 468 if (!vda_) | 468 if (!vda_) |
| 469 return; | 469 return; |
| 470 | 470 |
| 471 LOG(ERROR) << "VDA Error:" << error; | 471 LOG(ERROR) << "VDA Error:" << error; |
| 472 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoDecoderError", | 472 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoDecoderError", error, |
| 473 error, | 473 media::VideoDecodeAccelerator::ERROR_MAX + 1); |
| 474 media::VideoDecodeAccelerator::LARGEST_ERROR_ENUM); | |
| 475 DestroyVDA(); | 474 DestroyVDA(); |
| 476 | 475 |
| 477 base::AutoLock auto_lock(lock_); | 476 base::AutoLock auto_lock(lock_); |
| 478 state_ = DECODE_ERROR; | 477 state_ = DECODE_ERROR; |
| 479 } | 478 } |
| 480 | 479 |
| 481 void RTCVideoDecoder::RequestBufferDecode() { | 480 void RTCVideoDecoder::RequestBufferDecode() { |
| 482 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 481 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 483 if (!vda_) | 482 if (!vda_) |
| 484 return; | 483 return; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 } | 806 } |
| 808 | 807 |
| 809 void RTCVideoDecoder::ClearPendingBuffers() { | 808 void RTCVideoDecoder::ClearPendingBuffers() { |
| 810 // Delete WebRTC input buffers. | 809 // Delete WebRTC input buffers. |
| 811 for (const auto& pending_buffer : pending_buffers_) | 810 for (const auto& pending_buffer : pending_buffers_) |
| 812 delete[] pending_buffer.first._buffer; | 811 delete[] pending_buffer.first._buffer; |
| 813 pending_buffers_.clear(); | 812 pending_buffers_.clear(); |
| 814 } | 813 } |
| 815 | 814 |
| 816 } // namespace content | 815 } // namespace content |
| OLD | NEW |