| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return os_large_video_support && hw_large_video_support; | 129 return os_large_video_support && hw_large_video_support; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // Report |status| to UMA and run |cb| with it. This is super-specific to the | 132 // Report |status| to UMA and run |cb| with it. This is super-specific to the |
| 133 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a | 133 // UMA stat reported because the UMA_HISTOGRAM_ENUMERATION API requires a |
| 134 // callsite to always be called with the same stat name (can't parameterize it). | 134 // callsite to always be called with the same stat name (can't parameterize it). |
| 135 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB( | 135 static void ReportGpuVideoDecoderInitializeStatusToUMAAndRunCB( |
| 136 const PipelineStatusCB& cb, | 136 const PipelineStatusCB& cb, |
| 137 PipelineStatus status) { | 137 PipelineStatus status) { |
| 138 UMA_HISTOGRAM_ENUMERATION( | 138 UMA_HISTOGRAM_ENUMERATION( |
| 139 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX); | 139 "Media.GpuVideoDecoderInitializeStatus", status, PIPELINE_STATUS_MAX + 1); |
| 140 cb.Run(status); | 140 cb.Run(status); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config, | 143 void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config, |
| 144 const PipelineStatusCB& orig_status_cb) { | 144 const PipelineStatusCB& orig_status_cb) { |
| 145 DVLOG(3) << "Initialize()"; | 145 DVLOG(3) << "Initialize()"; |
| 146 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 146 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 147 DCHECK(config.IsValidConfig()); | 147 DCHECK(config.IsValidConfig()); |
| 148 DCHECK(!config.is_encrypted()); | 148 DCHECK(!config.is_encrypted()); |
| 149 | 149 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return; | 646 return; |
| 647 } | 647 } |
| 648 } | 648 } |
| 649 | 649 |
| 650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 651 const { | 651 const { |
| 652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 653 } | 653 } |
| 654 | 654 |
| 655 } // namespace media | 655 } // namespace media |
| OLD | NEW |