| 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 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Resource loading. | 36 // Resource loading. |
| 37 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode); | 37 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode); |
| 38 virtual void load(const WebKit::WebURL& url, | 38 virtual void load(const WebKit::WebURL& url, |
| 39 WebKit::WebMediaSource* media_source, | 39 WebKit::WebMediaSource* media_source, |
| 40 CORSMode cors_mode); | 40 CORSMode cors_mode); |
| 41 virtual void cancelLoad(); | 41 virtual void cancelLoad(); |
| 42 | 42 |
| 43 // Playback controls. | 43 // Playback controls. |
| 44 virtual void play(); | 44 virtual void play(); |
| 45 virtual void pause(); | 45 virtual void pause(); |
| 46 virtual void seekFloat(float seconds); |
| 46 virtual void seek(float seconds); | 47 virtual void seek(float seconds); |
| 47 virtual bool supportsFullscreen() const; | 48 virtual bool supportsFullscreen() const; |
| 48 virtual bool supportsSave() const; | 49 virtual bool supportsSave() const; |
| 50 virtual void setEndTimeFloat(float seconds); |
| 49 virtual void setEndTime(float seconds); | 51 virtual void setEndTime(float seconds); |
| 52 virtual void setRateFloat(float rate); |
| 50 virtual void setRate(float rate); | 53 virtual void setRate(float rate); |
| 54 virtual void setVolumeFloat(float volume); |
| 51 virtual void setVolume(float volume); | 55 virtual void setVolume(float volume); |
| 52 virtual void setVisible(bool visible); | 56 virtual void setVisible(bool visible); |
| 53 virtual bool totalBytesKnown(); | 57 virtual bool totalBytesKnown(); |
| 54 virtual const WebKit::WebTimeRanges& buffered(); | 58 virtual const WebKit::WebTimeRanges& buffered(); |
| 59 virtual float maxTimeSeekableFloat() const; |
| 55 virtual float maxTimeSeekable() const; | 60 virtual float maxTimeSeekable() const; |
| 56 | 61 |
| 57 // Methods for painting. | 62 // Methods for painting. |
| 58 virtual void setSize(const WebKit::WebSize& size); | 63 virtual void setSize(const WebKit::WebSize& size); |
| 59 virtual void paint(WebKit::WebCanvas* canvas, | 64 virtual void paint(WebKit::WebCanvas* canvas, |
| 60 const WebKit::WebRect& rect, | 65 const WebKit::WebRect& rect, |
| 61 uint8_t alpha); | 66 uint8_t alpha); |
| 62 | 67 |
| 63 // True if the loaded media has a playable video/audio track. | 68 // True if the loaded media has a playable video/audio track. |
| 64 virtual bool hasVideo() const; | 69 virtual bool hasVideo() const; |
| 65 virtual bool hasAudio() const; | 70 virtual bool hasAudio() const; |
| 66 | 71 |
| 67 // Dimensions of the video. | 72 // Dimensions of the video. |
| 68 virtual WebKit::WebSize naturalSize() const; | 73 virtual WebKit::WebSize naturalSize() const; |
| 69 | 74 |
| 70 // Getters of playback state. | 75 // Getters of playback state. |
| 71 virtual bool paused() const; | 76 virtual bool paused() const; |
| 72 virtual bool seeking() const; | 77 virtual bool seeking() const; |
| 78 virtual float durationFloat() const; |
| 73 virtual float duration() const; | 79 virtual float duration() const; |
| 80 virtual float currentTimeFloat() const; |
| 74 virtual float currentTime() const; | 81 virtual float currentTime() const; |
| 75 | 82 |
| 76 // Get rate of loading the resource. | 83 // Get rate of loading the resource. |
| 77 virtual int32 dataRate() const; | 84 virtual int32 dataRate() const; |
| 78 | 85 |
| 79 virtual bool didLoadingProgress() const; | 86 virtual bool didLoadingProgress() const; |
| 80 virtual unsigned long long totalBytes() const; | 87 virtual unsigned long long totalBytes() const; |
| 81 | 88 |
| 82 // Internal states of loading and network. | 89 // Internal states of loading and network. |
| 83 virtual WebKit::WebMediaPlayer::NetworkState networkState() const; | 90 virtual WebKit::WebMediaPlayer::NetworkState networkState() const; |
| 84 virtual WebKit::WebMediaPlayer::ReadyState readyState() const; | 91 virtual WebKit::WebMediaPlayer::ReadyState readyState() const; |
| 85 | 92 |
| 86 virtual bool hasSingleSecurityOrigin() const; | 93 virtual bool hasSingleSecurityOrigin() const; |
| 87 virtual bool didPassCORSAccessCheck() const; | 94 virtual bool didPassCORSAccessCheck() const; |
| 88 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; | 95 virtual WebKit::WebMediaPlayer::MovieLoadType movieLoadType() const; |
| 89 | 96 |
| 97 virtual float mediaTimeForTimeValueFloat(float timeValue) const; |
| 90 virtual float mediaTimeForTimeValue(float timeValue) const; | 98 virtual float mediaTimeForTimeValue(float timeValue) const; |
| 91 | 99 |
| 92 // Provide statistics. | 100 // Provide statistics. |
| 93 virtual unsigned decodedFrameCount() const; | 101 virtual unsigned decodedFrameCount() const; |
| 94 virtual unsigned droppedFrameCount() const; | 102 virtual unsigned droppedFrameCount() const; |
| 95 virtual unsigned audioDecodedByteCount() const; | 103 virtual unsigned audioDecodedByteCount() const; |
| 96 virtual unsigned videoDecodedByteCount() const; | 104 virtual unsigned videoDecodedByteCount() const; |
| 97 | 105 |
| 98 // cc::VideoFrameProvider implementation. These methods are running on the | 106 // cc::VideoFrameProvider implementation. These methods are running on the |
| 99 // compositor thread. | 107 // compositor thread. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 265 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
| 258 | 266 |
| 259 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 267 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
| 260 | 268 |
| 261 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 269 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 262 }; | 270 }; |
| 263 | 271 |
| 264 } // namespace webkit_media | 272 } // namespace webkit_media |
| 265 | 273 |
| 266 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 274 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |