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

Issue 1370063003: Android SurfaceViewRenderer: Enable hardware scaler (Closed)

Created:
5 years, 2 months ago by magjed_webrtc
Modified:
4 years, 10 months ago
Reviewers:
hbos
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), Andrew MacDonald, tterriberry_mozilla.com, qiang.lu, niklas.enbom, peah-webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Android SurfaceViewRenderer: Enable hardware scaler This CL enables the hardware scaler by calling SurfaceHoler.setFixedSize() in SurfaceViewRenderer. This gives a big reduction in GPU load for SurfaceViewRenderers with layout size > frame size. In an AppRTCDemo loopback call with 720p video this gives around 2x total GPU load reduction.

Patch Set 1 : #

Total comments: 5

Patch Set 2 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -6 lines) Patch
M talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java View 1 4 chunks +22 lines, -6 lines 0 comments Download

Messages

Total messages: 10 (8 generated)
magjed_webrtc
hbos - Please take a look.
5 years, 1 month ago (2015-11-12 09:32:09 UTC) #9
hbos
5 years, 1 month ago (2015-11-12 11:35:48 UTC) #10
First pass, mostly questions about the code since I don't know it too well

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
File talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java (right):

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java:62: private
static class LayoutConfiguration {
If two objects are considered equal in java they should produce the same
hashCode() so when overriding equals() you should generally override hashCode()
as well.
  Considering this is a private helper class not used in any hash tables or the
like I'm fine with not overriding hashCode if you don't want to bother with
that. But if you break the hashCode contract I think there should be a comment
about it above the class.

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java:340: }
What about MeasureSpec.AT_MOST? What if X is restricted but not Y, will it be
stretched/squished?

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java:354:
Math.max((float) layoutSize.x / frameWidth, (float) layoutSize.y / frameHeight);
Do we always want the max scale? Thinking about black borders vs scale-to-fill
etc.

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java:361:
surfaceHeight = Math.round(layoutSize.y / displayScale);
How does the HW scaler know to take care of the upscaling?

https://codereview.webrtc.org/1370063003/diff/100001/talk/app/webrtc/java/and...
talk/app/webrtc/java/android/org/webrtc/SurfaceViewRenderer.java:471: private
boolean checkConsistentLayout() {
if (Thread.currentThread() != renderThread) throw exception

Powered by Google App Engine
This is Rietveld 408576698