OLD | NEW |
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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
6 // It contains Pipeline which is the actual media player pipeline, it glues | 6 // It contains Pipeline which is the actual media player pipeline, it glues |
7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
8 // Pipeline would creates multiple threads and access some public methods | 8 // Pipeline would creates multiple threads and access some public methods |
9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
10 // methods and members. | 10 // methods and members. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 WebKit::WebMediaSource* media_source, | 89 WebKit::WebMediaSource* media_source, |
90 CORSMode cors_mode); | 90 CORSMode cors_mode); |
91 virtual void cancelLoad(); | 91 virtual void cancelLoad(); |
92 | 92 |
93 // Playback controls. | 93 // Playback controls. |
94 virtual void play(); | 94 virtual void play(); |
95 virtual void pause(); | 95 virtual void pause(); |
96 virtual bool supportsFullscreen() const; | 96 virtual bool supportsFullscreen() const; |
97 virtual bool supportsSave() const; | 97 virtual bool supportsSave() const; |
98 virtual void seekFloat(float seconds); | 98 virtual void seekFloat(float seconds); |
99 virtual void seek(float seconds); | 99 virtual void seek(double seconds); |
100 virtual void setEndTimeFloat(float seconds); | 100 virtual void setEndTimeFloat(float seconds); |
101 virtual void setEndTime(float seconds); | 101 virtual void setEndTime(double seconds); |
102 virtual void setRateFloat(float rate); | 102 virtual void setRateFloat(float rate); |
103 virtual void setRate(float rate); | 103 virtual void setRate(double rate); |
104 virtual void setVolumeFloat(float volume); | 104 virtual void setVolumeFloat(float volume); |
105 virtual void setVolume(float volume); | 105 virtual void setVolume(double volume); |
106 virtual void setVisible(bool visible); | 106 virtual void setVisible(bool visible); |
107 virtual void setPreload(WebKit::WebMediaPlayer::Preload preload); | 107 virtual void setPreload(WebKit::WebMediaPlayer::Preload preload); |
108 virtual bool totalBytesKnown(); | 108 virtual bool totalBytesKnown(); |
109 virtual const WebKit::WebTimeRanges& buffered(); | 109 virtual const WebKit::WebTimeRanges& buffered(); |
110 virtual float maxTimeSeekableFloat() const; | 110 virtual float maxTimeSeekableFloat() const; |
111 virtual float maxTimeSeekable() const; | 111 virtual double maxTimeSeekable() const; |
112 | 112 |
113 // Methods for painting. | 113 // Methods for painting. |
114 virtual void setSize(const WebKit::WebSize& size); | 114 virtual void setSize(const WebKit::WebSize& size); |
115 | 115 |
116 virtual void paint(WebKit::WebCanvas* canvas, | 116 virtual void paint(WebKit::WebCanvas* canvas, |
117 const WebKit::WebRect& rect, | 117 const WebKit::WebRect& rect, |
118 uint8_t alpha); | 118 uint8_t alpha); |
119 | 119 |
120 // True if the loaded media has a playable video/audio track. | 120 // True if the loaded media has a playable video/audio track. |
121 virtual bool hasVideo() const; | 121 virtual bool hasVideo() const; |
122 virtual bool hasAudio() const; | 122 virtual bool hasAudio() const; |
123 | 123 |
124 // Dimensions of the video. | 124 // Dimensions of the video. |
125 virtual WebKit::WebSize naturalSize() const; | 125 virtual WebKit::WebSize naturalSize() const; |
126 | 126 |
127 // Getters of playback state. | 127 // Getters of playback state. |
128 virtual bool paused() const; | 128 virtual bool paused() const; |
129 virtual bool seeking() const; | 129 virtual bool seeking() const; |
130 virtual float durationFloat() const; | 130 virtual float durationFloat() const; |
131 virtual float duration() const; | 131 virtual double duration() const; |
132 virtual float currentTimeFloat() const; | 132 virtual float currentTimeFloat() const; |
133 virtual float currentTime() const; | 133 virtual double currentTime() const; |
134 | 134 |
135 // Get rate of loading the resource. | 135 // Get rate of loading the resource. |
136 virtual int32 dataRate() const; | 136 virtual int32 dataRate() const; |
137 | 137 |
138 // Internal states of loading and network. | 138 // Internal states of loading and network. |
139 // TODO(hclam): Ask the pipeline about the state rather than having reading | 139 // TODO(hclam): Ask the pipeline about the state rather than having reading |
140 // them from members which would cause race conditions. | 140 // them from members which would cause race conditions. |
141 virtual WebKit::WebMediaPlayer::NetworkState networkState() const; | 141 virtual WebKit::WebMediaPlayer::NetworkState networkState() const; |
142 virtual WebKit::WebMediaPlayer::ReadyState readyState() const; | 142 virtual WebKit::WebMediaPlayer::ReadyState readyState() const; |
143 | 143 |
144 virtual bool didLoadingProgress() const; | 144 virtual bool didLoadingProgress() const; |
145 virtual unsigned long long totalBytes() const; | 145 virtual unsigned long long totalBytes() const; |
146 | 146 |
147 virtual bool hasSingleSecurityOrigin() const; | 147 virtual bool hasSingleSecurityOrigin() const; |
148 virtual bool didPassCORSAccessCheck() const; | 148 virtual bool didPassCORSAccessCheck() const; |
149 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; | 149 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; |
150 | 150 |
151 virtual float mediaTimeForTimeValueFloat(float timeValue) const; | 151 virtual float mediaTimeForTimeValueFloat(float timeValue) const; |
152 virtual float mediaTimeForTimeValue(float timeValue) const; | 152 virtual double mediaTimeForTimeValue(double timeValue) const; |
153 | 153 |
154 virtual unsigned decodedFrameCount() const; | 154 virtual unsigned decodedFrameCount() const; |
155 virtual unsigned droppedFrameCount() const; | 155 virtual unsigned droppedFrameCount() const; |
156 virtual unsigned audioDecodedByteCount() const; | 156 virtual unsigned audioDecodedByteCount() const; |
157 virtual unsigned videoDecodedByteCount() const; | 157 virtual unsigned videoDecodedByteCount() const; |
158 | 158 |
159 // cc::VideoFrameProvider implementation. | 159 // cc::VideoFrameProvider implementation. |
160 virtual void SetVideoFrameProviderClient( | 160 virtual void SetVideoFrameProviderClient( |
161 cc::VideoFrameProvider::Client* client) OVERRIDE; | 161 cc::VideoFrameProvider::Client* client) OVERRIDE; |
162 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; | 162 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // all clients to manage the pause+playback rate externally, but is that | 300 // all clients to manage the pause+playback rate externally, but is that |
301 // really a bad thing? | 301 // really a bad thing? |
302 // | 302 // |
303 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want | 303 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want |
304 // to hang the render thread during pause(), we record the time at the same | 304 // to hang the render thread during pause(), we record the time at the same |
305 // time we pause and then return that value in currentTime(). Otherwise our | 305 // time we pause and then return that value in currentTime(). Otherwise our |
306 // clock can creep forward a little bit while the asynchronous | 306 // clock can creep forward a little bit while the asynchronous |
307 // SetPlaybackRate(0) is being executed. | 307 // SetPlaybackRate(0) is being executed. |
308 bool paused_; | 308 bool paused_; |
309 bool seeking_; | 309 bool seeking_; |
310 float playback_rate_; | 310 double playback_rate_; |
311 base::TimeDelta paused_time_; | 311 base::TimeDelta paused_time_; |
312 | 312 |
313 // Seek gets pending if another seek is in progress. Only last pending seek | 313 // Seek gets pending if another seek is in progress. Only last pending seek |
314 // will have effect. | 314 // will have effect. |
315 bool pending_seek_; | 315 bool pending_seek_; |
316 float pending_seek_seconds_; | 316 double pending_seek_seconds_; |
317 | 317 |
318 WebKit::WebMediaPlayerClient* client_; | 318 WebKit::WebMediaPlayerClient* client_; |
319 | 319 |
320 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 320 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
321 | 321 |
322 MediaStreamClient* media_stream_client_; | 322 MediaStreamClient* media_stream_client_; |
323 | 323 |
324 scoped_refptr<media::MediaLog> media_log_; | 324 scoped_refptr<media::MediaLog> media_log_; |
325 | 325 |
326 // Since accelerated compositing status is only known after the first layout, | 326 // Since accelerated compositing status is only known after the first layout, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 369 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
370 | 370 |
371 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; | 371 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; |
372 | 372 |
373 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 373 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
374 }; | 374 }; |
375 | 375 |
376 } // namespace webkit_media | 376 } // namespace webkit_media |
377 | 377 |
378 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 378 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |