OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 pending_read_(false), | 293 pending_read_(false), |
294 pending_seek_(false), | 294 pending_seek_(false), |
295 data_source_(data_source), | 295 data_source_(data_source), |
296 bitrate_(0), | 296 bitrate_(0), |
297 start_time_(kNoTimestamp()), | 297 start_time_(kNoTimestamp()), |
298 audio_disabled_(false), | 298 audio_disabled_(false), |
299 duration_known_(false), | 299 duration_known_(false), |
300 url_protocol_(data_source, BindToLoop(message_loop_, base::Bind( | 300 url_protocol_(data_source, BindToLoop(message_loop_, base::Bind( |
301 &FFmpegDemuxer::OnDataSourceError, base::Unretained(this)))), | 301 &FFmpegDemuxer::OnDataSourceError, base::Unretained(this)))), |
302 need_key_cb_(need_key_cb) { | 302 need_key_cb_(need_key_cb) { |
303 DCHECK(message_loop_); | 303 DCHECK(message_loop_.get()); |
304 DCHECK(data_source_); | 304 DCHECK(data_source_); |
305 } | 305 } |
306 | 306 |
307 FFmpegDemuxer::~FFmpegDemuxer() {} | 307 FFmpegDemuxer::~FFmpegDemuxer() {} |
308 | 308 |
309 void FFmpegDemuxer::Stop(const base::Closure& callback) { | 309 void FFmpegDemuxer::Stop(const base::Closure& callback) { |
310 DCHECK(message_loop_->BelongsToCurrentThread()); | 310 DCHECK(message_loop_->BelongsToCurrentThread()); |
311 url_protocol_.Abort(); | 311 url_protocol_.Abort(); |
312 data_source_->Stop(BindToCurrentLoop(base::Bind( | 312 data_source_->Stop(BindToCurrentLoop(base::Bind( |
313 &FFmpegDemuxer::OnDataSourceStopped, weak_this_, | 313 &FFmpegDemuxer::OnDataSourceStopped, weak_this_, |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 for (size_t i = 0; i < buffered.size(); ++i) | 767 for (size_t i = 0; i < buffered.size(); ++i) |
768 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); | 768 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); |
769 } | 769 } |
770 | 770 |
771 void FFmpegDemuxer::OnDataSourceError() { | 771 void FFmpegDemuxer::OnDataSourceError() { |
772 host_->OnDemuxerError(PIPELINE_ERROR_READ); | 772 host_->OnDemuxerError(PIPELINE_ERROR_READ); |
773 } | 773 } |
774 | 774 |
775 } // namespace media | 775 } // namespace media |
OLD | NEW |