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/numerics/safe_math.h" | 9 #include "base/numerics/safe_math.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
12 #include "media/gpu/gpu_video_decode_accelerator_factory_impl.h" | 12 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 namespace arc { | 15 namespace arc { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // An arbitrary chosen limit of the number of buffers. The number of | 19 // An arbitrary chosen limit of the number of buffers. The number of |
20 // buffers used is requested from the untrusted client side. | 20 // buffers used is requested from the untrusted client side. |
21 const size_t kMaxBufferCount = 128; | 21 const size_t kMaxBufferCount = 128; |
22 | 22 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 case HAL_PIXEL_FORMAT_VP8: | 104 case HAL_PIXEL_FORMAT_VP8: |
105 vda_config.profile = media::VP8PROFILE_ANY; | 105 vda_config.profile = media::VP8PROFILE_ANY; |
106 break; | 106 break; |
107 default: | 107 default: |
108 DLOG(ERROR) << "Unsupported input format: " << config.input_pixel_format; | 108 DLOG(ERROR) << "Unsupported input format: " << config.input_pixel_format; |
109 return INVALID_ARGUMENT; | 109 return INVALID_ARGUMENT; |
110 } | 110 } |
111 vda_config.output_mode = | 111 vda_config.output_mode = |
112 media::VideoDecodeAccelerator::Config::OutputMode::IMPORT; | 112 media::VideoDecodeAccelerator::Config::OutputMode::IMPORT; |
113 | 113 |
114 auto vda_factory = | 114 auto vda_factory = media::GpuVideoDecodeAcceleratorFactory::CreateWithNoGL(); |
115 media::GpuVideoDecodeAcceleratorFactoryImpl::CreateWithNoGL(); | |
116 vda_ = vda_factory->CreateVDA( | 115 vda_ = vda_factory->CreateVDA( |
117 this, vda_config, gpu::GpuDriverBugWorkarounds(), gpu_preferences_); | 116 this, vda_config, gpu::GpuDriverBugWorkarounds(), gpu_preferences_); |
118 if (!vda_) { | 117 if (!vda_) { |
119 DLOG(ERROR) << "Failed to create VDA."; | 118 DLOG(ERROR) << "Failed to create VDA."; |
120 return PLATFORM_FAILURE; | 119 return PLATFORM_FAILURE; |
121 } | 120 } |
122 | 121 |
123 client_count_++; | 122 client_count_++; |
124 DVLOG(5) << "Number of concurrent ArcVideoAccelerator clients: " | 123 DVLOG(5) << "Number of concurrent ArcVideoAccelerator clients: " |
125 << client_count_; | 124 << client_count_; |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 } | 493 } |
495 return true; | 494 return true; |
496 default: | 495 default: |
497 DLOG(ERROR) << "Invalid port: " << port; | 496 DLOG(ERROR) << "Invalid port: " << port; |
498 return false; | 497 return false; |
499 } | 498 } |
500 } | 499 } |
501 | 500 |
502 } // namespace arc | 501 } // namespace arc |
503 } // namespace chromeos | 502 } // namespace chromeos |
OLD | NEW |