| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 void PepperVideoDecoderHost::NotifyError( | 423 void PepperVideoDecoderHost::NotifyError( |
| 424 media::VideoDecodeAccelerator::Error error) { | 424 media::VideoDecodeAccelerator::Error error) { |
| 425 int32_t pp_error = PP_ERROR_FAILED; | 425 int32_t pp_error = PP_ERROR_FAILED; |
| 426 switch (error) { | 426 switch (error) { |
| 427 case media::VideoDecodeAccelerator::UNREADABLE_INPUT: | 427 case media::VideoDecodeAccelerator::UNREADABLE_INPUT: |
| 428 pp_error = PP_ERROR_MALFORMED_INPUT; | 428 pp_error = PP_ERROR_MALFORMED_INPUT; |
| 429 break; | 429 break; |
| 430 case media::VideoDecodeAccelerator::ILLEGAL_STATE: | 430 case media::VideoDecodeAccelerator::ILLEGAL_STATE: |
| 431 case media::VideoDecodeAccelerator::INVALID_ARGUMENT: | 431 case media::VideoDecodeAccelerator::INVALID_ARGUMENT: |
| 432 case media::VideoDecodeAccelerator::PLATFORM_FAILURE: | 432 case media::VideoDecodeAccelerator::PLATFORM_FAILURE: |
| 433 case media::VideoDecodeAccelerator::LARGEST_ERROR_ENUM: | |
| 434 pp_error = PP_ERROR_RESOURCE_FAILED; | 433 pp_error = PP_ERROR_RESOURCE_FAILED; |
| 435 break; | 434 break; |
| 436 // No default case, to catch unhandled enum values. | 435 // No default case, to catch unhandled enum values. |
| 437 } | 436 } |
| 438 | 437 |
| 439 // Try to initialize software decoder and use it instead. | 438 // Try to initialize software decoder and use it instead. |
| 440 if (!software_fallback_used_ && software_fallback_allowed_) { | 439 if (!software_fallback_used_ && software_fallback_allowed_) { |
| 441 VLOG(0) | 440 VLOG(0) |
| 442 << "Hardware decoder has returned an error. Trying Software decoder."; | 441 << "Hardware decoder has returned an error. Trying Software decoder."; |
| 443 if (TryFallbackToSoftwareDecoder()) | 442 if (TryFallbackToSoftwareDecoder()) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 529 |
| 531 PepperVideoDecoderHost::PendingDecodeList::iterator | 530 PepperVideoDecoderHost::PendingDecodeList::iterator |
| 532 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { | 531 PepperVideoDecoderHost::GetPendingDecodeById(int32_t decode_id) { |
| 533 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), | 532 return std::find_if(pending_decodes_.begin(), pending_decodes_.end(), |
| 534 [decode_id](const PendingDecode& item) { | 533 [decode_id](const PendingDecode& item) { |
| 535 return item.decode_id == decode_id; | 534 return item.decode_id == decode_id; |
| 536 }); | 535 }); |
| 537 } | 536 } |
| 538 | 537 |
| 539 } // namespace content | 538 } // namespace content |
| OLD | NEW |