| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 update_network_state_cb_ = media::BindToCurrentLoop(update_network_state_cb); | 160 update_network_state_cb_ = media::BindToCurrentLoop(update_network_state_cb); |
| 161 duration_change_cb_ = duration_change_cb; | 161 duration_change_cb_ = duration_change_cb; |
| 162 access_unit_size_ = kAccessUnitSizeForMediaSource; | 162 access_unit_size_ = kAccessUnitSizeForMediaSource; |
| 163 | 163 |
| 164 chunk_demuxer_.reset(new media::ChunkDemuxer( | 164 chunk_demuxer_.reset(new media::ChunkDemuxer( |
| 165 media::BindToCurrentLoop( | 165 media::BindToCurrentLoop( |
| 166 base::Bind(&MediaSourceDelegate::OnDemuxerOpened, main_weak_this_)), | 166 base::Bind(&MediaSourceDelegate::OnDemuxerOpened, main_weak_this_)), |
| 167 media::BindToCurrentLoop( | 167 media::BindToCurrentLoop( |
| 168 base::Bind(&MediaSourceDelegate::OnNeedKey, main_weak_this_)), | 168 base::Bind(&MediaSourceDelegate::OnNeedKey, main_weak_this_)), |
| 169 base::Bind(&LogMediaSourceError, media_log_), | 169 base::Bind(&LogMediaSourceError, media_log_), |
| 170 media_log_, |
| 170 false)); | 171 false)); |
| 171 | 172 |
| 172 // |this| will be retained until StopDemuxer() is posted, so Unretained() is | 173 // |this| will be retained until StopDemuxer() is posted, so Unretained() is |
| 173 // safe here. | 174 // safe here. |
| 174 media_task_runner_->PostTask(FROM_HERE, | 175 media_task_runner_->PostTask(FROM_HERE, |
| 175 base::Bind(&MediaSourceDelegate::InitializeDemuxer, | 176 base::Bind(&MediaSourceDelegate::InitializeDemuxer, |
| 176 base::Unretained(this))); | 177 base::Unretained(this))); |
| 177 } | 178 } |
| 178 | 179 |
| 179 void MediaSourceDelegate::InitializeDemuxer() { | 180 void MediaSourceDelegate::InitializeDemuxer() { |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 configs->video_size = config.natural_size(); | 744 configs->video_size = config.natural_size(); |
| 744 configs->is_video_encrypted = config.is_encrypted(); | 745 configs->is_video_encrypted = config.is_encrypted(); |
| 745 configs->video_extra_data = std::vector<uint8>( | 746 configs->video_extra_data = std::vector<uint8>( |
| 746 config.extra_data(), config.extra_data() + config.extra_data_size()); | 747 config.extra_data(), config.extra_data() + config.extra_data_size()); |
| 747 return true; | 748 return true; |
| 748 } | 749 } |
| 749 return false; | 750 return false; |
| 750 } | 751 } |
| 751 | 752 |
| 752 } // namespace content | 753 } // namespace content |
| OLD | NEW |