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

Side by Side Diff: media/renderers/skcanvas_video_renderer.h

Issue 2476693002: WebGL & 16-bit video stream: upload to FLOAT texture. (Closed)
Patch Set: Lossless access to 16-bit video stream using WebGL GL_FLOAT texture. Created 4 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 5 #ifndef MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 6 #define MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 bool CopyVideoFrameTexturesToGLTexture( 85 bool CopyVideoFrameTexturesToGLTexture(
86 const Context3D& context_3d, 86 const Context3D& context_3d,
87 gpu::gles2::GLES2Interface* destination_gl, 87 gpu::gles2::GLES2Interface* destination_gl,
88 const scoped_refptr<VideoFrame>& video_frame, 88 const scoped_refptr<VideoFrame>& video_frame,
89 unsigned int texture, 89 unsigned int texture,
90 unsigned int internal_format, 90 unsigned int internal_format,
91 unsigned int type, 91 unsigned int type,
92 bool premultiply_alpha, 92 bool premultiply_alpha,
93 bool flip_y); 93 bool flip_y);
94 94
95 // Method handles reinterpreting two components RG8 as 16 bit value for Y16
96 // format and optimizing upload-to-texture for single plane non-yuv plannar
97 // video frame formats and specific target texture formats. If needed, there
98 // is a conversion followed by a tex(Sub)Image2D or tex(Sub)Image3D call.
99 // Format specific optimizations here are targeting fallback path in
100 // WebGLRenderingContextBase::texImage2D.
101 // |format|, |internal_format|, |type| specify target texture |texture|.
102 // |xoffset|, |yoffset|, |zoffset| are used when functionID defines sub image
103 // calls.
104 // Returns false if there is no implementation for given parameters or if the
hubbe 2016/11/07 22:16:55 Please make it return an enum so that we can separ
aleksandar.stojiljkovic 2016/11/16 20:01:24 Done - you're right - no need for enum. Runtime fa
105 // call fails.
106 static bool TexImageImpl(const char* functionID,
hubbe 2016/11/07 22:16:55 I don't quite get what functionID is doing here, o
aleksandar.stojiljkovic 2016/11/16 20:01:24 Done. Replaced char* / enum in WebMediaPlayer.h.
107 unsigned target,
108 gpu::gles2::GLES2Interface* gl,
109 VideoFrame* video_frame,
110 int level,
111 int internalformat,
112 unsigned format,
113 unsigned type,
114 int xoffset,
115 int yoffset,
116 int zoffset,
117 bool flipY,
118 bool premultiplyAlpha);
119
95 // In general, We hold the most recently painted frame to increase the 120 // In general, We hold the most recently painted frame to increase the
96 // performance for the case that the same frame needs to be painted 121 // performance for the case that the same frame needs to be painted
97 // repeatedly. Call this function if you are sure the most recent frame will 122 // repeatedly. Call this function if you are sure the most recent frame will
98 // never be painted again, so we can release the resource. 123 // never be painted again, so we can release the resource.
99 void ResetCache(); 124 void ResetCache();
100 125
101 void CorrectLastImageDimensions(const SkIRect& visible_rect); 126 void CorrectLastImageDimensions(const SkIRect& visible_rect);
102 127
103 // Used for unit test. 128 // Used for unit test.
104 SkISize LastImageDimensionsForTesting(); 129 SkISize LastImageDimensionsForTesting();
(...skipping 16 matching lines...) Expand all
121 146
122 // Used for unit test. 147 // Used for unit test.
123 SkISize last_image_dimensions_for_testing_; 148 SkISize last_image_dimensions_for_testing_;
124 149
125 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); 150 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer);
126 }; 151 };
127 152
128 } // namespace media 153 } // namespace media
129 154
130 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_ 155 #endif // MEDIA_RENDERERS_SKCANVAS_VIDEO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698