| 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 29 matching lines...) Expand all Loading... |
| 40 // |gpu_channel_host_| should outlive |decoder_|, so |gpu_channel_host_| | 40 // |gpu_channel_host_| should outlive |decoder_|, so |gpu_channel_host_| |
| 41 // must be released after |decoder_| has been destroyed. | 41 // must be released after |decoder_| has been destroyed. |
| 42 gpu_channel_host_ = nullptr; | 42 gpu_channel_host_ = nullptr; |
| 43 } | 43 } |
| 44 | 44 |
| 45 void VideoCaptureGpuJpegDecoder::Initialize() { | 45 void VideoCaptureGpuJpegDecoder::Initialize() { |
| 46 DCHECK(CalledOnValidThread()); | 46 DCHECK(CalledOnValidThread()); |
| 47 | 47 |
| 48 base::AutoLock lock(lock_); | 48 base::AutoLock lock(lock_); |
| 49 bool is_platform_supported = false; | 49 bool is_platform_supported = false; |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 51 // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish | 51 // Non-Linux platforms do not support HW JPEG decode now. Do not establish |
| 52 // gpu channel to avoid introducing overhead. | 52 // gpu channel to avoid introducing overhead. |
| 53 is_platform_supported = true; | 53 is_platform_supported = true; |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 if (!is_platform_supported || | 56 if (!is_platform_supported || |
| 57 base::CommandLine::ForCurrentProcess()->HasSwitch( | 57 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 58 switches::kDisableAcceleratedMjpegDecode)) { | 58 switches::kDisableAcceleratedMjpegDecode)) { |
| 59 decoder_status_ = FAILED; | 59 decoder_status_ = FAILED; |
| 60 RecordInitDecodeUMA_Locked(); | 60 RecordInitDecodeUMA_Locked(); |
| 61 return; | 61 return; |
| (...skipping 186 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 |