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

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: fix media/event-attributes.html 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool IsStreaming() const OVERRIDE; 128 virtual bool IsStreaming() const OVERRIDE;
129 virtual bool IsLoaded() const OVERRIDE; 129 virtual bool IsLocalSource() const OVERRIDE;
130 virtual PipelineStatistics GetStatistics() const OVERRIDE; 130 virtual PipelineStatistics GetStatistics() const OVERRIDE;
131 131
132 void SetClockForTesting(Clock* clock); 132 void SetClockForTesting(Clock* clock);
133 133
134 private: 134 private:
135 friend class MediaLog; 135 friend class MediaLog;
136 136
137 // Pipeline states, as described above. 137 // Pipeline states, as described above.
138 enum State { 138 enum State {
139 kCreated, 139 kCreated,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 virtual void SetError(PipelineStatus error) OVERRIDE; 194 virtual void SetError(PipelineStatus error) OVERRIDE;
195 virtual base::TimeDelta GetTime() const OVERRIDE; 195 virtual base::TimeDelta GetTime() const OVERRIDE;
196 virtual base::TimeDelta GetDuration() const OVERRIDE; 196 virtual base::TimeDelta GetDuration() const OVERRIDE;
197 virtual void SetTime(base::TimeDelta time) OVERRIDE; 197 virtual void SetTime(base::TimeDelta time) OVERRIDE;
198 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; 198 virtual void SetDuration(base::TimeDelta duration) OVERRIDE;
199 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE; 199 virtual void SetBufferedTime(base::TimeDelta buffered_time) OVERRIDE;
200 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; 200 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE;
201 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE; 201 virtual void SetBufferedBytes(int64 buffered_bytes) OVERRIDE;
202 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE; 202 virtual void SetNaturalVideoSize(const gfx::Size& size) OVERRIDE;
203 virtual void SetStreaming(bool streamed) OVERRIDE; 203 virtual void SetStreaming(bool streamed) OVERRIDE;
204 virtual void SetLoaded(bool loaded) OVERRIDE;
205 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE; 204 virtual void SetNetworkActivity(bool is_downloading_data) OVERRIDE;
206 virtual void NotifyEnded() OVERRIDE; 205 virtual void NotifyEnded() OVERRIDE;
207 virtual void DisableAudioRenderer() OVERRIDE; 206 virtual void DisableAudioRenderer() OVERRIDE;
208 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE; 207 virtual void SetCurrentReadPosition(int64 offset) OVERRIDE;
209 virtual int64 GetCurrentReadPosition() OVERRIDE; 208 virtual int64 GetCurrentReadPosition() OVERRIDE;
210 209
211 // Callback executed by filters upon completing initialization. 210 // Callback executed by filters upon completing initialization.
212 void OnFilterInitialize(); 211 void OnFilterInitialize();
213 212
214 // Callback executed by filters upon completing Play(), Pause(), or Stop(). 213 // Callback executed by filters upon completing Play(), Pause(), or Stop().
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 377
379 // Amount of available buffered data. Set by filters. 378 // Amount of available buffered data. Set by filters.
380 int64 buffered_bytes_; 379 int64 buffered_bytes_;
381 380
382 // Total size of the media. Set by filters. 381 // Total size of the media. Set by filters.
383 int64 total_bytes_; 382 int64 total_bytes_;
384 383
385 // Video's natural width and height. Set by filters. 384 // Video's natural width and height. Set by filters.
386 gfx::Size natural_size_; 385 gfx::Size natural_size_;
387 386
388 // Sets by the filters to indicate whether the data source is a streaming 387 // Set by the filters to indicate whether the data source is a streaming
acolwell GONE FROM CHROMIUM 2011/11/30 19:26:11 Update comment to reflect that this comes from the
vrk (LEFT CHROMIUM) 2011/12/01 02:11:35 Done.
389 // source. 388 // source.
390 bool streaming_; 389 bool streaming_;
391 390
392 // Sets by the filters to indicate whether the data source is a fully 391 // Indicates whether the data source is local, such as a local media file
393 // loaded source. 392 // from disk or a local webcam stream.
394 bool loaded_; 393 bool local_source_;
395 394
396 // Current volume level (from 0.0f to 1.0f). This value is set immediately 395 // 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 396 // via SetVolume() and a task is dispatched on the message loop to notify the
398 // filters. 397 // filters.
399 float volume_; 398 float volume_;
400 399
401 // Current value of preload attribute. This value is set immediately via 400 // 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 401 // SetPreload() and a task is dispatched on the message loop to notify the
403 // filters. 402 // filters.
404 Preload preload_; 403 Preload preload_;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 bool is_downloading_data_; 494 bool is_downloading_data_;
496 495
497 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime); 496 FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime);
498 497
499 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); 498 DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
500 }; 499 };
501 500
502 } // namespace media 501 } // namespace media
503 502
504 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ 503 #endif // MEDIA_BASE_PIPELINE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698