| 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 "base/bind.h" |    7 #include "base/bind.h" | 
|    8 #include "base/logging.h" |    8 #include "base/logging.h" | 
|    9 #include "base/memory/ref_counted.h" |    9 #include "base/memory/ref_counted.h" | 
|   10 #include "base/metrics/histogram.h" |   10 #include "base/metrics/histogram.h" | 
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  667 } |  667 } | 
|  668  |  668  | 
|  669 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, |  669 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, | 
|  670                                 base::WaitableEvent* waiter) { |  670                                 base::WaitableEvent* waiter) { | 
|  671   DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |  671   DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 
|  672  |  672  | 
|  673   if (!IsProfileSupported(profile)) { |  673   if (!IsProfileSupported(profile)) { | 
|  674     DVLOG(1) << "Unsupported profile " << profile; |  674     DVLOG(1) << "Unsupported profile " << profile; | 
|  675   } else { |  675   } else { | 
|  676     vda_ = factories_->CreateVideoDecodeAccelerator(); |  676     vda_ = factories_->CreateVideoDecodeAccelerator(); | 
|  677     if (vda_ && !vda_->Initialize(profile, this)) |  677  | 
 |  678     media::VideoDecodeAccelerator::StreamParameters stream_params(profile); | 
 |  679     if (vda_ && !vda_->Initialize(stream_params, this)) | 
|  678       vda_.release()->Destroy(); |  680       vda_.release()->Destroy(); | 
|  679   } |  681   } | 
|  680  |  682  | 
|  681   waiter->Signal(); |  683   waiter->Signal(); | 
|  682 } |  684 } | 
|  683  |  685  | 
|  684 void RTCVideoDecoder::DestroyTextures() { |  686 void RTCVideoDecoder::DestroyTextures() { | 
|  685   DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |  687   DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 
|  686  |  688  | 
|  687   // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since |  689   // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  803 } |  805 } | 
|  804  |  806  | 
|  805 void RTCVideoDecoder::ClearPendingBuffers() { |  807 void RTCVideoDecoder::ClearPendingBuffers() { | 
|  806   // Delete WebRTC input buffers. |  808   // Delete WebRTC input buffers. | 
|  807   for (const auto& pending_buffer : pending_buffers_) |  809   for (const auto& pending_buffer : pending_buffers_) | 
|  808     delete[] pending_buffer.first._buffer; |  810     delete[] pending_buffer.first._buffer; | 
|  809   pending_buffers_.clear(); |  811   pending_buffers_.clear(); | 
|  810 } |  812 } | 
|  811  |  813  | 
|  812 }  // namespace content |  814 }  // namespace content | 
| OLD | NEW |