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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 641 } |
642 | 642 |
643 buffered_bytes_ += length; | 643 buffered_bytes_ += length; |
644 buffered_bytes = buffered_bytes_; | 644 buffered_bytes = buffered_bytes_; |
645 } | 645 } |
646 | 646 |
647 // Notify the host of 'network activity' because we got data, using a bogus | 647 // Notify the host of 'network activity' because we got data, using a bogus |
648 // range. | 648 // range. |
649 host_->AddBufferedByteRange(0, buffered_bytes); | 649 host_->AddBufferedByteRange(0, buffered_bytes); |
650 | 650 |
651 host_->SetNetworkActivity(true); | |
652 | |
653 if (!cb.is_null()) | 651 if (!cb.is_null()) |
654 cb.Run(PIPELINE_OK); | 652 cb.Run(PIPELINE_OK); |
655 | 653 |
656 return true; | 654 return true; |
657 } | 655 } |
658 | 656 |
659 void ChunkDemuxer::Abort(const std::string& id) { | 657 void ChunkDemuxer::Abort(const std::string& id) { |
660 DVLOG(1) << "Abort(" << id << ")"; | 658 DVLOG(1) << "Abort(" << id << ")"; |
661 DCHECK(!id.empty()); | 659 DCHECK(!id.empty()); |
662 DCHECK_EQ(source_id_, id); | 660 DCHECK_EQ(source_id_, id); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 return true; | 869 return true; |
872 } | 870 } |
873 | 871 |
874 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, | 872 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, |
875 int init_data_size) { | 873 int init_data_size) { |
876 client_->KeyNeeded(init_data.Pass(), init_data_size); | 874 client_->KeyNeeded(init_data.Pass(), init_data_size); |
877 return true; | 875 return true; |
878 } | 876 } |
879 | 877 |
880 } // namespace media | 878 } // namespace media |
OLD | NEW |