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 <list> | 9 #include <list> |
10 | 10 |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // parsing. | 1341 // parsing. |
1342 bool old_waiting_for_data = IsSeekWaitingForData_Locked(); | 1342 bool old_waiting_for_data = IsSeekWaitingForData_Locked(); |
1343 | 1343 |
1344 if (length == 0u) | 1344 if (length == 0u) |
1345 return; | 1345 return; |
1346 | 1346 |
1347 DCHECK(data); | 1347 DCHECK(data); |
1348 | 1348 |
1349 switch (state_) { | 1349 switch (state_) { |
1350 case INITIALIZING: | 1350 case INITIALIZING: |
| 1351 case INITIALIZED: |
1351 DCHECK(IsValidId(id)); | 1352 DCHECK(IsValidId(id)); |
1352 if (!source_state_map_[id]->Append(data, length, | 1353 if (!source_state_map_[id]->Append(data, length, |
1353 append_window_start, | 1354 append_window_start, |
1354 append_window_end, | |
1355 timestamp_offset, | |
1356 init_segment_received_cb)) { | |
1357 ReportError_Locked(DEMUXER_ERROR_COULD_NOT_OPEN); | |
1358 return; | |
1359 } | |
1360 break; | |
1361 | |
1362 case INITIALIZED: { | |
1363 DCHECK(IsValidId(id)); | |
1364 if (!source_state_map_[id]->Append(data, length, | |
1365 append_window_start, | |
1366 append_window_end, | 1355 append_window_end, |
1367 timestamp_offset, | 1356 timestamp_offset, |
1368 init_segment_received_cb)) { | 1357 init_segment_received_cb)) { |
1369 ReportError_Locked(PIPELINE_ERROR_DECODE); | 1358 ReportError_Locked(PIPELINE_ERROR_DECODE); |
1370 return; | 1359 return; |
1371 } | 1360 } |
1372 } break; | 1361 break; |
1373 | 1362 |
1374 case PARSE_ERROR: | 1363 case PARSE_ERROR: |
1375 DVLOG(1) << "AppendData(): Ignoring data after a parse error."; | 1364 DVLOG(1) << "AppendData(): Ignoring data after a parse error."; |
1376 return; | 1365 return; |
1377 | 1366 |
1378 case WAITING_FOR_INIT: | 1367 case WAITING_FOR_INIT: |
1379 case ENDED: | 1368 case ENDED: |
1380 case SHUTDOWN: | 1369 case SHUTDOWN: |
1381 DVLOG(1) << "AppendData(): called in unexpected state " << state_; | 1370 DVLOG(1) << "AppendData(): called in unexpected state " << state_; |
1382 return; | 1371 return; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 } | 1842 } |
1854 | 1843 |
1855 void ChunkDemuxer::ShutdownAllStreams() { | 1844 void ChunkDemuxer::ShutdownAllStreams() { |
1856 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1845 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1857 itr != source_state_map_.end(); ++itr) { | 1846 itr != source_state_map_.end(); ++itr) { |
1858 itr->second->Shutdown(); | 1847 itr->second->Shutdown(); |
1859 } | 1848 } |
1860 } | 1849 } |
1861 | 1850 |
1862 } // namespace media | 1851 } // namespace media |
OLD | NEW |