Files
platform-external-webrtc/sdk/android/native_unittests/org/webrtc/JavaVideoSourceTestHelper.java
Sami Kalliomäki b2daaaacbd Update capturer/test code to use the new interface VideoCapturer.
Bug: webrtc:9496
Change-Id: I9adf2c341b831820bbe71f2511616b629c9e1acc
Reviewed-on: https://webrtc-review.googlesource.com/87306
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23869}
2018-07-06 10:42:11 +00:00

32 lines
1.0 KiB
Java

/*
* 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;
import org.webrtc.VideoCapturer;
public class JavaVideoSourceTestHelper {
@CalledByNative
public static void startCapture(CapturerObserver observer, boolean success) {
observer.onCapturerStarted(success);
}
@CalledByNative
public static void stopCapture(CapturerObserver observer) {
observer.onCapturerStopped();
}
@CalledByNative
public static void deliverFrame(int width, int height, int rotation, CapturerObserver observer) {
observer.onFrameCaptured(
new VideoFrame(JavaI420Buffer.allocate(width, height), rotation, 0 /* timestampNs= */));
}
}