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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 scoped_ptr<StreamParser> stream_parser(factory_function()); | 557 scoped_ptr<StreamParser> stream_parser(factory_function()); |
558 CHECK(stream_parser.get()); | 558 CHECK(stream_parser.get()); |
559 | 559 |
560 stream_parser->Init( | 560 stream_parser->Init( |
561 base::Bind(&ChunkDemuxer::OnStreamParserInitDone, this), | 561 base::Bind(&ChunkDemuxer::OnStreamParserInitDone, this), |
562 base::Bind(&ChunkDemuxer::OnNewConfigs, base::Unretained(this), | 562 base::Bind(&ChunkDemuxer::OnNewConfigs, base::Unretained(this), |
563 has_audio, has_video), | 563 has_audio, has_video), |
564 audio_cb, | 564 audio_cb, |
565 video_cb, | 565 video_cb, |
566 base::Bind(&ChunkDemuxer::OnKeyNeeded, base::Unretained(this))); | 566 base::Bind(&ChunkDemuxer::OnNeedKey, base::Unretained(this))); |
567 | 567 |
568 stream_parser_map_[id] = stream_parser.release(); | 568 stream_parser_map_[id] = stream_parser.release(); |
569 | 569 |
570 return kOk; | 570 return kOk; |
571 } | 571 } |
572 | 572 |
573 void ChunkDemuxer::RemoveId(const std::string& id) { | 573 void ChunkDemuxer::RemoveId(const std::string& id) { |
574 CHECK_GT(stream_parser_map_.count(id), 0u); | 574 CHECK_GT(stream_parser_map_.count(id), 0u); |
575 base::AutoLock auto_lock(lock_); | 575 base::AutoLock auto_lock(lock_); |
576 | 576 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 | 963 |
964 bool ChunkDemuxer::OnVideoBuffers(const StreamParser::BufferQueue& buffers) { | 964 bool ChunkDemuxer::OnVideoBuffers(const StreamParser::BufferQueue& buffers) { |
965 DCHECK_NE(state_, SHUTDOWN); | 965 DCHECK_NE(state_, SHUTDOWN); |
966 | 966 |
967 if (!video_) | 967 if (!video_) |
968 return false; | 968 return false; |
969 | 969 |
970 return video_->Append(buffers); | 970 return video_->Append(buffers); |
971 } | 971 } |
972 | 972 |
973 bool ChunkDemuxer::OnKeyNeeded(scoped_array<uint8> init_data, | 973 bool ChunkDemuxer::OnNeedKey(scoped_array<uint8> init_data, |
974 int init_data_size) { | 974 int init_data_size) { |
975 client_->KeyNeeded(init_data.Pass(), init_data_size); | 975 client_->DemuxerNeedKey(init_data.Pass(), init_data_size); |
976 return true; | 976 return true; |
977 } | 977 } |
978 | 978 |
979 } // namespace media | 979 } // namespace media |
OLD | NEW |