| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/renderer/media/android/media_source_delegate.h" | 5 #include "content/renderer/media/android/media_source_delegate.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 660 |
| 661 void MediaSourceDelegate::OnDemuxerOpened() { | 661 void MediaSourceDelegate::OnDemuxerOpened() { |
| 662 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 662 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 663 if (media_source_opened_cb_.is_null()) | 663 if (media_source_opened_cb_.is_null()) |
| 664 return; | 664 return; |
| 665 | 665 |
| 666 media_source_opened_cb_.Run(new media::WebMediaSourceImpl( | 666 media_source_opened_cb_.Run(new media::WebMediaSourceImpl( |
| 667 chunk_demuxer_.get(), base::Bind(&LogMediaSourceError, media_log_))); | 667 chunk_demuxer_.get(), base::Bind(&LogMediaSourceError, media_log_))); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void MediaSourceDelegate::OnNeedKey(const std::string& type, | 670 void MediaSourceDelegate::OnNeedKey(const std::string& init_data_type, |
| 671 const std::vector<uint8>& init_data) { | 671 const std::vector<uint8>& init_data) { |
| 672 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 672 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 673 if (need_key_cb_.is_null()) | 673 if (need_key_cb_.is_null()) |
| 674 return; | 674 return; |
| 675 | 675 |
| 676 need_key_cb_.Run(type, init_data); | 676 need_key_cb_.Run(init_data_type, init_data); |
| 677 } | 677 } |
| 678 | 678 |
| 679 bool MediaSourceDelegate::IsSeeking() const { | 679 bool MediaSourceDelegate::IsSeeking() const { |
| 680 base::AutoLock auto_lock(seeking_lock_); | 680 base::AutoLock auto_lock(seeking_lock_); |
| 681 return seeking_; | 681 return seeking_; |
| 682 } | 682 } |
| 683 | 683 |
| 684 base::TimeDelta MediaSourceDelegate::FindBufferedBrowserSeekTime_Locked( | 684 base::TimeDelta MediaSourceDelegate::FindBufferedBrowserSeekTime_Locked( |
| 685 const base::TimeDelta& seek_time) const { | 685 const base::TimeDelta& seek_time) const { |
| 686 seeking_lock_.AssertAcquired(); | 686 seeking_lock_.AssertAcquired(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 configs->video_size = config.natural_size(); | 744 configs->video_size = config.natural_size(); |
| 745 configs->is_video_encrypted = config.is_encrypted(); | 745 configs->is_video_encrypted = config.is_encrypted(); |
| 746 configs->video_extra_data = std::vector<uint8>( | 746 configs->video_extra_data = std::vector<uint8>( |
| 747 config.extra_data(), config.extra_data() + config.extra_data_size()); | 747 config.extra_data(), config.extra_data() + config.extra_data_size()); |
| 748 return true; | 748 return true; |
| 749 } | 749 } |
| 750 return false; | 750 return false; |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace content | 753 } // namespace content |
| OLD | NEW |