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

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

Issue 3010623002: Change capture time format to nanoseconds in EncodedImage. (Closed)
Patch Set: Update decoder wrapper. 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 | « no previous file | webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.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 ec45f0a47f01b261c36bf104ab1abc177dcfe04f..7aef0230ded026244f6b9813ae8374d6de788952 100644
--- a/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
+++ b/webrtc/sdk/android/api/org/webrtc/EncodedImage.java
@@ -11,6 +11,7 @@
package org.webrtc;
import java.nio.ByteBuffer;
+import java.util.concurrent.TimeUnit;
/**
* An encoded frame from a video stream. Used as an input for decoders and as an output for
@@ -26,18 +27,20 @@ public class EncodedImage {
public final ByteBuffer buffer;
public final int encodedWidth;
public final int encodedHeight;
- public final long captureTimeMs;
+ public final long captureTimeMs; // Deprecated
+ public final long captureTimeNs;
public final FrameType frameType;
public final int rotation;
public final boolean completeFrame;
public final Integer qp;
- private EncodedImage(ByteBuffer buffer, int encodedWidth, int encodedHeight, long captureTimeMs,
+ private EncodedImage(ByteBuffer buffer, int encodedWidth, int encodedHeight, long captureTimeNs,
FrameType frameType, int rotation, boolean completeFrame, Integer qp) {
this.buffer = buffer;
this.encodedWidth = encodedWidth;
this.encodedHeight = encodedHeight;
- this.captureTimeMs = captureTimeMs;
+ this.captureTimeMs = TimeUnit.NANOSECONDS.toMillis(captureTimeNs);
+ this.captureTimeNs = captureTimeNs;
this.frameType = frameType;
this.rotation = rotation;
this.completeFrame = completeFrame;
@@ -52,7 +55,7 @@ public class EncodedImage {
private ByteBuffer buffer;
private int encodedWidth;
private int encodedHeight;
- private long captureTimeMs;
+ private long captureTimeNs;
private EncodedImage.FrameType frameType;
private int rotation;
private boolean completeFrame;
@@ -75,8 +78,14 @@ public class EncodedImage {
return this;
}
+ @Deprecated
public Builder setCaptureTimeMs(long captureTimeMs) {
- this.captureTimeMs = captureTimeMs;
+ this.captureTimeNs = TimeUnit.MILLISECONDS.toNanos(captureTimeMs);
+ return this;
+ }
+
+ public Builder setCaptureTimeNs(long captureTimeNs) {
+ this.captureTimeNs = captureTimeNs;
return this;
}
@@ -101,7 +110,7 @@ public class EncodedImage {
}
public EncodedImage createEncodedImage() {
- return new EncodedImage(buffer, encodedWidth, encodedHeight, captureTimeMs, frameType,
+ return new EncodedImage(buffer, encodedWidth, encodedHeight, captureTimeNs, frameType,
rotation, completeFrame, qp);
}
}
« no previous file with comments | « no previous file | webrtc/sdk/android/instrumentationtests/src/org/webrtc/HardwareVideoEncoderTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698