Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: webrtc/sdk/android/api/org/webrtc/VideoFrame.java

Issue 3002563002: Add VideoSink interface to SurfaceViewRenderer. (Closed)
Patch Set: Address comments. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/api/org/webrtc/VideoFrame.java
diff --git a/webrtc/sdk/android/api/org/webrtc/VideoFrame.java b/webrtc/sdk/android/api/org/webrtc/VideoFrame.java
index 69b6aa6251710fd36fc1c22d4f342d083353701c..438df0f23e124166403f3afe901e3c18ecabadc8 100644
--- a/webrtc/sdk/android/api/org/webrtc/VideoFrame.java
+++ b/webrtc/sdk/android/api/org/webrtc/VideoFrame.java
@@ -91,6 +91,9 @@ public class VideoFrame {
if (buffer == null) {
throw new IllegalArgumentException("buffer not allowed to be null");
}
+ if (rotation % 90 != 0) {
+ throw new IllegalArgumentException("rotation must be a multiple of 90");
+ }
this.buffer = buffer;
this.rotation = rotation;
this.timestampNs = timestampNs;
@@ -114,6 +117,20 @@ public class VideoFrame {
return timestampNs;
}
+ public int getRotatedWidth() {
+ if (rotation % 180 == 0) {
+ return buffer.getWidth();
+ }
+ return buffer.getHeight();
+ }
+
+ public int getRotatedHeight() {
+ if (rotation % 180 == 0) {
+ return buffer.getHeight();
+ }
+ return buffer.getWidth();
+ }
+
/**
* Reference counting of the underlying buffer.
*/
« no previous file with comments | « webrtc/sdk/android/api/org/webrtc/SurfaceViewRenderer.java ('k') | webrtc/sdk/android/api/org/webrtc/VideoRenderer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698