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 and add the buffers to the appropriate DemuxerStream. This | 84 // Parse a cluster add add the buffers to the appropriate DemxuerStream. |
85 // method also skips over CUES elements if it happens to encounter them. | 85 // |data| is expected to point to the beginning of a cluster element. |
86 // | |
87 // |data| is expected to point to the beginning of an element. | |
88 // | |
89 // |buffers_added| - Indicates whether Buffers were added to DemuxerStreams | |
90 // during the call. This is only valid if the return value > 0. | |
91 // | 86 // |
92 // Returns -1 if the parse fails. | 87 // Returns -1 if the parse fails. |
93 // Returns 0 if more data is needed. | 88 // Returns 0 if more data is needed. |
94 // Returns the number of bytes parsed on success. | 89 // Returns the number of bytes parsed on success. |
95 int ParseCluster_Locked(const uint8* data, int size, bool* buffers_added); | 90 int ParseCluster_Locked(const uint8* data, int size); |
96 | 91 |
97 // Reports an error and puts the demuxer in a state where it won't accept more | 92 // Reports an error and puts the demuxer in a state where it won't accept more |
98 // data. | 93 // data. |
99 void ReportError_Locked(PipelineStatus error); | 94 void ReportError_Locked(PipelineStatus error); |
100 | 95 |
101 base::Lock lock_; | 96 base::Lock lock_; |
102 State state_; | 97 State state_; |
103 | 98 |
104 ChunkDemuxerClient* client_; | 99 ChunkDemuxerClient* client_; |
105 PipelineStatusCB init_cb_; | 100 PipelineStatusCB init_cb_; |
(...skipping 24 matching lines...) Expand all Loading... |
130 bool seek_waits_for_data_; | 125 bool seek_waits_for_data_; |
131 | 126 |
132 ByteQueue byte_queue_; | 127 ByteQueue byte_queue_; |
133 | 128 |
134 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 129 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
135 }; | 130 }; |
136 | 131 |
137 } // namespace media | 132 } // namespace media |
138 | 133 |
139 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 134 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |