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

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

Issue 13813016: Remove reference counting from media::Demuxer and friends. (Closed) Base URL: http://git.chromium.org/chromium/src.git@vd_scoped
Patch Set: demuxer only Created 7 years, 8 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
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 27 matching lines...) Expand all
38 int init_data_size)> NeedKeyCB; 38 int init_data_size)> NeedKeyCB;
39 39
40 // |open_cb| Run when Initialize() is called to signal that the demuxer 40 // |open_cb| Run when Initialize() is called to signal that the demuxer
41 // is ready to receive media data via AppenData(). 41 // is ready to receive media data via AppenData().
42 // |need_key_cb| Run when the demuxer determines that an encryption key is 42 // |need_key_cb| Run when the demuxer determines that an encryption key is
43 // needed to decrypt the content. 43 // needed to decrypt the content.
44 // |log_cb| Run when parsing error messages need to be logged to the error 44 // |log_cb| Run when parsing error messages need to be logged to the error
45 // console. 45 // console.
46 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb, 46 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb,
47 const LogCB& log_cb); 47 const LogCB& log_cb);
48 virtual ~ChunkDemuxer();
48 49
49 // Demuxer implementation. 50 // Demuxer implementation.
50 virtual void Initialize(DemuxerHost* host, 51 virtual void Initialize(DemuxerHost* host,
51 const PipelineStatusCB& cb) OVERRIDE; 52 const PipelineStatusCB& cb) OVERRIDE;
52 virtual void Stop(const base::Closure& callback) OVERRIDE; 53 virtual void Stop(const base::Closure& callback) OVERRIDE;
53 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; 54 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE;
54 virtual void OnAudioRendererDisabled() OVERRIDE; 55 virtual void OnAudioRendererDisabled() OVERRIDE;
55 virtual scoped_refptr<DemuxerStream> GetStream( 56 virtual scoped_refptr<DemuxerStream> GetStream(
56 DemuxerStream::Type type) OVERRIDE; 57 DemuxerStream::Type type) OVERRIDE;
57 virtual base::TimeDelta GetStartTime() const OVERRIDE; 58 virtual base::TimeDelta GetStartTime() const OVERRIDE;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // properly, false if the offset cannot be applied because we're in the 98 // properly, false if the offset cannot be applied because we're in the
98 // middle of parsing a media segment. 99 // middle of parsing a media segment.
99 bool SetTimestampOffset(const std::string& id, base::TimeDelta offset); 100 bool SetTimestampOffset(const std::string& id, base::TimeDelta offset);
100 101
101 // Signals an EndOfStream request. 102 // Signals an EndOfStream request.
102 // Returns false if called in an unexpected state or if there is a gap between 103 // Returns false if called in an unexpected state or if there is a gap between
103 // the current position and the end of the buffered data. 104 // the current position and the end of the buffered data.
104 bool EndOfStream(PipelineStatus status); 105 bool EndOfStream(PipelineStatus status);
105 void Shutdown(); 106 void Shutdown();
106 107
107 protected:
108 virtual ~ChunkDemuxer();
109
110 private: 108 private:
111 enum State { 109 enum State {
112 WAITING_FOR_INIT, 110 WAITING_FOR_INIT,
113 INITIALIZING, 111 INITIALIZING,
114 INITIALIZED, 112 INITIALIZED,
115 ENDED, 113 ENDED,
116 PARSE_ERROR, 114 PARSE_ERROR,
117 SHUTDOWN, 115 SHUTDOWN,
118 }; 116 };
119 117
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // removed with RemoveID() but can not be re-added (yet). 203 // removed with RemoveID() but can not be re-added (yet).
206 std::string source_id_audio_; 204 std::string source_id_audio_;
207 std::string source_id_video_; 205 std::string source_id_video_;
208 206
209 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 207 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
210 }; 208 };
211 209
212 } // namespace media 210 } // namespace media
213 211
214 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 212 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698