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

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

Issue 1413833006: Reland of "webgl: optimize webgl.texSubImage2D(video) path." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO comments 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.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 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 CopyVideoTextureParams(CopyType copyType, unsigned target,
177 bool flipY) { return false; } 174 unsigned texture, unsigned internalFormat, unsigned type, int level,
175 int xoffset, int yoffset, bool premultiplyAlpha, bool flipY)
176 : copyType(copyType), target(target), texture(texture)
177 , internalFormat(internalFormat) , type(type), level(level)
178 , xoffset(xoffset), yoffset(yoffset)
179 , premultiplyAlpha(premultiplyAlpha), flipY(flipY)
180 { }
181 CopyType copyType;
182 unsigned target;
183 unsigned texture;
184 unsigned internalFormat;
185 unsigned type;
186 int level;
187 int xoffset;
188 int yoffset;
189 bool premultiplyAlpha;
190 bool flipY;
191 };
192 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, const CopyVideoTextureParams&) = 0;
178 193
179 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } 194 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; }
180 195
181 // Returns whether keySystem is supported. If true, the result will be 196 // Returns whether keySystem is supported. If true, the result will be
182 // reported by an event. 197 // reported by an event.
183 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } 198 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; } 199 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; } 200 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"); } 201 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); }
187 202
188 // Sets the poster image URL. 203 // Sets the poster image URL.
189 virtual void setPoster(const WebURL& poster) { } 204 virtual void setPoster(const WebURL& poster) { }
190 205
191 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When 206 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When
192 // this is true, the video layer will be removed from the layer tree when 207 // this is true, the video layer will be removed from the layer tree when
193 // entering fullscreen, and the WebMediaPlayer is responsible for displaying 208 // entering fullscreen, and the WebMediaPlayer is responsible for displaying
194 // the video in enterFullscreen(). 209 // the video in enterFullscreen().
195 virtual bool supportsOverlayFullscreenVideo() { return false; } 210 virtual bool supportsOverlayFullscreenVideo() { return false; }
196 // Instruct WebMediaPlayer to enter/exit fullscreen. 211 // Instruct WebMediaPlayer to enter/exit fullscreen.
197 virtual void enterFullscreen() { } 212 virtual void enterFullscreen() { }
198 213
199 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } 214 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { }
200 // |selectedTrackId| is null if no track is selected. 215 // |selectedTrackId| is null if no track is selected.
201 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } 216 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { }
202 }; 217 };
203 218
204 } // namespace blink 219 } // namespace blink
205 220
206 #endif 221 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/gpu/Extensions3DUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698