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 <deque> | 8 #include <deque> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 RETURNING_DATA_FOR_READS, | 315 RETURNING_DATA_FOR_READS, |
316 RETURNING_ABORT_FOR_READS, | 316 RETURNING_ABORT_FOR_READS, |
317 SHUTDOWN, | 317 SHUTDOWN, |
318 }; | 318 }; |
319 | 319 |
320 // Assigns |state_| to |state| | 320 // Assigns |state_| to |state| |
321 void ChangeState_Locked(State state); | 321 void ChangeState_Locked(State state); |
322 | 322 |
323 void CompletePendingReadIfPossible_Locked(); | 323 void CompletePendingReadIfPossible_Locked(); |
324 | 324 |
325 // Gets the value to pass to the next Read() callback. Returns true if | |
326 // |status| and |buffer| should be passed to the callback. False indicates | |
327 // that |status| and |buffer| were not set and more data is needed. | |
328 bool GetNextBuffer_Locked(DemuxerStream::Status* status, | |
329 scoped_refptr<StreamParserBuffer>* buffer); | |
330 | |
331 // Specifies the type of the stream. | 325 // Specifies the type of the stream. |
332 Type type_; | 326 Type type_; |
333 | 327 |
334 scoped_ptr<SourceBufferStream> stream_; | 328 scoped_ptr<SourceBufferStream> stream_; |
335 | 329 |
336 mutable base::Lock lock_; | 330 mutable base::Lock lock_; |
337 State state_; | 331 State state_; |
338 ReadCB read_cb_; | 332 ReadCB read_cb_; |
339 | 333 |
340 DISALLOW_IMPLICIT_CONSTRUCTORS(ChunkDemuxerStream); | 334 DISALLOW_IMPLICIT_CONSTRUCTORS(ChunkDemuxerStream); |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 } | 1761 } |
1768 | 1762 |
1769 void ChunkDemuxer::CompletePendingReadsIfPossible() { | 1763 void ChunkDemuxer::CompletePendingReadsIfPossible() { |
1770 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1764 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
1771 itr != source_state_map_.end(); ++itr) { | 1765 itr != source_state_map_.end(); ++itr) { |
1772 itr->second->CompletePendingReadIfPossible(); | 1766 itr->second->CompletePendingReadIfPossible(); |
1773 } | 1767 } |
1774 } | 1768 } |
1775 | 1769 |
1776 } // namespace media | 1770 } // namespace media |
OLD | NEW |