From c7d1f116465d3fd83572d2624117f91042c898bc Mon Sep 17 00:00:00 2001 From: Magnus Jedvert Date: Mon, 12 Sep 2022 13:02:49 +0000 Subject: [PATCH] Android: Expose VideoFrame.TextureBuffer.applyTransformMatrix Bug: None Change-Id: Id1c35dd1aa231ea25831d0354b8125d6c29d3834 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274708 Commit-Queue: Magnus Jedvert Reviewed-by: Fabian Bergmark Cr-Commit-Position: refs/heads/main@{#38061} --- sdk/android/api/org/webrtc/TextureBufferImpl.java | 1 + sdk/android/api/org/webrtc/VideoFrame.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/sdk/android/api/org/webrtc/TextureBufferImpl.java b/sdk/android/api/org/webrtc/TextureBufferImpl.java index 31d0456970..c08fc4c29b 100644 --- a/sdk/android/api/org/webrtc/TextureBufferImpl.java +++ b/sdk/android/api/org/webrtc/TextureBufferImpl.java @@ -169,6 +169,7 @@ public class TextureBufferImpl implements VideoFrame.TextureBuffer { * existing buffer is unchanged. The given transform matrix is applied first when texture * coordinates are still in the unmodified [0, 1] range. */ + @Override public TextureBufferImpl applyTransformMatrix( Matrix transformMatrix, int newWidth, int newHeight) { return applyTransformMatrix(transformMatrix, /* unscaledWidth= */ newWidth, diff --git a/sdk/android/api/org/webrtc/VideoFrame.java b/sdk/android/api/org/webrtc/VideoFrame.java index e9f3b52455..52a378b8f8 100644 --- a/sdk/android/api/org/webrtc/VideoFrame.java +++ b/sdk/android/api/org/webrtc/VideoFrame.java @@ -136,6 +136,16 @@ public class VideoFrame implements RefCounted { * the coordinate that should be used to sample that location from the buffer. */ Matrix getTransformMatrix(); + + /** + * Create a new TextureBufferImpl with an applied transform matrix and a new size. The existing + * buffer is unchanged. The given transform matrix is applied first when texture coordinates are + * still in the unmodified [0, 1] range. + */ + default TextureBuffer applyTransformMatrix( + Matrix transformMatrix, int newWidth, int newHeight) { + throw new UnsupportedOperationException("Not implemented"); + } } private final Buffer buffer;