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}
This commit is contained in:
sakal
2016-08-31 02:53:51 -07:00
committed by Commit bot
parent 70279215a6
commit 9e4a3040ed
10 changed files with 2 additions and 725 deletions

View File

@ -111,21 +111,10 @@ public class PeerConnectionFactory {
nativeCreateLocalMediaStream(nativeFactory, label));
}
// The VideoSource takes ownership of |capturer|, so capturer.dispose() should not be called
// manually after this. Video capturer is automatically started so there is no need to call
// startCapture after this method.
public VideoSource createVideoSource(
VideoCapturer capturer, MediaConstraints constraints) {
final EglBase.Context eglContext =
localEglbase == null ? null : localEglbase.getEglBaseContext();
return new VideoSource(nativeCreateVideoSource(nativeFactory,
eglContext, capturer, constraints));
}
public VideoSource createVideoSource(VideoCapturer capturer) {
final EglBase.Context eglContext =
localEglbase == null ? null : localEglbase.getEglBaseContext();
long nativeAndroidVideoTrackSource = nativeCreateVideoSource2(nativeFactory, eglContext);
long nativeAndroidVideoTrackSource = nativeCreateVideoSource(nativeFactory, eglContext);
VideoCapturer.CapturerObserver capturerObserver
= new VideoCapturer.AndroidVideoTrackSourceObserver(nativeAndroidVideoTrackSource);
nativeInitializeVideoCapturer(nativeFactory, capturer, nativeAndroidVideoTrackSource,
@ -248,10 +237,6 @@ public class PeerConnectionFactory {
long nativeFactory, String label);
private static native long nativeCreateVideoSource(
long nativeFactory, EglBase.Context eglContext, VideoCapturer videoCapturer,
MediaConstraints constraints);
private static native long nativeCreateVideoSource2(
long nativeFactory, EglBase.Context eglContext);
private static native void nativeInitializeVideoCapturer(

View File

@ -39,53 +39,6 @@ public interface VideoCapturer {
void onOutputFormatRequest(int width, int height, int framerate);
}
// An implementation of CapturerObserver that forwards all calls from
// Java to the C layer.
static class NativeObserver implements CapturerObserver {
private final long nativeCapturer;
public NativeObserver(long nativeCapturer) {
this.nativeCapturer = nativeCapturer;
}
@Override
public void onCapturerStarted(boolean success) {
nativeCapturerStarted(nativeCapturer, success);
}
@Override
public void onCapturerStopped() {}
@Override
public void onByteBufferFrameCaptured(byte[] data, int width, int height,
int rotation, long timeStamp) {
nativeOnByteBufferFrameCaptured(nativeCapturer, data, data.length, width, height, rotation,
timeStamp);
}
@Override
public void onTextureFrameCaptured(
int width, int height, int oesTextureId, float[] transformMatrix, int rotation,
long timestamp) {
nativeOnTextureFrameCaptured(nativeCapturer, width, height, oesTextureId, transformMatrix,
rotation, timestamp);
}
@Override
public void onOutputFormatRequest(int width, int height, int framerate) {
nativeOnOutputFormatRequest(nativeCapturer, width, height, framerate);
}
private native void nativeCapturerStarted(long nativeCapturer,
boolean success);
private native void nativeOnByteBufferFrameCaptured(long nativeCapturer,
byte[] data, int length, int width, int height, int rotation, long timeStamp);
private native void nativeOnTextureFrameCaptured(long nativeCapturer, int width, int height,
int oesTextureId, float[] transformMatrix, int rotation, long timestamp);
private native void nativeOnOutputFormatRequest(long nativeCapturer,
int width, int height, int framerate);
}
// An implementation of CapturerObserver that forwards all calls from
// Java to the C layer.
static class AndroidVideoTrackSourceObserver implements CapturerObserver {