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

Issue 1111653004: Replace SW YUV conversion with higher quality Shader+FBO in pepper video path. (Closed)

Created:
5 years, 7 months ago by CodeByThePound
Modified:
5 years, 7 months ago
Reviewers:
nvidiagridtest, codebythepound, *bbudge, *piman
CC:
chromium-reviews, mkwst+moarreviews-renderer_chromium.org, darin-cc_chromium.org, jam, mlamouri+watch-content_chromium.org, sandersd (OOO until July 31), elijahtaylor1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace SW YUV conversion with higher quality Shader+FBO in pepper video path. Improve quality of software rendering path by replacing call to SkCanvasVideoRenderer::ConvertVideoFrameToRGB in video_decoder_shim with a shader and render-to-texture. Questions about this CL: * gpu::gles2::GLESInterface Would it be correct to send a base::WeakPtr<GLESInterface> to the YUVConv class constructor to use for everything in this instance of the class? ATM, it just sends a GLESInterface* to methods that need it (which is probably wrong). It was not clear to me whether the GLESInterface * could change between the ::Initialize() method * OpenGL state YUVConv::convert() changes texture bindings and viewport. I currently read the old viewport so that I can restore it - is this necessary? I don't save former texture bindings either - is this necessary? * OpenGL 'getters' When compiled debug, why do all output variables to GL functions need to contain either 0 or -1 before calling the function? In my case GetIntegerv and GetShaderiv. * Errors It is possible that shader compile could fail. If it fails, an error string can be retrieved. What should I do in this case? Same with opengl errors. I thought it would be good to check for them in debug builds, but what do I do if I catch one? * Texture formats I need a single-component texture format for uploading the Y,U,V components. On desktop I would use GL_RED, but unextended GLES does not have GL_RED, you have to use GL_LUMINANCE. The current code uses GL_RED, and it works, but do I need to check for GLES extension for GL_RED or can I assume it is there? * Texture sizes Even with the description in video_frame.h the distinction between coded_size visible_size and natural_size was not entirely clear to me. It seemed the output texture size in VideoDecoderShim::OnOutputComplete followed "coded_size" so that is what I used as well. It was my intention to always decode the entire image to the user's buffer, not some subregion - so is my code correct? * FBO's I see that DrawBuffers is DrawBuffersEXT, and that the default GLES implementation does not support it. Is it not necessary in this environment to call DrawBuffers? * ::SendPictures If there is a format error yuv_converter will return false. How can an error be handled here? * testing I have tested with the video_decoder example program (using VPx) and our application which uses h264. I believe both use I420 format. Do you have an easy way to test other formats? Is this class part of a unit test? BUG=483183, 477737 R=bbudge@chromium.org TEST=Run pepper video_decoder example in ppapi/examples/video_decode Committed: https://crrev.com/f5e606219178026623ee38907d14bff14cb83c7b Cr-Commit-Position: refs/heads/master@{#329942}

Patch Set 1 #

Patch Set 2 : Updates based on comments. #

Patch Set 3 : Hopefully final changes. #

Patch Set 4 : updates to failure path in CreateShader #

Total comments: 9

Patch Set 5 : Fix coding style issues. #

Total comments: 10

Patch Set 6 : Fixed a Windows build warning. #

Patch Set 7 : Added InvalidateGrContext calls for Skia State. #

Total comments: 42

Patch Set 8 : Fixed nits. Added support for all YUV formats that SW path supported. #

Patch Set 9 : Removed unwanted comments. #

Patch Set 10 : Added missing period. #

Total comments: 23

Patch Set 11 : Further refinements. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+598 lines, -45 lines) Patch
M content/renderer/pepper/video_decoder_shim.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -2 lines 0 comments Download
M content/renderer/pepper/video_decoder_shim.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +594 lines, -43 lines 0 comments Download

Messages

