OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Generates an AVFormatContext for the INFO & TRACKS elements contained | 75 // Generates an AVFormatContext for the INFO & TRACKS elements contained |
76 // in |data|. Returns NULL if parsing |data| fails. | 76 // in |data|. Returns NULL if parsing |data| fails. |
77 AVFormatContext* CreateFormatContext(const uint8* data, int size); | 77 AVFormatContext* CreateFormatContext(const uint8* data, int size); |
78 | 78 |
79 // Sets up |audio_| & |video_| DemuxerStreams based on the data in | 79 // Sets up |audio_| & |video_| DemuxerStreams based on the data in |
80 // |format_context_|. Returns false if no valid audio or video stream were | 80 // |format_context_|. Returns false if no valid audio or video stream were |
81 // found. | 81 // found. |
82 bool SetupStreams(); | 82 bool SetupStreams(); |
83 | 83 |
84 // Parse a cluster add add the buffers to the appropriate DemxuerStream. | 84 // Parse a cluster add add the buffers to the appropriate DemuxerStream. |
85 // |data| is expected to point to the beginning of a cluster element. | 85 // |data| is expected to point to the beginning of an element. |
| 86 // |
| 87 // |buffers_added| - Indicates whether Buffers were added to DemuxerStreams |
| 88 // during the call. This is only valid if the return value > 0. |
86 // | 89 // |
87 // Returns -1 if the parse fails. | 90 // Returns -1 if the parse fails. |
88 // Returns 0 if more data is needed. | 91 // Returns 0 if more data is needed. |
89 // Returns the number of bytes parsed on success. | 92 // Returns the number of bytes parsed on success. |
90 int ParseCluster_Locked(const uint8* data, int size); | 93 int ParseCluster_Locked(const uint8* data, int size, bool* buffers_added); |
91 | 94 |
92 // Reports an error and puts the demuxer in a state where it won't accept more | 95 // Reports an error and puts the demuxer in a state where it won't accept more |
93 // data. | 96 // data. |
94 void ReportError_Locked(PipelineStatus error); | 97 void ReportError_Locked(PipelineStatus error); |
95 | 98 |
96 base::Lock lock_; | 99 base::Lock lock_; |
97 State state_; | 100 State state_; |
98 | 101 |
99 ChunkDemuxerClient* client_; | 102 ChunkDemuxerClient* client_; |
100 PipelineStatusCB init_cb_; | 103 PipelineStatusCB init_cb_; |
(...skipping 24 matching lines...) Expand all Loading... |
125 bool seek_waits_for_data_; | 128 bool seek_waits_for_data_; |
126 | 129 |
127 ByteQueue byte_queue_; | 130 ByteQueue byte_queue_; |
128 | 131 |
129 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 132 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
130 }; | 133 }; |
131 | 134 |
132 } // namespace media | 135 } // namespace media |
133 | 136 |
134 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 137 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |