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

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

Issue 526073004: Canvas: composite video on canvas correctly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months 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
« no previous file with comments | « Source/platform/graphics/skia/SkiaUtils.h ('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 "WebCanvas.h" 34 #include "WebCanvas.h"
35 #include "WebMediaSource.h" 35 #include "WebMediaSource.h"
36 #include "WebString.h" 36 #include "WebString.h"
37 #include "WebTimeRange.h" 37 #include "WebTimeRange.h"
38 #include "third_party/skia/include/core/SkXfermode.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 class WebAudioSourceProvider; 42 class WebAudioSourceProvider;
42 class WebAudioSourceProviderClient; 43 class WebAudioSourceProviderClient;
43 class WebContentDecryptionModule; 44 class WebContentDecryptionModule;
44 class WebMediaPlayerClient; 45 class WebMediaPlayerClient;
45 class WebString; 46 class WebString;
46 class WebURL; 47 class WebURL;
47 struct WebRect; 48 struct WebRect;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 virtual void play() = 0; 106 virtual void play() = 0;
106 virtual void pause() = 0; 107 virtual void pause() = 0;
107 virtual bool supportsSave() const = 0; 108 virtual bool supportsSave() const = 0;
108 virtual void seek(double seconds) = 0; 109 virtual void seek(double seconds) = 0;
109 virtual void setRate(double) = 0; 110 virtual void setRate(double) = 0;
110 virtual void setVolume(double) = 0; 111 virtual void setVolume(double) = 0;
111 virtual void setPreload(Preload) { }; 112 virtual void setPreload(Preload) { };
112 virtual WebTimeRanges buffered() const = 0; 113 virtual WebTimeRanges buffered() const = 0;
113 virtual double maxTimeSeekable() const = 0; 114 virtual double maxTimeSeekable() const = 0;
114 115
115 virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha) = 0;
116
117 // True if the loaded media has a playable video/audio track. 116 // True if the loaded media has a playable video/audio track.
118 virtual bool hasVideo() const = 0; 117 virtual bool hasVideo() const = 0;
119 virtual bool hasAudio() const = 0; 118 virtual bool hasAudio() const = 0;
120 119
121 // Dimension of the video. 120 // Dimension of the video.
122 virtual WebSize naturalSize() const = 0; 121 virtual WebSize naturalSize() const = 0;
123 122
124 // Getters of playback state. 123 // Getters of playback state.
125 virtual bool paused() const = 0; 124 virtual bool paused() const = 0;
126 virtual bool seeking() const = 0; 125 virtual bool seeking() const = 0;
(...skipping 10 matching lines...) Expand all
137 virtual bool didPassCORSAccessCheck() const = 0; 136 virtual bool didPassCORSAccessCheck() const = 0;
138 137
139 virtual double mediaTimeForTimeValue(double timeValue) const = 0; 138 virtual double mediaTimeForTimeValue(double timeValue) const = 0;
140 139
141 virtual unsigned decodedFrameCount() const = 0; 140 virtual unsigned decodedFrameCount() const = 0;
142 virtual unsigned droppedFrameCount() const = 0; 141 virtual unsigned droppedFrameCount() const = 0;
143 virtual unsigned corruptedFrameCount() const { return 0; }; 142 virtual unsigned corruptedFrameCount() const { return 0; };
144 virtual unsigned audioDecodedByteCount() const = 0; 143 virtual unsigned audioDecodedByteCount() const = 0;
145 virtual unsigned videoDecodedByteCount() const = 0; 144 virtual unsigned videoDecodedByteCount() const = 0;
146 145
146 virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha, SkXfermo de::Mode) = 0;
147 // Do a GPU-GPU textures copy if possible. 147 // Do a GPU-GPU textures copy if possible.
148 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed texture, unsigned level, unsigned internalFormat, unsigned type, bool premult iplyAlpha, bool flipY) { return false; } 148 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed texture, unsigned level, unsigned internalFormat, unsigned type, bool premult iplyAlpha, bool flipY) { return false; }
149 149
150 virtual WebAudioSourceProvider* audioSourceProvider() { return 0; } 150 virtual WebAudioSourceProvider* audioSourceProvider() { return 0; }
151 151
152 // Returns whether keySystem is supported. If true, the result will be 152 // Returns whether keySystem is supported. If true, the result will be
153 // reported by an event. 153 // reported by an event.
154 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } 154 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; }
155 virtual MediaKeyException addKey(const WebString& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataL ength, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupport ed; } 155 virtual MediaKeyException addKey(const WebString& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataL ength, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupport ed; }
156 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } 156 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; }
157 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm) { } 157 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm) { }
158 158
159 // Sets the poster image URL. 159 // Sets the poster image URL.
160 virtual void setPoster(const WebURL& poster) { } 160 virtual void setPoster(const WebURL& poster) { }
161 161
162 // Instruct WebMediaPlayer to enter/exit fullscreen. 162 // Instruct WebMediaPlayer to enter/exit fullscreen.
163 virtual void enterFullscreen() { } 163 virtual void enterFullscreen() { }
164 // Returns true if the player can enter fullscreen. 164 // Returns true if the player can enter fullscreen.
165 virtual bool canEnterFullscreen() const { return false; } 165 virtual bool canEnterFullscreen() const { return false; }
166 166
167 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } 167 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { }
168 // |selectedTrackId| is null if no track is selected. 168 // |selectedTrackId| is null if no track is selected.
169 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } 169 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { }
170 }; 170 };
171 171
172 } // namespace blink 172 } // namespace blink
173 173
174 #endif 174 #endif
OLDNEW
« no previous file with comments | « Source/platform/graphics/skia/SkiaUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698