Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Side by Side Diff: media/filters/chunk_demuxer.h

Issue 10558011: Fix ChunkDemuxer so it properly outputs buffered ranges. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | media/filters/chunk_demuxer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool OnAudioBuffers(const StreamParser::BufferQueue& buffers); 118 bool OnAudioBuffers(const StreamParser::BufferQueue& buffers);
119 bool OnVideoBuffers(const StreamParser::BufferQueue& buffers); 119 bool OnVideoBuffers(const StreamParser::BufferQueue& buffers);
120 bool OnKeyNeeded(scoped_array<uint8> init_data, int init_data_size); 120 bool OnKeyNeeded(scoped_array<uint8> init_data, int init_data_size);
121 void OnNewMediaSegment(const std::string& source_id, 121 void OnNewMediaSegment(const std::string& source_id,
122 base::TimeDelta start_timestamp); 122 base::TimeDelta start_timestamp);
123 123
124 // Helper functions for calculating GetBufferedRanges(). 124 // Helper functions for calculating GetBufferedRanges().
125 bool CopyIntoRanges( 125 bool CopyIntoRanges(
126 const SourceBufferStream::TimespanList& timespans, 126 const SourceBufferStream::TimespanList& timespans,
127 Ranges* ranges_out) const; 127 Ranges* ranges_out) const;
128
129 // Computes the intersection between the video & audio
130 // buffered ranges.
131 // Returns true if the intersection was computed and stored in |ranges_out|.
132 // Returns false if no data was buffered.
133 bool ComputeIntersection(Ranges* ranges_out) const;
Ami GONE FROM CHROMIUM 2012/06/18 16:18:31 I don't get why make the return value bool instead
acolwell GONE FROM CHROMIUM 2012/06/19 06:12:34 Done.
134
128 void AddIntersectionRange( 135 void AddIntersectionRange(
129 SourceBufferStream::Timespan timespan_a, 136 SourceBufferStream::Timespan timespan_a,
130 SourceBufferStream::Timespan timespan_b, 137 SourceBufferStream::Timespan timespan_b,
131 bool last_range_after_ended, 138 bool last_range_after_ended,
132 Ranges* ranges_out) const; 139 Ranges* ranges_out) const;
133 140
134 mutable base::Lock lock_; 141 mutable base::Lock lock_;
135 State state_; 142 State state_;
136 143
137 DemuxerHost* host_; 144 DemuxerHost* host_;
138 ChunkDemuxerClient* client_; 145 ChunkDemuxerClient* client_;
139 PipelineStatusCB init_cb_; 146 PipelineStatusCB init_cb_;
140 PipelineStatusCB seek_cb_; 147 PipelineStatusCB seek_cb_;
141 148
142 scoped_refptr<ChunkDemuxerStream> audio_; 149 scoped_refptr<ChunkDemuxerStream> audio_;
143 scoped_refptr<ChunkDemuxerStream> video_; 150 scoped_refptr<ChunkDemuxerStream> video_;
144 151
145 int64 buffered_bytes_;
146
147 base::TimeDelta duration_; 152 base::TimeDelta duration_;
148 153
149 typedef std::map<std::string, StreamParser*> StreamParserMap; 154 typedef std::map<std::string, StreamParser*> StreamParserMap;
150 StreamParserMap stream_parser_map_; 155 StreamParserMap stream_parser_map_;
151 156
152 // Used to ensure that (1) config data matches the type and codec provided in 157 // Used to ensure that (1) config data matches the type and codec provided in
153 // AddId(), (2) only 1 audio and 1 video sources are added, and (3) ids may be 158 // AddId(), (2) only 1 audio and 1 video sources are added, and (3) ids may be
154 // removed with RemoveID() but can not be re-added (yet). 159 // removed with RemoveID() but can not be re-added (yet).
155 std::string source_id_audio_; 160 std::string source_id_audio_;
156 std::string source_id_video_; 161 std::string source_id_video_;
157 162
158 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 163 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
159 }; 164 };
160 165
161 } // namespace media 166 } // namespace media
162 167
163 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 168 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | media/filters/chunk_demuxer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698