Skip to content
New issue

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

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

Already on GitHub? # to your account

Use CS Core on supported platforms for USB cameras #956

Merged
merged 5 commits into from
Jul 14, 2020

Conversation

ThadHouse
Copy link
Contributor

Can be more reliable then OpenCV, and handles disconnects properly

Depends on #955 to build on azure.

Existing version was deleted
Can be more reliable then OpenCV, and handles disconnects properly
@codecov-io
Copy link

codecov-io commented Oct 29, 2019

Codecov Report

Merging #956 into master will decrease coverage by 0.17%.
The diff coverage is 13.58%.

@@             Coverage Diff              @@
##             master     #956      +/-   ##
============================================
- Coverage     52.55%   52.37%   -0.18%     
  Complexity        1        1              
============================================
  Files           331      332       +1     
  Lines          8968     9008      +40     
  Branches        569      573       +4     
============================================
+ Hits           4713     4718       +5     
- Misses         4049     4084      +35     
  Partials        206      206

@JLLeitschuh
Copy link
Member

Status on this?

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2020

Codecov Report

Merging #956 into master will decrease coverage by 0.18%.
The diff coverage is 13.58%.

@@             Coverage Diff              @@
##             master     #956      +/-   ##
============================================
- Coverage     52.52%   52.33%   -0.19%     
  Complexity        1        1              
============================================
  Files           331      332       +1     
  Lines          8968     9008      +40     
  Branches        569      573       +4     
============================================
+ Hits           4710     4714       +4     
- Misses         4053     4088      +35     
- Partials        205      206       +1     

this.readTimeout = TimeUnit.MILLISECONDS.convert(readTimeout, unit) / 1000.0;
}

public static void tryLoad() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this called?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. It was in the existing code that this was renamed from.

Comment on lines +64 to +74
if (javaCvSink != null) {
javaCvSink.close();
}

if (httpCamera != null) {
httpCamera.close();
}

if (decoded != null) {
decoded.close();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to try to recover and close the other stuff if earlier things fail to close?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just copying what was already existing.

throw new IOException("Frame not read: " + frameTime);
}
} catch (IOException e) {
throw new Exception(e.getMessage(), e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why throw the raw 'Exception' type here? Seems like less information here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just copying what the original did. Whoever wrote it originally must have had a reason.

@ThadHouse
Copy link
Contributor Author

@JLLeitschuh Everything you mentioned has been in the repo for 4 years at least. It originally came from the IP frame grabber.

https://github.com/WPIRoboticsProjects/GRIP/blob/master/core/src/main/java/edu/wpi/grip/core/sources/IPCameraFrameGrabber.java

@JLLeitschuh
Copy link
Member

@ThadHouse is this finished and ready to be merged?

@ThadHouse
Copy link
Contributor Author

Yes

Copy link
Member

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JLLeitschuh JLLeitschuh merged commit 3e2210a into WPIRoboticsProjects:master Jul 14, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants