| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 base::AutoLock lock(lock_); | 74 base::AutoLock lock(lock_); |
| 75 return decoder_status_; | 75 return decoder_status_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void VideoCaptureGpuJpegDecoder::DecodeCapturedData( | 78 void VideoCaptureGpuJpegDecoder::DecodeCapturedData( |
| 79 const uint8_t* data, | 79 const uint8_t* data, |
| 80 size_t in_buffer_size, | 80 size_t in_buffer_size, |
| 81 const media::VideoCaptureFormat& frame_format, | 81 const media::VideoCaptureFormat& frame_format, |
| 82 base::TimeTicks reference_time, | 82 base::TimeTicks reference_time, |
| 83 base::TimeDelta timestamp, | 83 base::TimeDelta timestamp, |
| 84 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer) { | 84 std::unique_ptr<device::VideoCaptureDevice::Client::Buffer> out_buffer) { |
| 85 DCHECK(CalledOnValidThread()); | 85 DCHECK(CalledOnValidThread()); |
| 86 DCHECK(decoder_); | 86 DCHECK(decoder_); |
| 87 | 87 |
| 88 TRACE_EVENT_ASYNC_BEGIN0("jpeg", "VideoCaptureGpuJpegDecoder decoding", | 88 TRACE_EVENT_ASYNC_BEGIN0("jpeg", "VideoCaptureGpuJpegDecoder decoding", |
| 89 next_bitstream_buffer_id_); | 89 next_bitstream_buffer_id_); |
| 90 TRACE_EVENT0("jpeg", "VideoCaptureGpuJpegDecoder::DecodeCapturedData"); | 90 TRACE_EVENT0("jpeg", "VideoCaptureGpuJpegDecoder::DecodeCapturedData"); |
| 91 | 91 |
| 92 // TODO(kcwu): enqueue decode requests in case decoding is not fast enough | 92 // TODO(kcwu): enqueue decode requests in case decoding is not fast enough |
| 93 // (say, if decoding time is longer than 16ms for 60fps 4k image) | 93 // (say, if decoding time is longer than 16ms for 60fps 4k image) |
| 94 { | 94 { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 lock_.AssertAcquired(); | 251 lock_.AssertAcquired(); |
| 252 return !decode_done_closure_.is_null(); | 252 return !decode_done_closure_.is_null(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { | 255 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { |
| 256 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", | 256 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", |
| 257 decoder_status_ == INIT_PASSED); | 257 decoder_status_ == INIT_PASSED); |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace content | 260 } // namespace content |
| OLD | NEW |