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/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 } | 588 } |
589 | 589 |
590 buffered_bytes_ += length; | 590 buffered_bytes_ += length; |
591 buffered_bytes = buffered_bytes_; | 591 buffered_bytes = buffered_bytes_; |
592 } | 592 } |
593 | 593 |
594 // Notify the host of 'network activity' because we got data, using a bogus | 594 // Notify the host of 'network activity' because we got data, using a bogus |
595 // range. | 595 // range. |
596 host_->AddBufferedByteRange(0, buffered_bytes); | 596 host_->AddBufferedByteRange(0, buffered_bytes); |
597 | 597 |
598 host_->SetNetworkActivity(true); | |
599 | |
600 if (!cb.is_null()) | 598 if (!cb.is_null()) |
601 cb.Run(PIPELINE_OK); | 599 cb.Run(PIPELINE_OK); |
602 | 600 |
603 return true; | 601 return true; |
604 } | 602 } |
605 | 603 |
606 void ChunkDemuxer::Abort(const std::string& id) { | 604 void ChunkDemuxer::Abort(const std::string& id) { |
607 DVLOG(1) << "Abort(" << id << ")"; | 605 DVLOG(1) << "Abort(" << id << ")"; |
608 DCHECK(!id.empty()); | 606 DCHECK(!id.empty()); |
609 DCHECK_EQ(source_id_, id); | 607 DCHECK_EQ(source_id_, id); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 return true; | 798 return true; |
801 } | 799 } |
802 | 800 |
803 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, | 801 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, |
804 int init_data_size) { | 802 int init_data_size) { |
805 client_->KeyNeeded(init_data.Pass(), init_data_size); | 803 client_->KeyNeeded(init_data.Pass(), init_data_size); |
806 return true; | 804 return true; |
807 } | 805 } |
808 | 806 |
809 } // namespace media | 807 } // namespace media |
OLD | NEW |