Skip to content

Commit

Permalink
Android: Expose VideoFrame.TextureBuffer.applyTransformMatrix
Browse files Browse the repository at this point in the history
Bug: None
Change-Id: Id1c35dd1aa231ea25831d0354b8125d6c29d3834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274708
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Fabian Bergmark <fabianbergmark@google.com>
Cr-Commit-Position: refs/heads/main@{#38061}
  • Loading branch information
Hnoo112233 authored and WebRTC LUCI CQ committed Sep 12, 2022
1 parent ceb71cd commit c7d1f11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdk/android/api/org/webrtc/TextureBufferImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public YuvConverter getYuvConverter() {
* 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,
Expand Down
10 changes: 10 additions & 0 deletions sdk/android/api/org/webrtc/VideoFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ public int getGlTarget() {
* 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;
Expand Down

0 comments on commit c7d1f11

Please sign in to comment.