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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 #if defined(OS_ANDROID) | 495 #if defined(OS_ANDROID) |
496 return false; | 496 return false; |
497 #else | 497 #else |
498 DCHECK(!software_fallback_used_ && software_fallback_allowed_); | 498 DCHECK(!software_fallback_used_ && software_fallback_allowed_); |
499 | 499 |
500 uint32_t shim_texture_pool_size = media::limits::kMaxVideoFrames + 1; | 500 uint32_t shim_texture_pool_size = media::limits::kMaxVideoFrames + 1; |
501 shim_texture_pool_size = std::max(shim_texture_pool_size, | 501 shim_texture_pool_size = std::max(shim_texture_pool_size, |
502 min_picture_count_); | 502 min_picture_count_); |
503 std::unique_ptr<VideoDecoderShim> new_decoder( | 503 std::unique_ptr<VideoDecoderShim> new_decoder( |
504 new VideoDecoderShim(this, shim_texture_pool_size)); | 504 new VideoDecoderShim(this, shim_texture_pool_size)); |
505 if (!new_decoder->Initialize(profile_, this)) | 505 if (!new_decoder->Initialize(media::VideoDecodeAccelerator::Config(profile_), |
| 506 this)) { |
506 return false; | 507 return false; |
| 508 } |
507 | 509 |
508 software_fallback_used_ = true; | 510 software_fallback_used_ = true; |
509 decoder_.reset(new_decoder.release()); | 511 decoder_.reset(new_decoder.release()); |
510 | 512 |
511 // Dismiss all assigned pictures and mark all pictures in use as DISMISSED. | 513 // Dismiss all assigned pictures and mark all pictures in use as DISMISSED. |
512 PictureBufferMap pictures_pending_dismission; | 514 PictureBufferMap pictures_pending_dismission; |
513 for (auto& picture : picture_buffer_map_) { | 515 for (auto& picture : picture_buffer_map_) { |
514 if (picture.second == PictureBufferState::ASSIGNED) { | 516 if (picture.second == PictureBufferState::ASSIGNED) { |
515 host()->SendUnsolicitedReply( | 517 host()->SendUnsolicitedReply( |
516 pp_resource(), | 518 pp_resource(), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 558 |
557 PepperVideoDecoderHost::PendingDecodeList::iterator | 559 PepperVideoDecoderHost::PendingDecodeList::iterator |
558 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { | 560 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { |
559 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), | 561 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), |
560 [decode_id](const PendingDecode& item) { | 562 [decode_id](const PendingDecode& item) { |
561 return item.decode_id == decode_id; | 563 return item.decode_id == decode_id; |
562 }); | 564 }); |
563 } | 565 } |
564 | 566 |
565 } // namespace content | 567 } // namespace content |
OLD | NEW |