| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 media_codec_->Stop(); | 537 media_codec_->Stop(); |
| 538 ConfigureMediaCodec(); | 538 ConfigureMediaCodec(); |
| 539 state_ = NO_ERROR; | 539 state_ = NO_ERROR; |
| 540 | 540 |
| 541 base::MessageLoop::current()->PostTask( | 541 base::MessageLoop::current()->PostTask( |
| 542 FROM_HERE, | 542 FROM_HERE, |
| 543 base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, | 543 base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, |
| 544 weak_this_factory_.GetWeakPtr())); | 544 weak_this_factory_.GetWeakPtr())); |
| 545 } | 545 } |
| 546 | 546 |
| 547 void AndroidVideoDecodeAccelerator::SetCdm(int /* cdm_id */) { |
| 548 // TODO(xhwang): Implement CDM setting here. |
| 549 NOTIMPLEMENTED(); |
| 550 NotifyCdmSet(false); |
| 551 } |
| 552 |
| 547 void AndroidVideoDecodeAccelerator::Destroy() { | 553 void AndroidVideoDecodeAccelerator::Destroy() { |
| 548 DCHECK(thread_checker_.CalledOnValidThread()); | 554 DCHECK(thread_checker_.CalledOnValidThread()); |
| 549 | 555 |
| 550 strategy_->Cleanup(output_picture_buffers_); | 556 strategy_->Cleanup(output_picture_buffers_); |
| 551 weak_this_factory_.InvalidateWeakPtrs(); | 557 weak_this_factory_.InvalidateWeakPtrs(); |
| 552 if (media_codec_) { | 558 if (media_codec_) { |
| 553 io_timer_.Stop(); | 559 io_timer_.Stop(); |
| 554 media_codec_->Stop(); | 560 media_codec_->Stop(); |
| 555 } | 561 } |
| 556 delete this; | 562 delete this; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 600 } |
| 595 | 601 |
| 596 void AndroidVideoDecodeAccelerator::NotifyFlushDone() { | 602 void AndroidVideoDecodeAccelerator::NotifyFlushDone() { |
| 597 client_->NotifyFlushDone(); | 603 client_->NotifyFlushDone(); |
| 598 } | 604 } |
| 599 | 605 |
| 600 void AndroidVideoDecodeAccelerator::NotifyResetDone() { | 606 void AndroidVideoDecodeAccelerator::NotifyResetDone() { |
| 601 client_->NotifyResetDone(); | 607 client_->NotifyResetDone(); |
| 602 } | 608 } |
| 603 | 609 |
| 610 void AndroidVideoDecodeAccelerator::NotifyCdmSet(bool success) { |
| 611 client_->NotifyCdmSet(success); |
| 612 } |
| 613 |
| 604 void AndroidVideoDecodeAccelerator::NotifyError( | 614 void AndroidVideoDecodeAccelerator::NotifyError( |
| 605 media::VideoDecodeAccelerator::Error error) { | 615 media::VideoDecodeAccelerator::Error error) { |
| 606 client_->NotifyError(error); | 616 client_->NotifyError(error); |
| 607 } | 617 } |
| 608 | 618 |
| 609 // static | 619 // static |
| 610 media::VideoDecodeAccelerator::SupportedProfiles | 620 media::VideoDecodeAccelerator::SupportedProfiles |
| 611 AndroidVideoDecodeAccelerator::GetSupportedProfiles() { | 621 AndroidVideoDecodeAccelerator::GetSupportedProfiles() { |
| 612 SupportedProfiles profiles; | 622 SupportedProfiles profiles; |
| 613 | 623 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 639 // software fallback for H264 on Android anyway. | 649 // software fallback for H264 on Android anyway. |
| 640 profile.max_resolution.SetSize(3840, 2160); | 650 profile.max_resolution.SetSize(3840, 2160); |
| 641 profiles.push_back(profile); | 651 profiles.push_back(profile); |
| 642 } | 652 } |
| 643 #endif | 653 #endif |
| 644 | 654 |
| 645 return profiles; | 655 return profiles; |
| 646 } | 656 } |
| 647 | 657 |
| 648 } // namespace content | 658 } // namespace content |
| OLD | NEW |