2018-05-16 12:49:47 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package org.webrtc;
|
|
|
|
|
|
|
|
|
|
public class JavaVideoSourceTestHelper {
|
|
|
|
|
@CalledByNative
|
2018-07-06 11:25:25 +02:00
|
|
|
public static void startCapture(CapturerObserver observer, boolean success) {
|
2018-05-16 12:49:47 +02:00
|
|
|
observer.onCapturerStarted(success);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@CalledByNative
|
2018-07-06 11:25:25 +02:00
|
|
|
public static void stopCapture(CapturerObserver observer) {
|
2018-05-16 12:49:47 +02:00
|
|
|
observer.onCapturerStopped();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@CalledByNative
|
2018-11-15 12:07:32 +01:00
|
|
|
public static void deliverFrame(
|
|
|
|
|
int width, int height, int rotation, long timestampNs, CapturerObserver observer) {
|
2018-06-14 12:23:01 +02:00
|
|
|
observer.onFrameCaptured(
|
2018-11-15 12:07:32 +01:00
|
|
|
new VideoFrame(JavaI420Buffer.allocate(width, height), rotation, timestampNs));
|
2018-05-16 12:49:47 +02:00
|
|
|
}
|
|
|
|
|
}
|