-
Notifications
You must be signed in to change notification settings - Fork 12
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
#442 - Add KlvParser.parseStream(InputStream) #444
Conversation
8a2c5ef
to
46b28de
Compare
Not sure how to update the documentation. |
The method javadoc is probably enough for this. If you had a really big change, it'd be worth putting in the top level README.md or the relevant package documentation. |
Looks good on first check. Will take a more detailed look later, and would also appreciate input from @wlfgang I think this can go into 1.x (aka |
It would be useful in 1.x, but we can hash out any issues with 2.x first and then I can have a nice tidy PR for 1.x also. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions, and a couple of requests for changes. Overall it looks pretty good, and I think this kind of streaming API could be worth making use of more broadly.
455424e
to
c859a75
Compare
@bradh - updated PR |
c859a75
to
065b256
Compare
api: additional tests for streaming parser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@wlfgang Do those additional tests resolve your remaining concern(s)?
@ruckc You described this a WIP. Is anything else required? |
@bradh - thanks for the additional tests. I had no clue how to go about forcing a KlvParseException without trying to depend on something like st0601 for tests. |
@bradh - I don't think so. My main reason for WIP labeling was due to the unique nature of the API with the two |
np. I've spent a lot of time on the tests, and it still took a while to work it through. Depending on other modules (which I also considered in the past) is pretty messy with JDK 17+ because the Jigsaw implementation doesn't seem to recognise the difference between "test only" and "real" dependencies when opening modules, so it requires polluting the |
I've avoided even touching Jigsaw modules due to their inflexibility. Not entirely sure what problem they solve, but none of the problems Jigsaw solve are mine. |
Codecov ReportBase: 91.80% // Head: 90.30% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## 2.x #444 +/- ##
============================================
- Coverage 91.80% 90.30% -1.50%
+ Complexity 5696 5658 -38
============================================
Files 615 615
Lines 14794 14855 +61
Branches 1406 1415 +9
============================================
- Hits 13581 13415 -166
- Misses 1144 1400 +256
+ Partials 69 40 -29
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I am good with this if you both are. Thanks! |
@ruckc Thanks for the work on this - appreciated. Do you want to propose the backport to |
@bradh - yes... tomorrow. the tests have changed significantly from 1.x to 2.x. |
For 1.x, you can probably leverage something in ST 0601. Different but hopefully a bit simpler. |
@ruckc: do you still have capacity for the backport, or would you like me to take a look at that? |
At this point I don't. We ended up going a different direction for KLV parsing using our own implementation. Trying to turn the jmisb output into json required more work than a simpler implementation. |
OK. Would be interested in discussion of a shared JSON format at some stage. Have created a discussion topic at #456 |
Motivation and Context
#442 - reference issue. This is just a WIP attempt to provide InputStream parsing in KlvParser.
Description
Added the below method to KlvParser.
Given that
parseBytes()
throws a KlvParseException on bad data, and when dealing with a stream, you may want the ability to continue processing, this required the ability to emit IMisbMessage and/or KlvParseExceptions without breaking the stream.How Has This Been Tested?
I tested with a mock application I'm developing where ffmpeg is running externally and its outputting the KLV data stream to stdout, which is being processed by KlvParser.
Types of changes
Checklist: