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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 virtual double mediaTimeForTimeValue(double timeValue) const = 0; | 157 virtual double mediaTimeForTimeValue(double timeValue) const = 0; |
158 | 158 |
159 virtual unsigned decodedFrameCount() const = 0; | 159 virtual unsigned decodedFrameCount() const = 0; |
160 virtual unsigned droppedFrameCount() const = 0; | 160 virtual unsigned droppedFrameCount() const = 0; |
161 virtual unsigned corruptedFrameCount() const { return 0; } | 161 virtual unsigned corruptedFrameCount() const { return 0; } |
162 virtual unsigned audioDecodedByteCount() const = 0; | 162 virtual unsigned audioDecodedByteCount() const = 0; |
163 virtual unsigned videoDecodedByteCount() const = 0; | 163 virtual unsigned videoDecodedByteCount() const = 0; |
164 | 164 |
165 virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha, SkXfermo de::Mode) = 0; | 165 virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha, SkXfermo de::Mode) = 0; |
166 | 166 |
167 // TODO(dshwang): remove non-|target| version. crbug.com/349871 | |
168 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed texture, unsigned internalFormat, unsigned type, bool premultiplyAlpha, bool flipY) { return false; } | |
169 | |
170 // Do a GPU-GPU textures copy. If the copy is impossible or fails, it return s false. | 167 // Do a GPU-GPU textures copy. If the copy is impossible or fails, it return s false. |
171 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed target, | 168 // Copy the video frame texture to full texture or sub texture depending on |copyType|. |
172 unsigned texture, unsigned internalFormat, unsigned type, int level, | 169 // If FullCopy, |xoffset| and |yoffset| must be 0. |
173 bool premultiplyAlpha, bool flipY) { return false; } | 170 // If SubCopy, |internalFormat| and |type| must be GL_FALSE. |
174 // Copy sub video frame texture to |texture|. If the copy is impossible or f ails, it returns false. | 171 struct CopyVideoTextureParams { |
175 virtual bool copyVideoSubTextureToPlatformTexture(WebGraphicsContext3D*, uns igned target, | 172 enum CopyType { FullCopy, SubCopy }; |
176 unsigned texture, int level, int xoffset, int yoffset, bool premultiplyA lpha, | 173 CopyVideoTextureParams() = delete; |
philipj_slow
2015/10/27 16:02:17
Is this actually needed, doesn't declaring a const
dshwang
2015/10/27 16:18:01
good point. it's not needed. I removed it in the n
| |
177 bool flipY) { return false; } | 174 CopyVideoTextureParams(CopyType copyType, unsigned target, |
175 unsigned texture, unsigned internalFormat, unsigned type, int level, | |
176 int xoffset, int yoffset, bool premultiplyAlpha, bool flipY) | |
177 : copyType(copyType), target(target), texture(texture) | |
178 , internalFormat(internalFormat) , type(type), level(level) | |
179 , xoffset(xoffset), yoffset(yoffset) | |
180 , premultiplyAlpha(premultiplyAlpha), flipY(flipY) | |
181 { } | |
182 CopyType copyType; | |
183 unsigned target; | |
184 unsigned texture; | |
185 unsigned internalFormat; | |
186 unsigned type; | |
187 int level; | |
188 int xoffset; | |
189 int yoffset; | |
190 bool premultiplyAlpha; | |
191 bool flipY; | |
192 }; | |
193 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, const CopyVideoTextureParams&) = 0; | |
178 | 194 |
179 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } | 195 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } |
180 | 196 |
181 // Returns whether keySystem is supported. If true, the result will be | 197 // Returns whether keySystem is supported. If true, the result will be |
182 // reported by an event. | 198 // reported by an event. |
183 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } | 199 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } |
184 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; } | 200 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; } |
185 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } | 201 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } |
186 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); } | 202 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); } |
187 | 203 |
188 // Sets the poster image URL. | 204 // Sets the poster image URL. |
189 virtual void setPoster(const WebURL& poster) { } | 205 virtual void setPoster(const WebURL& poster) { } |
190 | 206 |
191 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When | 207 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When |
192 // this is true, the video layer will be removed from the layer tree when | 208 // this is true, the video layer will be removed from the layer tree when |
193 // entering fullscreen, and the WebMediaPlayer is responsible for displaying | 209 // entering fullscreen, and the WebMediaPlayer is responsible for displaying |
194 // the video in enterFullscreen(). | 210 // the video in enterFullscreen(). |
195 virtual bool supportsOverlayFullscreenVideo() { return false; } | 211 virtual bool supportsOverlayFullscreenVideo() { return false; } |
196 // Instruct WebMediaPlayer to enter/exit fullscreen. | 212 // Instruct WebMediaPlayer to enter/exit fullscreen. |
197 virtual void enterFullscreen() { } | 213 virtual void enterFullscreen() { } |
198 | 214 |
199 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } | 215 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } |
200 // |selectedTrackId| is null if no track is selected. | 216 // |selectedTrackId| is null if no track is selected. |
201 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } | 217 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } |
202 }; | 218 }; |
203 | 219 |
204 } // namespace blink | 220 } // namespace blink |
205 | 221 |
206 #endif | 222 #endif |
OLD | NEW |