Skip to content

Commit 9e4a304

Browse files
sakalCommit bot
authored andcommitted
Reland of move the old AndroidVideoCapturer stack code. (patchset #1 id:1 of https://codereview.webrtc.org/2291583002/ )
Reason for revert: Downstream apps should now be fixed. Original issue's description: > Revert of Remove the old AndroidVideoCapturer stack code. (patchset #2 id:20001 of https://codereview.webrtc.org/2235893003/ ) > > Reason for revert: > Breaks downstream. > > Original issue's description: > > Remove the old AndroidVideoCapturer stack code. > > > > This code is no longer needed. Apps should be using the new API introduced here: https://codereview.webrtc.org/2127893002/ > > > > Committed: https://crrev.com/1b365a8db070f9cdcbf35ec871f758dcd909e51d > > Cr-Commit-Position: refs/heads/master@{#13950} > > TBR=magjed@webrtc.org,glaznev@webrtc.org,kjellander@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://crrev.com/e39f251dacf66e50153bcda615f06b7c59e5856b > Cr-Commit-Position: refs/heads/master@{#13958} TBR=magjed@webrtc.org,glaznev@webrtc.org,kjellander@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. Review-Url: https://codereview.webrtc.org/2298063003 Cr-Commit-Position: refs/heads/master@{#13988}
1 parent 7027921 commit 9e4a304

10 files changed

Lines changed: 2 additions & 725 deletions

webrtc/api/BUILD.gn

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ if (is_android && !build_with_chromium) {
157157
"android/jni/androidmetrics_jni.cc",
158158
"android/jni/androidnetworkmonitor_jni.cc",
159159
"android/jni/androidnetworkmonitor_jni.h",
160-
"android/jni/androidvideocapturer_jni.cc",
161-
"android/jni/androidvideocapturer_jni.h",
162160
"android/jni/androidvideotracksource_jni.cc",
163161
"android/jni/classreferenceholder.cc",
164162
"android/jni/classreferenceholder.h",
@@ -169,8 +167,6 @@ if (is_android && !build_with_chromium) {
169167
"android/jni/peerconnection_jni.cc",
170168
"android/jni/surfacetexturehelper_jni.cc",
171169
"android/jni/surfacetexturehelper_jni.h",
172-
"androidvideocapturer.cc",
173-
"androidvideocapturer.h",
174170
"androidvideotracksource.cc",
175171
"androidvideotracksource.h",
176172
]

webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,10 @@ public MediaStream createLocalMediaStream(String label) {
111111
nativeCreateLocalMediaStream(nativeFactory, label));
112112
}
113113

114-
// The VideoSource takes ownership of |capturer|, so capturer.dispose() should not be called
115-
// manually after this. Video capturer is automatically started so there is no need to call
116-
// startCapture after this method.
117-
public VideoSource createVideoSource(
118-
VideoCapturer capturer, MediaConstraints constraints) {
119-
final EglBase.Context eglContext =
120-
localEglbase == null ? null : localEglbase.getEglBaseContext();
121-
return new VideoSource(nativeCreateVideoSource(nativeFactory,
122-
eglContext, capturer, constraints));
123-
}
124-
125114
public VideoSource createVideoSource(VideoCapturer capturer) {
126115
final EglBase.Context eglContext =
127116
localEglbase == null ? null : localEglbase.getEglBaseContext();
128-
long nativeAndroidVideoTrackSource = nativeCreateVideoSource2(nativeFactory, eglContext);
117+
long nativeAndroidVideoTrackSource = nativeCreateVideoSource(nativeFactory, eglContext);
129118
VideoCapturer.CapturerObserver capturerObserver
130119
= new VideoCapturer.AndroidVideoTrackSourceObserver(nativeAndroidVideoTrackSource);
131120
nativeInitializeVideoCapturer(nativeFactory, capturer, nativeAndroidVideoTrackSource,
@@ -248,10 +237,6 @@ private static native long nativeCreateLocalMediaStream(
248237
long nativeFactory, String label);
249238

250239
private static native long nativeCreateVideoSource(
251-
long nativeFactory, EglBase.Context eglContext, VideoCapturer videoCapturer,
252-
MediaConstraints constraints);
253-
254-
private static native long nativeCreateVideoSource2(
255240
long nativeFactory, EglBase.Context eglContext);
256241

257242
private static native void nativeInitializeVideoCapturer(

webrtc/api/android/java/src/org/webrtc/VideoCapturer.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -39,53 +39,6 @@ void onTextureFrameCaptured(
3939
void onOutputFormatRequest(int width, int height, int framerate);
4040
}
4141

42-
// An implementation of CapturerObserver that forwards all calls from
43-
// Java to the C layer.
44-
static class NativeObserver implements CapturerObserver {
45-
private final long nativeCapturer;
46-
47-
public NativeObserver(long nativeCapturer) {
48-
this.nativeCapturer = nativeCapturer;
49-
}
50-
51-
@Override
52-
public void onCapturerStarted(boolean success) {
53-
nativeCapturerStarted(nativeCapturer, success);
54-
}
55-
56-
@Override
57-
public void onCapturerStopped() {}
58-
59-
@Override
60-
public void onByteBufferFrameCaptured(byte[] data, int width, int height,
61-
int rotation, long timeStamp) {
62-
nativeOnByteBufferFrameCaptured(nativeCapturer, data, data.length, width, height, rotation,
63-
timeStamp);
64-
}
65-
66-
@Override
67-
public void onTextureFrameCaptured(
68-
int width, int height, int oesTextureId, float[] transformMatrix, int rotation,
69-
long timestamp) {
70-
nativeOnTextureFrameCaptured(nativeCapturer, width, height, oesTextureId, transformMatrix,
71-
rotation, timestamp);
72-
}
73-
74-
@Override
75-
public void onOutputFormatRequest(int width, int height, int framerate) {
76-
nativeOnOutputFormatRequest(nativeCapturer, width, height, framerate);
77-
}
78-
79-
private native void nativeCapturerStarted(long nativeCapturer,
80-
boolean success);
81-
private native void nativeOnByteBufferFrameCaptured(long nativeCapturer,
82-
byte[] data, int length, int width, int height, int rotation, long timeStamp);
83-
private native void nativeOnTextureFrameCaptured(long nativeCapturer, int width, int height,
84-
int oesTextureId, float[] transformMatrix, int rotation, long timestamp);
85-
private native void nativeOnOutputFormatRequest(long nativeCapturer,
86-
int width, int height, int framerate);
87-
}
88-
8942
// An implementation of CapturerObserver that forwards all calls from
9043
// Java to the C layer.
9144
static class AndroidVideoTrackSourceObserver implements CapturerObserver {

0 commit comments

Comments
 (0)