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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 DCHECK(main_loop_->BelongsToCurrentThread()); | 146 DCHECK(main_loop_->BelongsToCurrentThread()); |
147 DCHECK(!media_source_opened_cb.is_null()); | 147 DCHECK(!media_source_opened_cb.is_null()); |
148 media_source_opened_cb_ = media_source_opened_cb; | 148 media_source_opened_cb_ = media_source_opened_cb; |
149 need_key_cb_ = need_key_cb; | 149 need_key_cb_ = need_key_cb; |
150 set_decryptor_ready_cb_ = set_decryptor_ready_cb; | 150 set_decryptor_ready_cb_ = set_decryptor_ready_cb; |
151 update_network_state_cb_ = media::BindToCurrentLoop(update_network_state_cb); | 151 update_network_state_cb_ = media::BindToCurrentLoop(update_network_state_cb); |
152 duration_change_cb_ = duration_change_cb; | 152 duration_change_cb_ = duration_change_cb; |
153 access_unit_size_ = kAccessUnitSizeForMediaSource; | 153 access_unit_size_ = kAccessUnitSizeForMediaSource; |
154 | 154 |
155 chunk_demuxer_.reset(new media::ChunkDemuxer( | 155 chunk_demuxer_.reset(new media::ChunkDemuxer( |
156 media::BindToCurrentLoop(base::Bind( | 156 media::BindToCurrentLoop( |
157 &MediaSourceDelegate::OnDemuxerOpened, main_weak_this_)), | 157 base::Bind(&MediaSourceDelegate::OnDemuxerOpened, main_weak_this_)), |
158 media::BindToCurrentLoop(base::Bind( | 158 media::BindToCurrentLoop( |
159 &MediaSourceDelegate::OnNeedKey, main_weak_this_)), | 159 base::Bind(&MediaSourceDelegate::OnNeedKey, main_weak_this_)), |
160 base::Bind(&LogMediaSourceError, media_log_))); | 160 base::Bind(&LogMediaSourceError, media_log_), |
| 161 false)); |
161 | 162 |
162 // |this| will be retained until StopDemuxer() is posted, so Unretained() is | 163 // |this| will be retained until StopDemuxer() is posted, so Unretained() is |
163 // safe here. | 164 // safe here. |
164 media_loop_->PostTask(FROM_HERE, | 165 media_loop_->PostTask(FROM_HERE, |
165 base::Bind(&MediaSourceDelegate::InitializeDemuxer, | 166 base::Bind(&MediaSourceDelegate::InitializeDemuxer, |
166 base::Unretained(this))); | 167 base::Unretained(this))); |
167 } | 168 } |
168 | 169 |
169 void MediaSourceDelegate::InitializeDemuxer() { | 170 void MediaSourceDelegate::InitializeDemuxer() { |
170 DCHECK(media_loop_->BelongsToCurrentThread()); | 171 DCHECK(media_loop_->BelongsToCurrentThread()); |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 // current time have been garbage collected or removed by the web app, this is | 766 // current time have been garbage collected or removed by the web app, this is |
766 // unlikely. This may cause unexpected playback stall due to seek pending an | 767 // unlikely. This may cause unexpected playback stall due to seek pending an |
767 // append for a GOP prior to the last GOP demuxed. | 768 // append for a GOP prior to the last GOP demuxed. |
768 // TODO(wolenetz): Remove the possibility for this seek to cause unexpected | 769 // TODO(wolenetz): Remove the possibility for this seek to cause unexpected |
769 // player stall by replaying cached data since last keyframe in browser player | 770 // player stall by replaying cached data since last keyframe in browser player |
770 // rather than issuing browser seek. See http://crbug.com/304234. | 771 // rather than issuing browser seek. See http://crbug.com/304234. |
771 return seek_time; | 772 return seek_time; |
772 } | 773 } |
773 | 774 |
774 } // namespace content | 775 } // namespace content |
OLD | NEW |