Skip to content

Commit d263de7

Browse files
committed
Correct documentation and method name to the correct unit, microseconds.
1 parent ab57f2c commit d263de7

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/main/java/us/ihmc/robotDataLogger/logger/MagewellVideoDataLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void startCapture() throws Exception
107107
Frame capturedFrame;
108108
while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null))
109109
{
110-
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
110+
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
111111
magewellMuxer.recordFrame(capturedFrame, videoTimestamp);
112112
receivedFrameAtTime(System.nanoTime(), magewellMuxer.getTimeStamp(), 1, 60000);
113113
}

src/main/java/us/ihmc/tools/CaptureTimeTools.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
public class CaptureTimeTools
44
{
55
/**
6-
* This takes the current time in milliseconds, and returns the seconds that have passed from the start time.
6+
* This takes the current time in milliseconds, and returns the microseconds that have passed from the start time.
77
* @param currentTimeInMilliSeconds is the current time that you want to compare too
8-
* @param startTime is the start time from when capture started
9-
* @return the time in seconds that has passed since the start time
8+
* @param startTime is the start time (ms) from when capture started
9+
* @return the time in microseconds that has passed since the start time
1010
*/
11-
public static long timeSinceStartedCaptureInSeconds(long currentTimeInMilliSeconds, long startTime)
11+
public static long timeSinceStartedCaptureInMicroseconds(long currentTimeInMilliSeconds, long startTime)
1212
{
1313
return 1000 * (currentTimeInMilliSeconds - startTime);
1414
}

src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoJavaCVWindowsScreenRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException
5252
if (startTime == 0)
5353
startTime = System.currentTimeMillis();
5454

55-
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
55+
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
5656

5757
if (videoTS > recorder.getTimestamp())
5858
{

src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoWindowsScreenRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException
5252
if (startTime == 0)
5353
startTime = System.currentTimeMillis();
5454

55-
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
55+
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
5656

5757
if (videoTS > recorder.getTimestamp())
5858
{

src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleMagewellCapture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static void main(String[] args) throws InterruptedException
7676
LogTools.info("Starting capture");
7777
while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null))
7878
{
79-
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
79+
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
8080
magewellMuxer.recordFrame(capturedFrame, videoTimestamp);
8181

8282
// Shows the captured frame its currently recording

0 commit comments

Comments
 (0)