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 |
413 seek_waits_for_data_ = true; | 416 seek_waits_for_data_ = true; |
414 ChangeState_Locked(INITIALIZED); | 417 ChangeState_Locked(INITIALIZED); |
415 } | 418 } |
416 | 419 |
417 bool ChunkDemuxer::AppendData(const uint8* data, size_t length) { | 420 bool ChunkDemuxer::AppendData(const uint8* data, size_t length) { |
418 VLOG(1) << "AppendData(" << length << ")"; | 421 VLOG(1) << "AppendData(" << length << ")"; |
419 | 422 |
420 if (!data || length == 0u) | 423 if (!data || length == 0u) |
421 return false; | 424 return false; |
422 | 425 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 base::AutoUnlock auto_unlock(lock_); | 814 base::AutoUnlock auto_unlock(lock_); |
812 if (cb.is_null()) { | 815 if (cb.is_null()) { |
813 host()->OnDemuxerError(error); | 816 host()->OnDemuxerError(error); |
814 return; | 817 return; |
815 } | 818 } |
816 cb.Run(error); | 819 cb.Run(error); |
817 } | 820 } |
818 } | 821 } |
819 | 822 |
820 } // namespace media | 823 } // namespace media |
OLD | NEW |