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

Issue 24072012: Hold video frame in Bitmap instead of keeping a ByteBuffer reference. (Closed)

Created:
7 years, 3 months ago by Lambros
Modified:
7 years, 2 months ago
CC:
chromium-reviews, jamiewalch+watch_chromium.org, dcaiafa+watch_chromium.org, hclam+watch_chromium.org, wez+watch_chromium.org, amit, sanjeevr, garykac+watch_chromium.org, lambroslambrou+watch_chromium.org, rmsousa+watch_chromium.org, weitaosu+watch_chromium.org, alexeypa+watch_chromium.org, sergeyu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Hold video frame in Bitmap instead of keeping a ByteBuffer reference. Sometimes, the DesktopView was repainted whilst |JniInterface.sBuffer| no longer referred to valid frame data. This CL cleans things up by replacing the ByteBuffer with a Bitmap, and having JniFrameConsumer copy the completely-decoded data directly into the Java Bitmap. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228898

Patch Set 1 : #

Total comments: 9

Patch Set 2 : Add graphics thread check #

Patch Set 3 : rebase #

Patch Set 4 : Pass DesktopFrame to ChromotingJniRuntime #

Patch Set 5 : rebase #

Patch Set 6 : Allow FrameConsumer to operate directly on Bitmap pixels #

Total comments: 21

Patch Set 7 : Address comments #

Total comments: 12

Patch Set 8 : Keep track of buffers in JniFrameConsumer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -118 lines) Patch
M remoting/android/java/src/org/chromium/chromoting/DesktopView.java View 1 chunk +1 line, -1 line 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java View 1 2 3 4 5 6 4 chunks +35 lines, -24 lines 0 comments Download
A remoting/client/jni/DEPS View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M remoting/client/jni/chromoting_jni_runtime.h View 1 2 3 4 5 6 2 chunks +8 lines, -2 lines 0 comments Download
M remoting/client/jni/chromoting_jni_runtime.cc View 1 2 3 4 5 2 chunks +24 lines, -14 lines 0 comments Download
M remoting/client/jni/jni_frame_consumer.h View 1 2 3 4 5 6 7 2 chunks +27 lines, -8 lines 0 comments Download
M remoting/client/jni/jni_frame_consumer.cc View 1 2 3 4 5 6 7 4 chunks +58 lines, -69 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
Lambros
Found this bug whilst working on the perf improvements we discussed (byte-swapping the video after ...
7 years, 3 months ago (2013-09-20 02:50:07 UTC) #1
garykac
https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode315 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:315: int[] frame = new int[width * height]; Can you ...
7 years, 3 months ago (2013-09-23 19:47:42 UTC) #2
Lambros
ping? https://chromiumcodereview.appspot.com/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://chromiumcodereview.appspot.com/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode315 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:315: int[] frame = new int[width * height]; On ...
7 years, 2 months ago (2013-09-25 23:15:11 UTC) #3
Sergey Ulanov
https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode318 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:318: buffer.asIntBuffer().get(frame, 0, frame.length); This copies content of the buffer. ...
7 years, 2 months ago (2013-09-25 23:32:08 UTC) #4
solb
lgtm https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode318 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:318: buffer.asIntBuffer().get(frame, 0, frame.length); On 2013/09/25 23:32:08, Sergey Ulanov ...
7 years, 2 months ago (2013-09-26 14:21:36 UTC) #5
Lambros
Sergey, ptal https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://codereview.chromium.org/24072012/diff/2001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode318 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:318: buffer.asIntBuffer().get(frame, 0, frame.length); On 2013/09/26 14:21:36, solb ...
7 years, 2 months ago (2013-09-26 22:29:36 UTC) #6
Lambros
ptal This restricts copying to only the region that was decoded, instead of copying the ...
7 years, 2 months ago (2013-10-07 22:31:21 UTC) #7
Sergey Ulanov
https://codereview.chromium.org/24072012/diff/37001/remoting/client/jni/chromoting_jni_runtime.h File remoting/client/jni/chromoting_jni_runtime.h (right): https://codereview.chromium.org/24072012/diff/37001/remoting/client/jni/chromoting_jni_runtime.h#newcode21 remoting/client/jni/chromoting_jni_runtime.h:21: class DesktopFrame; Not used in this file. https://codereview.chromium.org/24072012/diff/37001/remoting/client/jni/chromoting_jni_runtime.h#newcode92 remoting/client/jni/chromoting_jni_runtime.h:92: ...
7 years, 2 months ago (2013-10-08 22:15:02 UTC) #8
Yaron
That dep is fine. However, I think you'll really want to switch to jni generator ...
7 years, 2 months ago (2013-10-09 06:42:29 UTC) #9
Lambros
Also fixed some order-of-destruction issues. ptal https://codereview.chromium.org/24072012/diff/37001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java File remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java (right): https://codereview.chromium.org/24072012/diff/37001/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java#newcode322 remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java:322: synchronized (JniInterface.class) { ...
7 years, 2 months ago (2013-10-10 01:35:57 UTC) #10
Yaron
lgtm for original question (deps). Please wait for other reviewers https://codereview.chromium.org/24072012/diff/37001/remoting/client/jni/chromoting_jni_runtime.cc File remoting/client/jni/chromoting_jni_runtime.cc (right): https://codereview.chromium.org/24072012/diff/37001/remoting/client/jni/chromoting_jni_runtime.cc#newcode177 ...
7 years, 2 months ago (2013-10-10 11:13:36 UTC) #11
Sergey Ulanov
https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc File remoting/client/jni/jni_frame_consumer.cc (right): https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc#newcode27 remoting/client/jni/jni_frame_consumer.cc:27: in_dtor_ = true; Don't need this. https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc#newcode32 remoting/client/jni/jni_frame_consumer.cc:32: base::Bind(&base::WaitableEvent::Signal, ...
7 years, 2 months ago (2013-10-11 20:32:17 UTC) #12
solb
On 2013/10/11 20:32:17, Sergey Ulanov wrote: > https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc > File remoting/client/jni/jni_frame_consumer.cc (right): > > https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc#newcode27 ...
7 years, 2 months ago (2013-10-15 22:15:08 UTC) #13
Lambros
Sergey and Sol: awaiting your LGs :) https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc File remoting/client/jni/jni_frame_consumer.cc (right): https://codereview.chromium.org/24072012/diff/45001/remoting/client/jni/jni_frame_consumer.cc#newcode27 remoting/client/jni/jni_frame_consumer.cc:27: in_dtor_ = ...
7 years, 2 months ago (2013-10-15 23:50:32 UTC) #14
Sergey Ulanov
LGTM, thanks for fixing the leak!
7 years, 2 months ago (2013-10-15 23:55:16 UTC) #15
solb
On 2013/10/15 23:55:16, Sergey Ulanov wrote: > LGTM, thanks for fixing the leak! LGTM as ...
7 years, 2 months ago (2013-10-16 05:54:20 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lambroslambrou@chromium.org/24072012/59001
7 years, 2 months ago (2013-10-16 07:51:34 UTC) #17
commit-bot: I haz the power
7 years, 2 months ago (2013-10-16 11:25:42 UTC) #18
Message was sent while issue was closed.
Change committed as 228898

Powered by Google App Engine
This is Rietveld 408576698