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

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

Issue 8775035: Add support for incremental cluster parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 9 years 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/webm/webm_cluster_parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | media/webm/webm_cluster_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698