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

Side by Side Diff: media/base/pipeline_impl.h

Issue 155469: Splitting media filter's Initialize() into Create() + callback and Seek() + callback. (Closed)
Patch Set: Fixed valgrind errors Created 11 years, 5 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
« no previous file with comments | « media/base/mock_filters.cc ('k') | media/base/pipeline_impl.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) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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 // Implementation of Pipeline. 5 // Implementation of Pipeline.
6 6
7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ 7 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_
8 #define MEDIA_BASE_PIPELINE_IMPL_H_ 8 #define MEDIA_BASE_PIPELINE_IMPL_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void Stop(PipelineCallback* stop_callback); 184 void Stop(PipelineCallback* stop_callback);
185 void Seek(base::TimeDelta time, PipelineCallback* seek_callback); 185 void Seek(base::TimeDelta time, PipelineCallback* seek_callback);
186 186
187 // Notifies that the client has changed the playback rate/volume. 187 // Notifies that the client has changed the playback rate/volume.
188 void PlaybackRateChanged(float playback_rate); 188 void PlaybackRateChanged(float playback_rate);
189 void VolumeChanged(float volume); 189 void VolumeChanged(float volume);
190 190
191 // Methods called by a FilterHostImpl object. These methods may be called 191 // Methods called by a FilterHostImpl object. These methods may be called
192 // on any thread, either the pipeline's thread or any other. 192 // on any thread, either the pipeline's thread or any other.
193 193
194 // When a filter calls it's FilterHost, the filter host calls back to the
195 // pipeline thread. If the pipeline thread is running a nested message loop
196 // then it will be exited.
197 void InitializationComplete(FilterHostImpl* host);
198
199 // Sets the pipeline time and schedules a task to call back to any filters 194 // Sets the pipeline time and schedules a task to call back to any filters
200 // that have registered a time update callback. 195 // that have registered a time update callback.
201 void SetTime(base::TimeDelta time); 196 void SetTime(base::TimeDelta time);
202 197
203 // Called by a FilterHostImpl on behalf of a filter calling FilterHost::Error. 198 // Called by a FilterHostImpl on behalf of a filter calling FilterHost::Error.
204 // If the pipeline is running a nested message loop, it will be exited. 199 // If the pipeline is running a nested message loop, it will be exited.
205 void Error(PipelineError error); 200 void Error(PipelineError error);
206 201
207 // Simple accessor used by the FilterHostImpl class to get access to the 202 // Simple accessor used by the FilterHostImpl class to get access to the
208 // pipeline object. 203 // pipeline object.
(...skipping 29 matching lines...) Expand all
238 // Helper method to tell whether we are in the state of initializing. 233 // Helper method to tell whether we are in the state of initializing.
239 bool IsPipelineInitializing() { 234 bool IsPipelineInitializing() {
240 return state_ == kInitDataSource || 235 return state_ == kInitDataSource ||
241 state_ == kInitDemuxer || 236 state_ == kInitDemuxer ||
242 state_ == kInitAudioDecoder || 237 state_ == kInitAudioDecoder ||
243 state_ == kInitAudioRenderer || 238 state_ == kInitAudioRenderer ||
244 state_ == kInitVideoDecoder || 239 state_ == kInitVideoDecoder ||
245 state_ == kInitVideoRenderer; 240 state_ == kInitVideoRenderer;
246 } 241 }
247 242
243 // Callback executed by filters upon completing initialization and seeking.
244 void OnFilterInitialize();
245 void OnFilterSeek();
246
248 // The following "task" methods correspond to the public methods, but these 247 // The following "task" methods correspond to the public methods, but these
249 // methods are run as the result of posting a task to the PipelineInternal's 248 // methods are run as the result of posting a task to the PipelineInternal's
250 // message loop. 249 // message loop.
251 void StartTask(FilterFactory* filter_factory, 250 void StartTask(FilterFactory* filter_factory,
252 const std::string& url, 251 const std::string& url,
253 PipelineCallback* start_callback); 252 PipelineCallback* start_callback);
254 253
255 // InitializeTask() performs initialization in multiple passes. It is executed 254 // InitializeTask() performs initialization in multiple passes. It is executed
256 // as a result of calling Start() or InitializationComplete() that advances 255 // as a result of calling Start() or InitializationComplete() that advances
257 // initialization to the next state. It works as a hub of state transition for 256 // initialization to the next state. It works as a hub of state transition for
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 373
375 typedef std::vector<base::Thread*> FilterThreadVector; 374 typedef std::vector<base::Thread*> FilterThreadVector;
376 FilterThreadVector filter_threads_; 375 FilterThreadVector filter_threads_;
377 376
378 DISALLOW_COPY_AND_ASSIGN(PipelineInternal); 377 DISALLOW_COPY_AND_ASSIGN(PipelineInternal);
379 }; 378 };
380 379
381 } // namespace media 380 } // namespace media
382 381
383 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ 382 #endif // MEDIA_BASE_PIPELINE_IMPL_H_
OLDNEW
« no previous file with comments | « media/base/mock_filters.cc ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698