| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // | 360 // |
| 361 // FFmpegDemuxer | 361 // FFmpegDemuxer |
| 362 // | 362 // |
| 363 FFmpegDemuxer::FFmpegDemuxer( | 363 FFmpegDemuxer::FFmpegDemuxer( |
| 364 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 364 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 365 DataSource* data_source, | 365 DataSource* data_source, |
| 366 const NeedKeyCB& need_key_cb, | 366 const NeedKeyCB& need_key_cb, |
| 367 const scoped_refptr<MediaLog>& media_log) | 367 const scoped_refptr<MediaLog>& media_log) |
| 368 : host_(NULL), | 368 : host_(NULL), |
| 369 task_runner_(task_runner), | 369 task_runner_(task_runner), |
| 370 weak_factory_(this), | |
| 371 blocking_thread_("FFmpegDemuxer"), | 370 blocking_thread_("FFmpegDemuxer"), |
| 372 pending_read_(false), | 371 pending_read_(false), |
| 373 pending_seek_(false), | 372 pending_seek_(false), |
| 374 data_source_(data_source), | 373 data_source_(data_source), |
| 375 media_log_(media_log), | 374 media_log_(media_log), |
| 376 bitrate_(0), | 375 bitrate_(0), |
| 377 start_time_(kNoTimestamp()), | 376 start_time_(kNoTimestamp()), |
| 378 audio_disabled_(false), | 377 audio_disabled_(false), |
| 379 text_enabled_(false), | 378 text_enabled_(false), |
| 380 duration_known_(false), | 379 duration_known_(false), |
| 381 need_key_cb_(need_key_cb) { | 380 need_key_cb_(need_key_cb), |
| 381 weak_factory_(this) { |
| 382 DCHECK(task_runner_.get()); | 382 DCHECK(task_runner_.get()); |
| 383 DCHECK(data_source_); | 383 DCHECK(data_source_); |
| 384 } | 384 } |
| 385 | 385 |
| 386 FFmpegDemuxer::~FFmpegDemuxer() {} | 386 FFmpegDemuxer::~FFmpegDemuxer() {} |
| 387 | 387 |
| 388 void FFmpegDemuxer::Stop(const base::Closure& callback) { | 388 void FFmpegDemuxer::Stop(const base::Closure& callback) { |
| 389 DCHECK(task_runner_->BelongsToCurrentThread()); | 389 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 390 url_protocol_->Abort(); | 390 url_protocol_->Abort(); |
| 391 data_source_->Stop(BindToCurrentLoop(base::Bind( | 391 data_source_->Stop(BindToCurrentLoop(base::Bind( |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 } | 974 } |
| 975 for (size_t i = 0; i < buffered.size(); ++i) | 975 for (size_t i = 0; i < buffered.size(); ++i) |
| 976 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); | 976 host_->AddBufferedTimeRange(buffered.start(i), buffered.end(i)); |
| 977 } | 977 } |
| 978 | 978 |
| 979 void FFmpegDemuxer::OnDataSourceError() { | 979 void FFmpegDemuxer::OnDataSourceError() { |
| 980 host_->OnDemuxerError(PIPELINE_ERROR_READ); | 980 host_->OnDemuxerError(PIPELINE_ERROR_READ); |
| 981 } | 981 } |
| 982 | 982 |
| 983 } // namespace media | 983 } // namespace media |
| OLD | NEW |