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" |
| 6 |
5 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
6 #include "base/logging.h" | 8 #include "base/logging.h" |
7 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
8 #include "chrome/gpu/arc_gpu_video_decode_accelerator.h" | |
9 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h" | 10 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h" |
10 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
11 | 12 |
12 namespace chromeos { | 13 namespace chromeos { |
13 namespace arc { | 14 namespace arc { |
14 | 15 |
15 ArcGpuVideoDecodeAccelerator::InputRecord::InputRecord( | 16 ArcGpuVideoDecodeAccelerator::InputRecord::InputRecord( |
16 int32_t bitstream_buffer_id, | 17 int32_t bitstream_buffer_id, |
17 uint32_t buffer_index, | 18 uint32_t buffer_index, |
18 int64_t timestamp) | 19 int64_t timestamp) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 case HAL_PIXEL_FORMAT_VP8: | 80 case HAL_PIXEL_FORMAT_VP8: |
80 vda_config.profile = media::VP8PROFILE_ANY; | 81 vda_config.profile = media::VP8PROFILE_ANY; |
81 break; | 82 break; |
82 default: | 83 default: |
83 DLOG(ERROR) << "Unsupported input format: " << config.input_pixel_format; | 84 DLOG(ERROR) << "Unsupported input format: " << config.input_pixel_format; |
84 return false; | 85 return false; |
85 } | 86 } |
86 vda_config.output_mode = | 87 vda_config.output_mode = |
87 media::VideoDecodeAccelerator::Config::OutputMode::IMPORT; | 88 media::VideoDecodeAccelerator::Config::OutputMode::IMPORT; |
88 | 89 |
89 scoped_ptr<content::GpuVideoDecodeAcceleratorFactory> vda_factory = | 90 std::unique_ptr<content::GpuVideoDecodeAcceleratorFactory> vda_factory = |
90 content::GpuVideoDecodeAcceleratorFactory::CreateWithNoGL(); | 91 content::GpuVideoDecodeAcceleratorFactory::CreateWithNoGL(); |
91 vda_ = vda_factory->CreateVDA(this, vda_config); | 92 vda_ = vda_factory->CreateVDA(this, vda_config); |
92 if (!vda_) { | 93 if (!vda_) { |
93 DLOG(ERROR) << "Failed to create VDA."; | 94 DLOG(ERROR) << "Failed to create VDA."; |
94 return false; | 95 return false; |
95 } | 96 } |
96 return true; | 97 return true; |
97 } | 98 } |
98 | 99 |
99 void ArcGpuVideoDecodeAccelerator::SetNumberOfOutputBuffers(size_t number) { | 100 void ArcGpuVideoDecodeAccelerator::SetNumberOfOutputBuffers(size_t number) { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 417 } |
417 return true; | 418 return true; |
418 default: | 419 default: |
419 DLOG(ERROR) << "Invalid port: " << port; | 420 DLOG(ERROR) << "Invalid port: " << port; |
420 return false; | 421 return false; |
421 } | 422 } |
422 } | 423 } |
423 | 424 |
424 } // namespace arc | 425 } // namespace arc |
425 } // namespace chromeos | 426 } // namespace chromeos |
OLD | NEW |