Skip to content

Correct documentation and method name to the correct unit, microseconds. #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void startCapture() throws Exception
Frame capturedFrame;
while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null))
{
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
magewellMuxer.recordFrame(capturedFrame, videoTimestamp);
receivedFrameAtTime(System.nanoTime(), magewellMuxer.getTimeStamp(), 1, 60000);
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/us/ihmc/tools/CaptureTimeTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
public class CaptureTimeTools
{
/**
* This takes the current time in milliseconds, and returns the seconds that have passed from the start time.
* This takes the current time in milliseconds, and returns the microseconds that have passed from the start time.
* @param currentTimeInMilliSeconds is the current time that you want to compare too
* @param startTime is the start time from when capture started
* @return the time in seconds that has passed since the start time
* @param startTime is the start time (ms) from when capture started
* @return the time in microseconds that has passed since the start time
*/
public static long timeSinceStartedCaptureInSeconds(long currentTimeInMilliSeconds, long startTime)
public static long timeSinceStartedCaptureInMicroseconds(long currentTimeInMilliSeconds, long startTime)
{
return 1000 * (currentTimeInMilliSeconds - startTime);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException
if (startTime == 0)
startTime = System.currentTimeMillis();

long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);

if (videoTS > recorder.getTimestamp())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException
if (startTime == 0)
startTime = System.currentTimeMillis();

long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);

if (videoTS > recorder.getTimestamp())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void main(String[] args) throws InterruptedException
LogTools.info("Starting capture");
while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null))
{
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime);
long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime);
magewellMuxer.recordFrame(capturedFrame, videoTimestamp);

// Shows the captured frame its currently recording
Expand Down
Loading