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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 // This must stay in sync with WebGLRenderingContextBase::TexImageFunctionID. |
| 109 enum TexImageFunctionID { |
| 110 TexImage2D, |
| 111 TexSubImage2D, |
| 112 TexImage3D, |
| 113 TexSubImage3D |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 unsigned target, | 209 unsigned target, |
202 unsigned texture, | 210 unsigned texture, |
203 int level, | 211 int level, |
204 int xoffset, | 212 int xoffset, |
205 int yoffset, | 213 int yoffset, |
206 bool premultiplyAlpha, | 214 bool premultiplyAlpha, |
207 bool flipY) { | 215 bool flipY) { |
208 return false; | 216 return false; |
209 } | 217 } |
210 | 218 |
| 219 // Do tex(Sub)Image2D/3D for current frame. If it is not implemented for given |
| 220 // parameters or fails, it returns false. |
| 221 // The method is wrapping calls to glTexImage2D, glTexSubImage2D, |
| 222 // glTexImage3D and glTexSubImage3D and parameters have the same name and |
| 223 // meaning. |
| 224 // Texture needs to be created and bound to active texture unit before this |
| 225 // call. In addition, TexSubImage2D and TexSubImage3D require that previous |
| 226 // TexImage2D and TexSubImage3D calls, respectivelly, defined the texture |
| 227 // content. |
| 228 virtual bool texImageImpl(TexImageFunctionID functionID, |
| 229 unsigned target, |
| 230 gpu::gles2::GLES2Interface* gl, |
| 231 int level, |
| 232 int internalformat, |
| 233 unsigned format, |
| 234 unsigned type, |
| 235 int xoffset, |
| 236 int yoffset, |
| 237 int zoffset, |
| 238 bool flipY, |
| 239 bool premultiplyAlpha) { |
| 240 return false; |
| 241 } |
| 242 |
211 virtual WebAudioSourceProvider* getAudioSourceProvider() { return nullptr; } | 243 virtual WebAudioSourceProvider* getAudioSourceProvider() { return nullptr; } |
212 | 244 |
213 virtual void setContentDecryptionModule( | 245 virtual void setContentDecryptionModule( |
214 WebContentDecryptionModule* cdm, | 246 WebContentDecryptionModule* cdm, |
215 WebContentDecryptionModuleResult result) { | 247 WebContentDecryptionModuleResult result) { |
216 result.completeWithError( | 248 result.completeWithError( |
217 WebContentDecryptionModuleExceptionNotSupportedError, 0, "ERROR"); | 249 WebContentDecryptionModuleExceptionNotSupportedError, 0, "ERROR"); |
218 } | 250 } |
219 | 251 |
220 // Sets the poster image URL. | 252 // Sets the poster image URL. |
(...skipping 10 matching lines...) Expand all Loading... |
231 | 263 |
232 virtual void enabledAudioTracksChanged( | 264 virtual void enabledAudioTracksChanged( |
233 const WebVector<TrackId>& enabledTrackIds) {} | 265 const WebVector<TrackId>& enabledTrackIds) {} |
234 // |selectedTrackId| is null if no track is selected. | 266 // |selectedTrackId| is null if no track is selected. |
235 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {} | 267 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) {} |
236 }; | 268 }; |
237 | 269 |
238 } // namespace blink | 270 } // namespace blink |
239 | 271 |
240 #endif | 272 #endif |
OLD | NEW |