Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebMediaPlayer_h | 31 #ifndef WebMediaPlayer_h |
| 32 #define WebMediaPlayer_h | 32 #define WebMediaPlayer_h |
| 33 | 33 |
| 34 #include "WebCallbacks.h" | 34 #include "WebCallbacks.h" |
| 35 #include "WebCanvas.h" | 35 #include "WebCanvas.h" |
| 36 #include "WebContentDecryptionModule.h" | 36 #include "WebContentDecryptionModule.h" |
| 37 #include "WebMediaSource.h" | 37 #include "WebMediaSource.h" |
| 38 #include "WebRect.h" | |
| 38 #include "WebSetSinkIdCallbacks.h" | 39 #include "WebSetSinkIdCallbacks.h" |
| 39 #include "WebString.h" | 40 #include "WebString.h" |
| 40 | 41 |
| 41 class SkPaint; | 42 class SkPaint; |
| 42 | 43 |
| 43 namespace gpu { | 44 namespace gpu { |
| 44 namespace gles2 { | 45 namespace gles2 { |
| 45 class GLES2Interface; | 46 class GLES2Interface; |
| 46 } | 47 } |
| 47 } | 48 } |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 class WebAudioSourceProvider; | 52 class WebAudioSourceProvider; |
| 52 class WebContentDecryptionModule; | 53 class WebContentDecryptionModule; |
| 53 class WebMediaPlayerSource; | 54 class WebMediaPlayerSource; |
| 54 class WebSecurityOrigin; | 55 class WebSecurityOrigin; |
| 55 class WebString; | 56 class WebString; |
| 56 class WebURL; | 57 class WebURL; |
| 57 struct WebRect; | |
| 58 struct WebSize; | 58 struct WebSize; |
| 59 | 59 |
| 60 class WebMediaPlayer { | 60 class WebMediaPlayer { |
| 61 public: | 61 public: |
| 62 enum NetworkState { | 62 enum NetworkState { |
| 63 NetworkStateEmpty, | 63 NetworkStateEmpty, |
| 64 NetworkStateIdle, | 64 NetworkStateIdle, |
| 65 NetworkStateLoading, | 65 NetworkStateLoading, |
| 66 NetworkStateLoaded, | 66 NetworkStateLoaded, |
| 67 NetworkStateFormatError, | 67 NetworkStateFormatError, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 98 enum LoadType { | 98 enum LoadType { |
| 99 LoadTypeURL = 0, | 99 LoadTypeURL = 0, |
| 100 LoadTypeMediaSource = 1, | 100 LoadTypeMediaSource = 1, |
| 101 LoadTypeMediaStream = 2, | 101 LoadTypeMediaStream = 2, |
| 102 LoadTypeMax = LoadTypeMediaStream, | 102 LoadTypeMax = LoadTypeMediaStream, |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 typedef WebString TrackId; | 105 typedef WebString TrackId; |
| 106 enum TrackType { TextTrack, AudioTrack, VideoTrack }; | 106 enum TrackType { TextTrack, AudioTrack, VideoTrack }; |
| 107 | 107 |
| 108 struct ViewportIntersectionInfo { | |
| 109 ViewportIntersectionInfo() {} | |
| 110 ~ViewportIntersectionInfo() {} | |
| 111 | |
| 112 float ratio = 0; | |
|
miu
2016/11/15 23:29:26
Please remove |ratio|. This can be computed in rem
xjz
2016/11/16 01:06:45
Done.
| |
| 113 WebRect rootRect; | |
| 114 WebRect intersectRect; | |
| 115 }; | |
| 116 | |
| 108 virtual ~WebMediaPlayer() {} | 117 virtual ~WebMediaPlayer() {} |
| 109 | 118 |
| 110 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0; | 119 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0; |
| 111 | 120 |
| 112 // Playback controls. | 121 // Playback controls. |
| 113 virtual void play() = 0; | 122 virtual void play() = 0; |
| 114 virtual void pause() = 0; | 123 virtual void pause() = 0; |
| 115 virtual bool supportsSave() const = 0; | 124 virtual bool supportsSave() const = 0; |
| 116 virtual void seek(double seconds) = 0; | 125 virtual void seek(double seconds) = 0; |
| 117 virtual void setRate(double) = 0; | 126 virtual void setRate(double) = 0; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 virtual void setPoster(const WebURL& poster) {} | 228 virtual void setPoster(const WebURL& poster) {} |
| 220 | 229 |
| 221 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When | 230 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When |
| 222 // this is true, the video layer will be removed from the layer tree when | 231 // this is true, the video layer will be removed from the layer tree when |
| 223 // entering fullscreen, and the WebMediaPlayer is responsible for displaying | 232 // entering fullscreen, and the WebMediaPlayer is responsible for displaying |
| 224 // the video in enteredFullscreen(). | 233 // the video in enteredFullscreen(). |
| 225 virtual bool supportsOverlayFullscreenVideo() { return false; } | 234 virtual bool supportsOverlayFullscreenVideo() { return false; } |
| 226 // Inform WebMediaPlayer when the element has entered/exited fullscreen. | 235 // Inform WebMediaPlayer when the element has entered/exited fullscreen. |
| 227 virtual void enteredFullscreen() {} | 236 virtual void enteredFullscreen() {} |
| 228 virtual void exitedFullscreen() {} | 237 virtual void exitedFullscreen() {} |
| 238 // Inform WebMediaPlayer when the intersection rect of video and viewport | |
| 239 // changes. | |
| 240 virtual void videoViewportIntersectionChanged( | |
| 241 const ViewportIntersectionInfo& info) {} | |
| 229 | 242 |
| 230 virtual void enabledAudioTracksChanged( | 243 virtual void enabledAudioTracksChanged( |
| 231 const WebVector<TrackId>& enabledTrackIds) {} | 244 const WebVector<TrackId>& enabledTrackIds) {} |
| 232 // |selectedTrackId| is null if no track is selected. | 245 // |selectedTrackId| is null if no track is selected. |
| 233 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {} | 246 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {} |
| 234 }; | 247 }; |
| 235 | 248 |
| 236 } // namespace blink | 249 } // namespace blink |
| 237 | 250 |
| 238 #endif | 251 #endif |
| OLD | NEW |