mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987979: Patch 12 - Add webrtc JNI target annotations to stop ProGuard from removing too much code. r=blassey
This commit is contained in:
parent
16ac9901ab
commit
b7df766f19
@ -20,6 +20,9 @@ import android.media.AudioRecord;
|
||||
import android.media.MediaRecorder.AudioSource;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mozilla.gecko.mozglue.WebRTCJNITarget;
|
||||
|
||||
@WebRTCJNITarget
|
||||
class WebRtcAudioRecord {
|
||||
private AudioRecord _audioRecord = null;
|
||||
|
||||
|
@ -20,6 +20,9 @@ import android.media.AudioRecord;
|
||||
import android.media.AudioTrack;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mozilla.gecko.mozglue.WebRTCJNITarget;
|
||||
|
||||
@WebRTCJNITarget
|
||||
class WebRtcAudioTrack {
|
||||
private AudioTrack _audioTrack = null;
|
||||
|
||||
|
@ -29,6 +29,7 @@ import android.view.SurfaceHolder.Callback;
|
||||
|
||||
import org.mozilla.gecko.GeckoAppShell;
|
||||
import org.mozilla.gecko.GeckoAppShell.AppStateListener;
|
||||
import org.mozilla.gecko.mozglue.WebRTCJNITarget;
|
||||
|
||||
// Wrapper for android Camera, with support for direct local preview rendering.
|
||||
// Threading notes: this class is called from ViE C++ code, and from Camera &
|
||||
@ -61,6 +62,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
// due to the application being backgrounded.
|
||||
private boolean mResumeCapture = false;
|
||||
|
||||
@WebRTCJNITarget
|
||||
public VideoCaptureAndroid(int id, long native_capturer) {
|
||||
this.id = id;
|
||||
this.native_capturer = native_capturer;
|
||||
@ -130,6 +132,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
// Note that this actually opens the camera, which can be a slow operation and
|
||||
// thus might be done on a background thread, but ViE API needs a
|
||||
// synchronous success return value so we can't do that.
|
||||
@WebRTCJNITarget
|
||||
private synchronized boolean startCapture(
|
||||
int width, int height, int min_mfps, int max_mfps) {
|
||||
Log.d(TAG, "startCapture: " + width + "x" + height + "@" +
|
||||
@ -222,6 +225,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
}
|
||||
|
||||
// Called by native code. Returns true when camera is known to be stopped.
|
||||
@WebRTCJNITarget
|
||||
private synchronized boolean stopCapture() {
|
||||
Log.d(TAG, "stopCapture");
|
||||
if (camera == null) {
|
||||
@ -256,9 +260,11 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
return false;
|
||||
}
|
||||
|
||||
@WebRTCJNITarget
|
||||
private native void ProvideCameraFrame(
|
||||
byte[] data, int length, long captureObject, int rotation);
|
||||
|
||||
@WebRTCJNITarget
|
||||
public synchronized void onPreviewFrame(byte[] data, Camera camera) {
|
||||
if (data != null) {
|
||||
ProvideCameraFrame(data, data.length, native_capturer, mCaptureRotation);
|
||||
@ -266,12 +272,14 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
}
|
||||
}
|
||||
|
||||
@WebRTCJNITarget
|
||||
public synchronized void surfaceChanged(
|
||||
SurfaceHolder holder, int format, int width, int height) {
|
||||
Log.d(TAG, "VideoCaptureAndroid::surfaceChanged ignored: " +
|
||||
format + ": " + width + "x" + height);
|
||||
}
|
||||
|
||||
@WebRTCJNITarget
|
||||
public synchronized void surfaceCreated(SurfaceHolder holder) {
|
||||
Log.d(TAG, "VideoCaptureAndroid::surfaceCreated");
|
||||
try {
|
||||
@ -283,6 +291,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback {
|
||||
}
|
||||
}
|
||||
|
||||
@WebRTCJNITarget
|
||||
public synchronized void surfaceDestroyed(SurfaceHolder holder) {
|
||||
Log.d(TAG, "VideoCaptureAndroid::surfaceDestroyed");
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user