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

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

Issue 3003873002: Bindings for injectable Java video encoders. (Closed)
Patch Set: Fix tests 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
« no previous file with comments | « webrtc/sdk/android/BUILD.gn ('k') | webrtc/sdk/android/api/org/webrtc/VideoEncoder.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7aef0230ded026244f6b9813ae8374d6de788952..6720cd7f568c25ab926a0baddbfceac3a36010db 100644
--- a/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
+++ b/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
@@ -18,10 +18,30 @@ import java.util.concurrent.TimeUnit;
* 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;
« no previous file with comments | « webrtc/sdk/android/BUILD.gn ('k') | webrtc/sdk/android/api/org/webrtc/VideoEncoder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698