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

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

Issue 1418513016: Revert of webgl: optimize webgl.texSubImage2D(video) path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
167 // Do a GPU-GPU textures copy. If the copy is impossible or fails, it return s false. 170 // Do a GPU-GPU textures copy. If the copy is impossible or fails, it return s false.
168 // Copy the video frame texture to full texture or sub texture depending on |copyType|. 171 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed target,
169 // If FullCopy, |xoffset| and |yoffset| must be 0. 172 unsigned texture, unsigned internalFormat, unsigned type, int level,
170 // If SubCopy, |internalFormat| and |type| must be GL_FALSE. 173 bool premultiplyAlpha, bool flipY) { return false; }
171 struct CopyVideoTextureParams { 174 // Copy sub video frame texture to |texture|. If the copy is impossible or f ails, it returns false.
172 enum CopyType { FullCopy, SubCopy }; 175 virtual bool copyVideoSubTextureToPlatformTexture(WebGraphicsContext3D*, uns igned target,
173 CopyVideoTextureParams(CopyType copyType, unsigned target, 176 unsigned texture, int level, int xoffset, int yoffset, bool premultiplyA lpha,
174 unsigned texture, unsigned internalFormat, unsigned type, int level, 177 bool flipY) { return false; }
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;
193 178
194 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } 179 virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; }
195 180
196 // Returns whether keySystem is supported. If true, the result will be 181 // Returns whether keySystem is supported. If true, the result will be
197 // reported by an event. 182 // reported by an event.
198 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; } 183 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; }
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; } 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 cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } 185 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; }
201 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); } 186 virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, Web ContentDecryptionModuleResult result) { result.completeWithError(WebContentDecry ptionModuleExceptionNotSupportedError, 0, "ERROR"); }
202 187
203 // Sets the poster image URL. 188 // Sets the poster image URL.
204 virtual void setPoster(const WebURL& poster) { } 189 virtual void setPoster(const WebURL& poster) { }
205 190
206 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When 191 // Whether the WebMediaPlayer supports overlay fullscreen video mode. When
207 // this is true, the video layer will be removed from the layer tree when 192 // this is true, the video layer will be removed from the layer tree when
208 // entering fullscreen, and the WebMediaPlayer is responsible for displaying 193 // entering fullscreen, and the WebMediaPlayer is responsible for displaying
209 // the video in enterFullscreen(). 194 // the video in enterFullscreen().
210 virtual bool supportsOverlayFullscreenVideo() { return false; } 195 virtual bool supportsOverlayFullscreenVideo() { return false; }
211 // Instruct WebMediaPlayer to enter/exit fullscreen. 196 // Instruct WebMediaPlayer to enter/exit fullscreen.
212 virtual void enterFullscreen() { } 197 virtual void enterFullscreen() { }
213 198
214 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { } 199 virtual void enabledAudioTracksChanged(const WebVector<TrackId>& enabledTrac kIds) { }
215 // |selectedTrackId| is null if no track is selected. 200 // |selectedTrackId| is null if no track is selected.
216 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { } 201 virtual void selectedVideoTrackChanged(TrackId* selectedTrackId) { }
217 }; 202 };
218 203
219 } // namespace blink 204 } // namespace blink
220 205
221 #endif 206 #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