OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implements a Demuxer that can switch among different data sources mid-stream. | 5 // Implements a Demuxer that can switch among different data sources mid-stream. |
6 // Uses FFmpegDemuxer under the covers, so see the caveats at the top of | 6 // Uses FFmpegDemuxer under the covers, so see the caveats at the top of |
7 // ffmpeg_demuxer.h. | 7 // ffmpeg_demuxer.h. |
8 | 8 |
9 #include "media/filters/chunk_demuxer.h" | 9 #include "media/filters/chunk_demuxer.h" |
10 | 10 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 403 |
404 if (state_ == SHUTDOWN) | 404 if (state_ == SHUTDOWN) |
405 return; | 405 return; |
406 | 406 |
407 if (audio_.get()) | 407 if (audio_.get()) |
408 audio_->Flush(); | 408 audio_->Flush(); |
409 | 409 |
410 if (video_.get()) | 410 if (video_.get()) |
411 video_->Flush(); | 411 video_->Flush(); |
412 | 412 |
413 byte_queue_.Reset(); | |
414 cluster_parser_->Reset(); | |
415 | |
416 seek_waits_for_data_ = true; | 413 seek_waits_for_data_ = true; |
417 ChangeState_Locked(INITIALIZED); | 414 ChangeState_Locked(INITIALIZED); |
418 } | 415 } |
419 | 416 |
420 bool ChunkDemuxer::AppendData(const uint8* data, size_t length) { | 417 bool ChunkDemuxer::AppendData(const uint8* data, size_t length) { |
421 VLOG(1) << "AppendData(" << length << ")"; | 418 VLOG(1) << "AppendData(" << length << ")"; |
422 | 419 |
423 if (!data || length == 0u) | 420 if (!data || length == 0u) |
424 return false; | 421 return false; |
425 | 422 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 base::AutoUnlock auto_unlock(lock_); | 811 base::AutoUnlock auto_unlock(lock_); |
815 if (cb.is_null()) { | 812 if (cb.is_null()) { |
816 host()->OnDemuxerError(error); | 813 host()->OnDemuxerError(error); |
817 return; | 814 return; |
818 } | 815 } |
819 cb.Run(error); | 816 cb.Run(error); |
820 } | 817 } |
821 } | 818 } |
822 | 819 |
823 } // namespace media | 820 } // namespace media |
OLD | NEW |