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}
This commit is contained in:
Magnus Jedvert
2018-06-14 12:23:01 +02:00
committed by Commit Bot
parent d1f970dc43
commit 6507054db1
8 changed files with 597 additions and 30 deletions

View File

@ -24,12 +24,9 @@ public class JavaVideoSourceTestHelper {
}
@CalledByNative
public static void deliverFrame(VideoCapturer.CapturerObserver observer) {
final int FRAME_WIDTH = 2;
final int FRAME_HEIGHT = 3;
final int FRAME_ROTATION = 180;
observer.onFrameCaptured(new VideoFrame(
JavaI420Buffer.allocate(FRAME_WIDTH, FRAME_HEIGHT), FRAME_ROTATION, 0 /* timestampNs */));
public static void deliverFrame(
int width, int height, int rotation, VideoCapturer.CapturerObserver observer) {
observer.onFrameCaptured(
new VideoFrame(JavaI420Buffer.allocate(width, height), rotation, 0 /* timestampNs= */));
}
}