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

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

Issue 3003873002: Bindings for injectable Java video encoders. (Closed)
Patch Set: Rebase 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/EncodedImage.java
diff --git a/webrtc/sdk/android/api/org/webrtc/EncodedImage.java b/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
index ec45f0a47f01b261c36bf104ab1abc177dcfe04f..aabc19ed279d48dd7fb19a4e769796f62b6d223c 100644
--- a/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
+++ b/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
@@ -17,10 +17,30 @@ import java.nio.ByteBuffer;
* encoders.
*/
public class EncodedImage {
+ // Must be kept in sync with common_types.h FrameType.
public enum FrameType {
- EmptyFrame,
- VideoFrameKey,
- VideoFrameDelta,
+ EmptyFrame(0),
+ VideoFrameKey(3),
+ VideoFrameDelta(4);
+
+ private final int nativeIndex;
+
+ private FrameType(int nativeIndex) {
+ this.nativeIndex = nativeIndex;
+ }
+
+ public int getNative() {
+ return nativeIndex;
+ }
+
+ public static FrameType fromNative(int nativeIndex) {
+ for (FrameType type : FrameType.values()) {
+ if (type.nativeIndex == nativeIndex) {
+ return type;
+ }
+ }
+ throw new IllegalArgumentException("Unknown native frame type: " + nativeIndex);
+ }
}
public final ByteBuffer buffer;

Powered by Google App Engine
This is Rietveld 408576698