Bug 1051695: Reduce use of proxy methods and generated getters in 'webrtc' code. r=rnewman

This commit is contained in:
Chris Kitching 2014-07-28 17:33:01 -07:00
parent d0951a5800
commit 26ca52ed2b
2 changed files with 15 additions and 9 deletions

View File

@ -41,25 +41,28 @@ import org.mozilla.gecko.mozglue.WebRTCJNITarget;
public class VideoCaptureAndroid implements PreviewCallback, Callback, AppStateListener {
private final static String TAG = "WEBRTC-JC";
private Camera camera; // Only non-null while capturing.
// Only non-null while capturing, accessed exclusively from synchronized methods.
/* inner-access */ Camera camera;
private Camera.CameraInfo info;
private final int id;
private final long native_capturer; // |VideoCaptureAndroid*| in C++.
private SurfaceHolder localPreview;
private SurfaceTexture dummySurfaceTexture;
// Arbitrary queue depth. Higher number means more memory allocated & held,
// lower number means more sensitivity to processing time in the client (and
// potentially stalling the capturer if it runs out of buffers to write to).
private final int numCaptureBuffers = 3;
// Needed to start/stop/rotate camera.
private volatile int mCaptureRotation;
private int mCaptureWidth;
private int mCaptureHeight;
private int mCaptureMinFPS;
private int mCaptureMaxFPS;
/* inner-access */ volatile int mCaptureRotation;
/* inner-access */ int mCaptureWidth;
/* inner-access */ int mCaptureHeight;
/* inner-access */ int mCaptureMinFPS;
/* inner-access */ int mCaptureMaxFPS;
// Are we being told to start/stop the camera, or just suspending/resuming
// due to the application being backgrounded.
private boolean mResumeCapture;
/* inner-access */ boolean mResumeCapture;
@WebRTCJNITarget
public VideoCaptureAndroid(int id, long native_capturer) {

View File

@ -29,14 +29,17 @@ import org.mozilla.gecko.mozglue.WebRTCJNITarget;
public class ViEAndroidGLES20 extends GLSurfaceView
implements GLSurfaceView.Renderer {
private static String TAG = "WEBRTC-JR";
/* inner-access */ static final String TAG = "WEBRTC-JR";
private static final boolean DEBUG = false;
// True if onSurfaceCreated has been called.
private boolean surfaceCreated;
private boolean openGLCreated;
// True if NativeFunctionsRegistered has been called.
private boolean nativeFunctionsRegisted;
private ReentrantLock nativeFunctionLock = new ReentrantLock();
// Address of Native object that will do the drawing.
private long nativeObject;
private int viewWidth;
@ -103,7 +106,7 @@ public class ViEAndroidGLES20 extends GLSurfaceView
}
}
private static void checkEglError(String prompt, EGL10 egl) {
/* inner-access */ static void checkEglError(String prompt, EGL10 egl) {
int error;
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));