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

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

Issue 1315323006: webgl: optimize webgl.texSubImage2D(video) path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Blink change to here. Unify full copy and sub copy path using struct. Created 5 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CopyType copyType;
177 bool flipY) { return false; } 174 unsigned target;
175 unsigned texture;
176 unsigned internalFormat;
177 unsigned type;
178 int level;
179 int xoffset;
180 int yoffset;
181 bool premultiplyAlpha;
182 bool flipY;
183 };
184 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, const CopyVideoTextureParams&) = 0;
178 185
179 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } 186 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; }
180 187
181 // Returns whether keySystem is supported. If true, the result will be 188 // Returns whether keySystem is supported. If true, the result will be
182 // reported by an event. 189 // reported by an event.
183 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } 190 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; } 191 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; } 192 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"); } 193 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); }
187 194
188 // Sets the poster image URL. 195 // Sets the poster image URL.
189 virtual void setPoster(const WebURL& poster) { } 196 virtual void setPoster(const WebURL& poster) { }
190 197
191 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When 198 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When
192 // this is true, the video layer will be removed from the layer tree when 199 // this is true, the video layer will be removed from the layer tree when
193 // entering fullscreen, and the WebMediaPlayer is responsible for displaying 200 // entering fullscreen, and the WebMediaPlayer is responsible for displaying
194 // the video in enterFullscreen(). 201 // the video in enterFullscreen().
195 virtual bool supportsOverlayFullscreenVideo() { return false; } 202 virtual bool supportsOverlayFullscreenVideo() { return false; }
196 // Instruct WebMediaPlayer to enter/exit fullscreen. 203 // Instruct WebMediaPlayer to enter/exit fullscreen.
197 virtual void enterFullscreen() { } 204 virtual void enterFullscreen() { }
198 205
199 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } 206 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { }
200 // |selectedTrackId| is null if no track is selected. 207 // |selectedTrackId| is null if no track is selected.
201 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } 208 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { }
202 }; 209 };
203 210
204 } // namespace blink 211 } // namespace blink
205 212
206 #endif 213 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698