Files
platform-external-webrtc/sdk/android/native_unittests/org/webrtc/JavaVideoSourceTestHelper.java
Magnus Jedvert 6507054db1 Android: Add tests for VideoFrame.Buffer.toI420() and cropAndScale()
This CL adds tests that are primarily targeting
VideoFrame.Buffer.toI420() and cropAndScale(), but includes the whole
chain for YuvConverter, GlRectDrawer, and VideoFrameDrawer.

It also includes a couple of fixes to bugs that were exposed by the new
tests.

Bug: webrtc:9186, webrtc:9391
Change-Id: I5eb62979a8fd8def28c3cb2e82dcede57c42216f
Reviewed-on: https://webrtc-review.googlesource.com/83163
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23611}
2018-06-14 11:06:37 +00:00

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