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

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

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test for streaming case to DownloadRateMonitor Created 9 years, 1 month 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
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 // Implementation of Pipeline & PipelineStatusNotification (an async-to-sync 5 // Implementation of Pipeline & PipelineStatusNotification (an async-to-sync
6 // callback adapter). 6 // callback adapter).
7 7
8 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_ 8 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_
9 #define MEDIA_BASE_PIPELINE_IMPL_H_ 9 #define MEDIA_BASE_PIPELINE_IMPL_H_
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; 118 virtual void SetPlaybackRate(float playback_rate) OVERRIDE;
119 virtual float GetVolume() const OVERRIDE; 119 virtual float GetVolume() const OVERRIDE;
120 virtual void SetVolume(float volume) OVERRIDE; 120 virtual void SetVolume(float volume) OVERRIDE;
121 virtual void SetPreload(Preload preload) OVERRIDE; 121 virtual void SetPreload(Preload preload) OVERRIDE;
122 virtual base::TimeDelta GetCurrentTime() const OVERRIDE; 122 virtual base::TimeDelta GetCurrentTime() const OVERRIDE;
123 virtual base::TimeDelta GetBufferedTime() OVERRIDE; 123 virtual base::TimeDelta GetBufferedTime() OVERRIDE;
124 virtual base::TimeDelta GetMediaDuration() const OVERRIDE; 124 virtual base::TimeDelta GetMediaDuration() const OVERRIDE;
125 virtual int64 GetBufferedBytes() const OVERRIDE; 125 virtual int64 GetBufferedBytes() const OVERRIDE;
126 virtual int64 GetTotalBytes() const OVERRIDE; 126 virtual int64 GetTotalBytes() const OVERRIDE;
127 virtual void GetNaturalVideoSize(gfx::Size* out_size) const OVERRIDE; 127 virtual void GetNaturalVideoSize(gfx::Size* out_size) const OVERRIDE;
128 virtual void SetLocalSource(bool local_source) OVERRIDE;
128 virtual bool IsStreaming() const OVERRIDE; 129 virtual bool IsStreaming() const OVERRIDE;
129 virtual bool IsLoaded() const OVERRIDE; 130 virtual bool IsLocalSource() const OVERRIDE;
130 virtual PipelineStatistics GetStatistics() const OVERRIDE; 131 virtual PipelineStatistics GetStatistics() const OVERRIDE;
131 132
132 void SetClockForTesting(Clock* clock); 133 void SetClockForTesting(Clock* clock);
133 134
134 private: 135 private:
135 friend class MediaLog; 136 friend class MediaLog;
136 137
137 // Pipeline states, as described above. 138 // Pipeline states, as described above.
138 enum State { 139 enum State {
139 kCreated, 140 kCreated,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 virtual void SetError(PipelineStatus error) OVERRIDE; 195 virtual void SetError(PipelineStatus error) OVERRIDE;
195 virtual base::TimeDelta GetTime() const OVERRIDE; 196 virtual base::TimeDelta GetTime() const OVERRIDE;
196 virtual base::TimeDelta GetDuration() const OVERRIDE; 197 virtual base::TimeDelta GetDuration() const OVERRIDE;
197 virtual void SetTime(base::TimeDelta time) OVERRIDE; 198 virtual void SetTime(base::TimeDelta time) OVERRIDE;
198 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; 199 virtual void SetDuration(base::TimeDelta duration) OVERRIDE;
199 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; 200 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE;
200 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; 201 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE;
201 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE; 202 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE;
202 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; 203 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE;
203 virtual void SetStreaming(bool streamed) OVERRIDE; 204 virtual void SetStreaming(bool streamed) OVERRIDE;
204 virtual void SetLoaded(bool loaded) OVERRIDE; 205 virtual void SetLocalSourceFromFilter(bool local_source) OVERRIDE;
205 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; 206 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE;
206 virtual void NotifyEnded() OVERRIDE; 207 virtual void NotifyEnded() OVERRIDE;
207 virtual void DisableAudioRenderer() OVERRIDE; 208 virtual void DisableAudioRenderer() OVERRIDE;
208 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; 209 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE;
209 virtual int64 GetCurrentReadPosition() OVERRIDE; 210 virtual int64 GetCurrentReadPosition() OVERRIDE;
210 211
211 // Callback executed by filters upon completing initialization. 212 // Callback executed by filters upon completing initialization.
212 void OnFilterInitialize(); 213 void OnFilterInitialize();
213 214
214 // Callback executed by filters upon completing Play(), Pause(), or Stop(). 215 // Callback executed by filters upon completing Play(), Pause(), or Stop().
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 379
379 // Amount of available buffered data. Set by filters. 380 // Amount of available buffered data. Set by filters.
380 int64 buffered_bytes_; 381 int64 buffered_bytes_;
381 382
382 // Total size of the media. Set by filters. 383 // Total size of the media. Set by filters.
383 int64 total_bytes_; 384 int64 total_bytes_;
384 385
385 // Video's natural width and height. Set by filters. 386 // Video's natural width and height. Set by filters.
386 gfx::Size natural_size_; 387 gfx::Size natural_size_;
387 388
388 // Sets by the filters to indicate whether the data source is a streaming 389 // Set by the filters to indicate whether the data source is a streaming
389 // source. 390 // source.
390 bool streaming_; 391 bool streaming_;
391 392
392 // Sets by the filters to indicate whether the data source is a fully 393 // Indicates whether the data source is local, such as a local media file
393 // loaded source. 394 // from disk or a local webcam stream.
394 bool loaded_; 395 bool local_source_;
395 396
396 // Current volume level (from 0.0f to 1.0f). This value is set immediately 397 // Current volume level (from 0.0f to 1.0f). This value is set immediately
397 // via SetVolume() and a task is dispatched on the message loop to notify the 398 // via SetVolume() and a task is dispatched on the message loop to notify the
398 // filters. 399 // filters.
399 float volume_; 400 float volume_;
400 401
401 // Current value of preload attribute. This value is set immediately via 402 // Current value of preload attribute. This value is set immediately via
402 // SetPreload() and a task is dispatched on the message loop to notify the 403 // SetPreload() and a task is dispatched on the message loop to notify the
403 // filters. 404 // filters.
404 Preload preload_; 405 Preload preload_;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 bool is_downloading_data_; 496 bool is_downloading_data_;
496 497
497 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); 498 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime);
498 499
499 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); 500 DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
500 }; 501 };
501 502
502 } // namespace media 503 } // namespace media
503 504
504 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ 505 #endif // MEDIA_BASE_PIPELINE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698