| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 const std::string& type, | 580 const std::string& type, |
| 581 const std::string& codecs) { | 581 const std::string& codecs) { |
| 582 DVLOG(1) << __func__ << " id=" << id << " mime_type=" << type | 582 DVLOG(1) << __func__ << " id=" << id << " mime_type=" << type |
| 583 << " codecs=" << codecs; | 583 << " codecs=" << codecs; |
| 584 base::AutoLock auto_lock(lock_); | 584 base::AutoLock auto_lock(lock_); |
| 585 | 585 |
| 586 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id)) | 586 if ((state_ != WAITING_FOR_INIT && state_ != INITIALIZING) || IsValidId(id)) |
| 587 return kReachedIdLimit; | 587 return kReachedIdLimit; |
| 588 | 588 |
| 589 std::vector<std::string> parsed_codec_ids; | 589 std::vector<std::string> parsed_codec_ids; |
| 590 media::ParseCodecString(codecs, &parsed_codec_ids, false); | 590 media::SplitCodecsToVector(codecs, &parsed_codec_ids, false); |
| 591 | 591 |
| 592 std::unique_ptr<media::StreamParser> stream_parser( | 592 std::unique_ptr<media::StreamParser> stream_parser( |
| 593 StreamParserFactory::Create(type, parsed_codec_ids, media_log_)); | 593 StreamParserFactory::Create(type, parsed_codec_ids, media_log_)); |
| 594 | 594 |
| 595 if (!stream_parser) | 595 if (!stream_parser) |
| 596 return ChunkDemuxer::kNotSupported; | 596 return ChunkDemuxer::kNotSupported; |
| 597 | 597 |
| 598 std::unique_ptr<FrameProcessor> frame_processor( | 598 std::unique_ptr<FrameProcessor> frame_processor( |
| 599 new FrameProcessor(base::Bind(&ChunkDemuxer::IncreaseDurationIfNecessary, | 599 new FrameProcessor(base::Bind(&ChunkDemuxer::IncreaseDurationIfNecessary, |
| 600 base::Unretained(this)), | 600 base::Unretained(this)), |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 void ChunkDemuxer::ShutdownAllStreams() { | 1331 void ChunkDemuxer::ShutdownAllStreams() { |
| 1332 for (auto itr = source_state_map_.begin(); itr != source_state_map_.end(); | 1332 for (auto itr = source_state_map_.begin(); itr != source_state_map_.end(); |
| 1333 ++itr) { | 1333 ++itr) { |
| 1334 itr->second->Shutdown(); | 1334 itr->second->Shutdown(); |
| 1335 } | 1335 } |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 } // namespace media | 1338 } // namespace media |
| OLD | NEW |