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

Side by Side Diff: third_party/WebKit/public/platform/WebMediaPlayer.h

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Fix trybots failure. Created 4 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
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 WebRect rootRect;
113 WebRect intersectRect;
114 };
115
108 virtual ~WebMediaPlayer() {} 116 virtual ~WebMediaPlayer() {}
109 117
110 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0; 118 virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0;
111 119
112 // Playback controls. 120 // Playback controls.
113 virtual void play() = 0; 121 virtual void play() = 0;
114 virtual void pause() = 0; 122 virtual void pause() = 0;
115 virtual bool supportsSave() const = 0; 123 virtual bool supportsSave() const = 0;
116 virtual void seek(double seconds) = 0; 124 virtual void seek(double seconds) = 0;
117 virtual void setRate(double) = 0; 125 virtual void setRate(double) = 0;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 virtual void setPoster(const WebURL& poster) {} 228 virtual void setPoster(const WebURL& poster) {}
221 229
222 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When 230 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When
223 // 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
224 // entering fullscreen, and the WebMediaPlayer is responsible for displaying 232 // entering fullscreen, and the WebMediaPlayer is responsible for displaying
225 // the video in enteredFullscreen(). 233 // the video in enteredFullscreen().
226 virtual bool supportsOverlayFullscreenVideo() { return false; } 234 virtual bool supportsOverlayFullscreenVideo() { return false; }
227 // Inform WebMediaPlayer when the element has entered/exited fullscreen. 235 // Inform WebMediaPlayer when the element has entered/exited fullscreen.
228 virtual void enteredFullscreen() {} 236 virtual void enteredFullscreen() {}
229 virtual void exitedFullscreen() {} 237 virtual void exitedFullscreen() {}
238 // Inform WebMediaPlayer when the intersection of the video and viewport
239 // changes.
240 virtual void videoViewportIntersectionChanged(
241 const ViewportIntersectionInfo& info) {}
230 242
231 virtual void enabledAudioTracksChanged( 243 virtual void enabledAudioTracksChanged(
232 const WebVector<TrackId>& enabledTrackIds) {} 244 const WebVector<TrackId>& enabledTrackIds) {}
233 // |selectedTrackId| is null if no track is selected. 245 // |selectedTrackId| is null if no track is selected.
234 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {} 246 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {}
235 }; 247 };
236 248
237 } // namespace blink 249 } // namespace blink
238 250
239 #endif 251 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698