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

Unified Diff: media/formats/webm/webm_cluster_parser.h

Issue 143973009: SourceState: Coalesce OnNewBuffers() CB to include OnTextBuffers() behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address PS2 comments Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | media/formats/webm/webm_cluster_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_cluster_parser.h
diff --git a/media/formats/webm/webm_cluster_parser.h b/media/formats/webm/webm_cluster_parser.h
index db683f697d86998d6d25388272bfe81a4dfd9b03..63cc507158af46dd01b859409c38241ad68eda9d 100644
--- a/media/formats/webm/webm_cluster_parser.h
+++ b/media/formats/webm/webm_cluster_parser.h
@@ -53,24 +53,7 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
public:
typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;
-
- class MEDIA_EXPORT TextTrackIterator {
- public:
- explicit TextTrackIterator(const TextTrackMap& text_track_map);
- TextTrackIterator(const TextTrackIterator& rhs);
- ~TextTrackIterator();
-
- // To visit each text track. If the iterator is exhausted, it returns
- // as parameters the values 0 and NULL, and the function returns false.
- // Otherwise, it returns the buffers for the associated track, and the
- // function returns true.
- bool operator()(int* track_num, const BufferQueue** buffers);
- private:
- TextTrackIterator& operator=(const TextTrackIterator&);
-
- TextTrackMap::const_iterator iterator_;
- const TextTrackMap::const_iterator iterator_end_;
- };
+ typedef std::map<int, const BufferQueue> TextBufferQueueMap;
WebMClusterParser(int64 timecode_scale,
int audio_track_num,
@@ -96,8 +79,11 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
const BufferQueue& audio_buffers() const { return audio_.buffers(); }
const BufferQueue& video_buffers() const { return video_.buffers(); }
- // Returns an iterator object, allowing each text track to be visited.
- TextTrackIterator CreateTextTrackIterator() const;
+ // Constructs and returns a subset of |text_track_map_| containing only
+ // tracks with non-empty buffer queues produced by the last Parse().
+ // The returned map is cleared by Parse() or Reset() and updated by the next
+ // call to GetTextBuffers().
+ const TextBufferQueueMap& GetTextBuffers();
// Returns true if the last Parse() call stopped at the end of a cluster.
bool cluster_ended() const { return cluster_ended_; }
@@ -149,6 +135,12 @@ class MEDIA_EXPORT WebMClusterParser : public WebMParserClient {
Track audio_;
Track video_;
TextTrackMap text_track_map_;
+
+ // Subset of |text_track_map_| maintained by GetTextBuffers(), and cleared by
+ // ResetTextTracks(). Callers of GetTextBuffers() get a const-ref to this
+ // member.
+ TextBufferQueueMap text_buffers_map_;
+
LogCB log_cb_;
DISALLOW_IMPLICIT_CONSTRUCTORS(WebMClusterParser);
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | media/formats/webm/webm_cluster_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698