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

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

Issue 9295020: Fix ChunkDemuxer seek deadlock (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright year. Created 8 years, 10 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 | « media/base/filters.h ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »
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 // AudioRendererBase takes care of the tricky queuing work and provides simple 5 // AudioRendererBase takes care of the tricky queuing work and provides simple
6 // methods for subclasses to peek and poke at audio data. In addition to 6 // methods for subclasses to peek and poke at audio data. In addition to
7 // AudioRenderer interface methods this classes doesn't implement, subclasses 7 // AudioRenderer interface methods this classes doesn't implement, subclasses
8 // must also implement the following methods: 8 // must also implement the following methods:
9 // OnInitialized 9 // OnInitialized
10 // OnStop 10 // OnStop
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 private: 107 private:
108 friend class AudioRendererBaseTest; 108 friend class AudioRendererBaseTest;
109 109
110 // Helper method that schedules an asynchronous read from the decoder and 110 // Helper method that schedules an asynchronous read from the decoder and
111 // increments |pending_reads_|. 111 // increments |pending_reads_|.
112 // 112 //
113 // Safe to call from any thread. 113 // Safe to call from any thread.
114 void ScheduleRead_Locked(); 114 void ScheduleRead_Locked();
115 115
116 // Returns true if the data in the buffer is all before
117 // |seek_timestamp_|. This can only return true while
118 // in the kSeeking state.
119 bool IsBeforeSeekTime(const scoped_refptr<Buffer>& buffer);
120
116 // Audio decoder. 121 // Audio decoder.
117 scoped_refptr<AudioDecoder> decoder_; 122 scoped_refptr<AudioDecoder> decoder_;
118 123
119 // Algorithm for scaling audio. 124 // Algorithm for scaling audio.
120 scoped_ptr<AudioRendererAlgorithmBase> algorithm_; 125 scoped_ptr<AudioRendererAlgorithmBase> algorithm_;
121 126
122 base::Lock lock_; 127 base::Lock lock_;
123 128
124 // Simple state tracking variable. 129 // Simple state tracking variable.
125 enum State { 130 enum State {
126 kUninitialized, 131 kUninitialized,
127 kPaused, 132 kPaused,
128 kSeeking, 133 kSeeking,
129 kPlaying, 134 kPlaying,
130 kStopped, 135 kStopped,
131 kError,
132 kUnderflow, 136 kUnderflow,
133 kRebuffering, 137 kRebuffering,
134 }; 138 };
135 State state_; 139 State state_;
136 140
137 // Keep track of our outstanding read to |decoder_|. 141 // Keep track of our outstanding read to |decoder_|.
138 bool pending_read_; 142 bool pending_read_;
139 143
140 // Keeps track of whether we received and rendered the end of stream buffer. 144 // Keeps track of whether we received and rendered the end of stream buffer.
141 bool recieved_end_of_stream_; 145 bool recieved_end_of_stream_;
(...skipping 12 matching lines...) Expand all
154 base::TimeDelta seek_timestamp_; 158 base::TimeDelta seek_timestamp_;
155 159
156 AudioDecoder::ReadCB read_cb_; 160 AudioDecoder::ReadCB read_cb_;
157 161
158 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); 162 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase);
159 }; 163 };
160 164
161 } // namespace media 165 } // namespace media
162 166
163 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ 167 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698