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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/DesktopView.java

Issue 47873012: Fix NullPointerException when connected but no video frame decoded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 package org.chromium.chromoting; 5 package org.chromium.chromoting;
6 6
7 import android.app.ActionBar; 7 import android.app.ActionBar;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.graphics.Bitmap; 9 import android.graphics.Bitmap;
10 import android.graphics.Canvas; 10 import android.graphics.Canvas;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 * cause the UI to lag. Specifically, it is currently invoked on the native 76 * cause the UI to lag. Specifically, it is currently invoked on the native
77 * graphics thread using a JNI. 77 * graphics thread using a JNI.
78 */ 78 */
79 @Override 79 @Override
80 public void run() { 80 public void run() {
81 if (Looper.myLooper() == Looper.getMainLooper()) { 81 if (Looper.myLooper() == Looper.getMainLooper()) {
82 Log.w("deskview", "Canvas being redrawn on UI thread"); 82 Log.w("deskview", "Canvas being redrawn on UI thread");
83 } 83 }
84 84
85 Bitmap image = JniInterface.getVideoFrame(); 85 Bitmap image = JniInterface.getVideoFrame();
86 if (image == null) {
87 // This can happen if the client is connected, but a complete video frame has not yet
88 // been decoded.
89 return;
90 }
86 91
87 int width = image.getWidth(); 92 int width = image.getWidth();
88 int height = image.getHeight(); 93 int height = image.getHeight();
89 boolean sizeChanged = false; 94 boolean sizeChanged = false;
90 synchronized (mRenderData) { 95 synchronized (mRenderData) {
91 if (mRenderData.imageWidth != width || mRenderData.imageHeight != he ight) { 96 if (mRenderData.imageWidth != width || mRenderData.imageHeight != he ight) {
92 // TODO(lambroslambrou): Move this code into a sizeChanged() cal lback, to be 97 // TODO(lambroslambrou): Move this code into a sizeChanged() cal lback, to be
93 // triggered from JniInterface (on the display thread) when the remote screen size 98 // triggered from JniInterface (on the display thread) when the remote screen size
94 // changes. 99 // changes.
95 mRenderData.imageWidth = width; 100 mRenderData.imageWidth = width;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 @Override 224 @Override
220 public void showKeyboard() { 225 public void showKeyboard() {
221 // TODO(lambroslambrou): Implement this. 226 // TODO(lambroslambrou): Implement this.
222 } 227 }
223 228
224 @Override 229 @Override
225 public void transformationChanged() { 230 public void transformationChanged() {
226 requestRepaint(); 231 requestRepaint();
227 } 232 }
228 } 233 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698