Total messages: 55 (15 generated)
CodeByThePound
5 years, 7 months ago (2015-04-30 01:50:34 UTC) #1
CodeByThePound
5 years, 7 months ago (2015-04-30 01:53:02 UTC) #2
nvidiagridtest
5 years, 7 months ago (2015-04-30 01:57:44 UTC) #3
bbudge
High level comments: 1) Read chromium coding style, based on Google coding style. 2) Is ...
5 years, 7 months ago (2015-04-30 19:36:57 UTC) #5
CodeByThePound
Based on comments, I made the following changes: Moved class outside of VideoDecoderShim. Fixed some ...
5 years, 7 months ago (2015-05-01 01:26:30 UTC) #7
CodeByThePound
Now passes cc_blink::ContextProviderWebContext to constructor. Removed Shutdown method and now shuts things down in destructor. ...
5 years, 7 months ago (2015-05-01 17:52:54 UTC) #8
CodeByThePound
Please review. Thanks.
5 years, 7 months ago (2015-05-01 19:08:11 UTC) #10
bbudge
A few comments. Before I go any deeper, I suggest running 'git cl format' on ...
5 years, 7 months ago (2015-05-01 20:08:59 UTC) #11
CodeByThePound
Sorry about the coding style issues. They should be fixed now. Ran git-cl format and ...
5 years, 7 months ago (2015-05-01 21:32:44 UTC) #12
bbudge
On 2015/05/01 21:32:44, CodeByThePound wrote: > Sorry about the coding style issues. They should be ...
5 years, 7 months ago (2015-05-01 22:16:46 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1111653004/100001
5 years, 7 months ago (2015-05-05 00:06:43 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-05 00:58:49 UTC) #18
piman
The approach seems reasonable overall. The main thing is the context sharing wrt Skia (which ...
5 years, 7 months ago (2015-05-05 02:21:56 UTC) #19
CodeByThePound
https://codereview.chromium.org/1111653004/diff/80001/content/renderer/pepper/video_decoder_shim.cc File content/renderer/pepper/video_decoder_shim.cc (right): https://codereview.chromium.org/1111653004/diff/80001/content/renderer/pepper/video_decoder_shim.cc#newcode154 content/renderer/pepper/video_decoder_shim.cc:154: gl_->GetShaderiv(shader, GL_COMPILE_STATUS, &status); On 2015/05/05 02:21:55, piman (Very slow ...
5 years, 7 months ago (2015-05-05 22:00:06 UTC) #20
piman
On 2015/05/05 22:00:06, CodeByThePound wrote: > https://codereview.chromium.org/1111653004/diff/80001/content/renderer/pepper/video_decoder_shim.cc > File content/renderer/pepper/video_decoder_shim.cc (right): > > https://codereview.chromium.org/1111653004/diff/80001/content/renderer/pepper/video_decoder_shim.cc#newcode154 > ...
5 years, 7 months ago (2015-05-05 22:33:16 UTC) #21
CodeByThePound
> > Do you want me to make this modification as part of this CL ...
5 years, 7 months ago (2015-05-05 23:23:55 UTC) #22
piman
On Tue, May 5, 2015 at 4:23 PM, <CodeByThePound@gmail.com> wrote: > > Do you want ...
5 years, 7 months ago (2015-05-05 23:28:43 UTC) #23
CodeByThePound
Did you have something as simple as a non-virtual method like this in mind (in ...
5 years, 7 months ago (2015-05-06 18:05:43 UTC) #24
piman
On 2015/05/06 18:05:43, CodeByThePound wrote: > Did you have something as simple as a non-virtual ...
5 years, 7 months ago (2015-05-06 18:49:04 UTC) #25
CodeByThePound
Created https://codereview.chromium.org/1131723002/ for the InvalidateGrContext() method.
5 years, 7 months ago (2015-05-06 21:54:54 UTC) #26
CodeByThePound
Added InvalidateGrContext() calls to Initialize and Convert.
5 years, 7 months ago (2015-05-12 02:08:31 UTC) #27
piman
https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc File content/renderer/pepper/video_decoder_shim.cc (right): https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc#newcode35 content/renderer/pepper/video_decoder_shim.cc:35: // nit: remove blank comment line https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc#newcode36 content/renderer/pepper/video_decoder_shim.cc:36: // ...
5 years, 7 months ago (2015-05-12 03:00:26 UTC) #28
CodeByThePound
I'll remove all the requested comments and add the periods. > https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc#newcode104 > content/renderer/pepper/video_decoder_shim.cc:104: kProgram_GrGLBackendState) ...
5 years, 7 months ago (2015-05-12 05:47:18 UTC) #29
piman
On Mon, May 11, 2015 at 10:47 PM, <CodeByThePound@gmail.com> wrote: > I'll remove all the ...
5 years, 7 months ago (2015-05-12 19:32:19 UTC) #30
CodeByThePound
Fixed nits. Added support for all the same YUV formats that the software decode path ...
5 years, 7 months ago (2015-05-13 04:14:06 UTC) #32
piman
LGTM with a couple of leftover nits. https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc File content/renderer/pepper/video_decoder_shim.cc (right): https://codereview.chromium.org/1111653004/diff/120001/content/renderer/pepper/video_decoder_shim.cc#newcode853 content/renderer/pepper/video_decoder_shim.cc:853: // initialize ...
5 years, 7 months ago (2015-05-13 04:20:37 UTC) #33
CodeByThePound
Fixed remaining issues.
5 years, 7 months ago (2015-05-13 04:52:58 UTC) #34
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1111653004/170003
5 years, 7 months ago (2015-05-13 04:53:38 UTC) #37
commit-bot: I haz the power
Dry run: All required reviewers (with asterisk prefixes) have not yet approved this CL. No ...
5 years, 7 months ago (2015-05-13 04:53:46 UTC) #39
bbudge
https://codereview.chromium.org/1111653004/diff/170003/content/renderer/pepper/video_decoder_shim.cc File content/renderer/pepper/video_decoder_shim.cc (right): https://codereview.chromium.org/1111653004/diff/170003/content/renderer/pepper/video_decoder_shim.cc#newcode60 content/renderer/pepper/video_decoder_shim.cc:60: GLuint vtx_buffer_; nit: vertex_buffer_ https://codereview.chromium.org/1111653004/diff/170003/content/renderer/pepper/video_decoder_shim.cc#newcode90 content/renderer/pepper/video_decoder_shim.cc:90: const scoped_refptr<cc_blink::ContextProviderWebContext>& ctx_p) ...
5 years, 7 months ago (2015-05-14 16:45:49 UTC) #41
CodeByThePound
https://codereview.chromium.org/1111653004/diff/170003/content/renderer/pepper/video_decoder_shim.cc File content/renderer/pepper/video_decoder_shim.cc (right): https://codereview.chromium.org/1111653004/diff/170003/content/renderer/pepper/video_decoder_shim.cc#newcode60 content/renderer/pepper/video_decoder_shim.cc:60: GLuint vtx_buffer_; On 2015/05/14 16:45:48, bbudge (OOO week of ...
5 years, 7 months ago (2015-05-14 17:42:09 UTC) #42
bbudge
LGTM Thank you piman for picking this up for me. +elijah FYI Software fallback potentially ...
5 years, 7 months ago (2015-05-14 20:47:59 UTC) #43
CodeByThePound
Thanks Bill for reviewing while OOO!
5 years, 7 months ago (2015-05-14 20:49:47 UTC) #44
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1111653004/190001
5 years, 7 months ago (2015-05-14 20:50:46 UTC) #47
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-14 21:41:44 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1111653004/190001
5 years, 7 months ago (2015-05-14 21:53:13 UTC) #51
commit-bot: I haz the power
Committed patchset #11 (id:190001)
5 years, 7 months ago (2015-05-14 22:00:02 UTC) #52
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/f5e606219178026623ee38907d14bff14cb83c7b Cr-Commit-Position: refs/heads/master@{#329942}
5 years, 7 months ago (2015-05-14 22:00:43 UTC) #53
DaleCurtis
Is this better than the gpu based conversion path we have in the compositor today? ...
5 years, 7 months ago (2015-05-14 23:15:41 UTC) #54
piman
5 years, 7 months ago (2015-05-14 23:25:55 UTC) #55
Message was sent while issue was closed.
On Thu, May 14, 2015 at 4:15 PM, <dalecurtis@chromium.org> wrote:

> Is this better than the gpu based conversion path we have in the compositor
> today?  If so it'd be awesome to integrate it for non-PPAPI video playback
> too.
>

It's essentially the same.


> https://codereview.chromium.org/1111653004/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698