OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/renderer/pepper/pepper_video_decoder_host.h" | 5 #include "content/renderer/pepper/pepper_video_decoder_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 profile_ = PepperToMediaVideoProfile(profile); | 142 profile_ = PepperToMediaVideoProfile(profile); |
143 software_fallback_allowed_ = (acceleration != PP_HARDWAREACCELERATION_ONLY); | 143 software_fallback_allowed_ = (acceleration != PP_HARDWAREACCELERATION_ONLY); |
144 | 144 |
145 min_picture_count_ = min_picture_count; | 145 min_picture_count_ = min_picture_count; |
146 | 146 |
147 if (acceleration != PP_HARDWAREACCELERATION_NONE) { | 147 if (acceleration != PP_HARDWAREACCELERATION_NONE) { |
148 // This is not synchronous, but subsequent IPC messages will be buffered, so | 148 // This is not synchronous, but subsequent IPC messages will be buffered, so |
149 // it is okay to immediately send IPC messages. | 149 // it is okay to immediately send IPC messages. |
150 if (command_buffer->channel()) { | 150 if (command_buffer->channel()) { |
151 decoder_.reset(new media::GpuVideoDecodeAcceleratorHost(command_buffer)); | 151 decoder_.reset(new media::GpuVideoDecodeAcceleratorHost(command_buffer)); |
152 if (decoder_->Initialize(profile_, this)) { | 152 media::VideoDecodeAccelerator::Config vda_config(profile_); |
| 153 vda_config.supported_output_formats.assign( |
| 154 {media::PIXEL_FORMAT_XRGB, media::PIXEL_FORMAT_ARGB}); |
| 155 if (decoder_->Initialize(vda_config, this)) { |
153 initialized_ = true; | 156 initialized_ = true; |
154 return PP_OK; | 157 return PP_OK; |
155 } | 158 } |
156 } | 159 } |
157 decoder_.reset(); | 160 decoder_.reset(); |
158 if (acceleration == PP_HARDWAREACCELERATION_ONLY) | 161 if (acceleration == PP_HARDWAREACCELERATION_ONLY) |
159 return PP_ERROR_NOTSUPPORTED; | 162 return PP_ERROR_NOTSUPPORTED; |
160 } | 163 } |
161 | 164 |
162 #if defined(OS_ANDROID) | 165 #if defined(OS_ANDROID) |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 535 |
533 PepperVideoDecoderHost::PendingDecodeList::iterator | 536 PepperVideoDecoderHost::PendingDecodeList::iterator |
534 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { | 537 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { |
535 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), | 538 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), |
536 [decode_id](const PendingDecode& item) { | 539 [decode_id](const PendingDecode& item) { |
537 return item.decode_id == decode_id; | 540 return item.decode_id == decode_id; |
538 }); | 541 }); |
539 } | 542 } |
540 | 543 |
541 } // namespace content | 544 } // namespace content |
OLD | NEW |