Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/gpu/arc_gpu_video_decode_accelerator.h" | 5 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram_macros.h" | |
| 9 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
| 10 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 11 #include "media/base/video_frame.h" | 12 #include "media/base/video_frame.h" |
| 12 #include "media/gpu/gpu_video_decode_accelerator_factory.h" | 13 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 namespace arc { | 16 namespace arc { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 ArcGpuVideoDecodeAccelerator::~ArcGpuVideoDecodeAccelerator() { | 64 ArcGpuVideoDecodeAccelerator::~ArcGpuVideoDecodeAccelerator() { |
| 64 DCHECK(thread_checker_.CalledOnValidThread()); | 65 DCHECK(thread_checker_.CalledOnValidThread()); |
| 65 if (vda_) { | 66 if (vda_) { |
| 66 client_count_--; | 67 client_count_--; |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| 70 ArcVideoAccelerator::Result ArcGpuVideoDecodeAccelerator::Initialize( | 71 ArcVideoAccelerator::Result ArcGpuVideoDecodeAccelerator::Initialize( |
| 71 const Config& config, | 72 const Config& config, |
| 72 ArcVideoAccelerator::Client* client) { | 73 ArcVideoAccelerator::Client* client) { |
| 74 auto result = InitializeTask(config, client); | |
| 75 UMA_HISTOGRAM_BOOLEAN("Media.ArcGpuVideoDecodeAccelerator.InitializeSuccess", | |
| 76 result == SUCCESS); | |
|
Pawel Osciak
2016/11/21 09:02:37
Should we instead record the full result status en
johnylin1
2016/11/21 15:39:58
Sounds good. Done.
| |
| 77 return result; | |
| 78 } | |
| 79 | |
| 80 ArcVideoAccelerator::Result ArcGpuVideoDecodeAccelerator::InitializeTask( | |
| 81 const Config& config, | |
| 82 ArcVideoAccelerator::Client* client) { | |
| 73 DVLOG(5) << "Initialize(device=" << config.device_type | 83 DVLOG(5) << "Initialize(device=" << config.device_type |
| 74 << ", input_pixel_format=" << config.input_pixel_format | 84 << ", input_pixel_format=" << config.input_pixel_format |
| 75 << ", num_input_buffers=" << config.num_input_buffers << ")"; | 85 << ", num_input_buffers=" << config.num_input_buffers << ")"; |
| 76 DCHECK(thread_checker_.CalledOnValidThread()); | 86 DCHECK(thread_checker_.CalledOnValidThread()); |
| 77 if (config.device_type != Config::DEVICE_DECODER) | 87 if (config.device_type != Config::DEVICE_DECODER) |
| 78 return INVALID_ARGUMENT; | 88 return INVALID_ARGUMENT; |
| 79 DCHECK(client); | 89 DCHECK(client); |
| 80 | 90 |
| 81 if (arc_client_) { | 91 if (arc_client_) { |
| 82 DLOG(ERROR) << "Re-Initialize() is not allowed"; | 92 DLOG(ERROR) << "Re-Initialize() is not allowed"; |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 } | 519 } |
| 510 return true; | 520 return true; |
| 511 default: | 521 default: |
| 512 DLOG(ERROR) << "Invalid port: " << port; | 522 DLOG(ERROR) << "Invalid port: " << port; |
| 513 return false; | 523 return false; |
| 514 } | 524 } |
| 515 } | 525 } |
| 516 | 526 |
| 517 } // namespace arc | 527 } // namespace arc |
| 518 } // namespace chromeos | 528 } // namespace chromeos |
| OLD | NEW |