OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h" | 5 #include "content/browser/renderer_host/media/video_capture_gpu_jpeg_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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 | 192 |
193 // static | 193 // static |
194 void VideoCaptureGpuJpegDecoder::EstablishGpuChannelOnUIThread( | 194 void VideoCaptureGpuJpegDecoder::EstablishGpuChannelOnUIThread( |
195 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 195 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
196 base::WeakPtr<VideoCaptureGpuJpegDecoder> weak_this) { | 196 base::WeakPtr<VideoCaptureGpuJpegDecoder> weak_this) { |
197 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 197 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
198 DCHECK(BrowserGpuChannelHostFactory::instance()); | 198 DCHECK(BrowserGpuChannelHostFactory::instance()); |
199 | 199 |
200 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannel( | 200 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannel( |
201 CAUSE_FOR_GPU_LAUNCH_JPEGDECODEACCELERATOR_INITIALIZE, | 201 gpu::CAUSE_FOR_GPU_LAUNCH_JPEGDECODEACCELERATOR_INITIALIZE, |
202 base::Bind(&VideoCaptureGpuJpegDecoder::GpuChannelEstablishedOnUIThread, | 202 base::Bind(&VideoCaptureGpuJpegDecoder::GpuChannelEstablishedOnUIThread, |
203 task_runner, weak_this)); | 203 task_runner, weak_this)); |
204 } | 204 } |
205 | 205 |
206 // static | 206 // static |
207 void VideoCaptureGpuJpegDecoder::GpuChannelEstablishedOnUIThread( | 207 void VideoCaptureGpuJpegDecoder::GpuChannelEstablishedOnUIThread( |
208 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 208 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
209 base::WeakPtr<VideoCaptureGpuJpegDecoder> weak_this) { | 209 base::WeakPtr<VideoCaptureGpuJpegDecoder> weak_this) { |
210 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 210 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
211 | 211 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 lock_.AssertAcquired(); | 248 lock_.AssertAcquired(); |
249 return !decode_done_closure_.is_null(); | 249 return !decode_done_closure_.is_null(); |
250 } | 250 } |
251 | 251 |
252 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { | 252 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { |
253 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", | 253 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", |
254 decoder_status_ == INIT_PASSED); | 254 decoder_status_ == INIT_PASSED); |
255 } | 255 } |
256 | 256 |
257 } // namespace content | 257 } // namespace content |
OLD | NEW |