-
Notifications
You must be signed in to change notification settings - Fork 769
Improve RGB and depth stream parsers #221
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
Conversation
Nice +1 i guess this subsumes the other packet parsing related PRS? However, timestamps are added but not passed through parsers/processors or did I miss something? Could you fix this otherwise? |
This PR works fine at my end 👍 Only cosmetic is to remove the old comment? |
I did a quick check, and it seems to be working fine on my end as well (Linux). 👍 |
Also working fine for me (Ubuntu 14.04). @christiankerl since this mostly touches your code, could you do the merge? |
Merge conflicts from #227 which changes cosmetic log strings. To fix later. |
Sorry, didn't realize that - should I revert #227? |
Inspect the magic markers at the end of a JPEG frame and match the sequence number and length. Find out the exact size of the JPEG image for decoders that can't handle garbage after JPEG EOI.
Remove magic footer scanning: may appear in the middle. Assume fixed packet size.
No. Fixed conflicts. |
I just tested this pull request and it also solves the issue of restarting the device. |
OK, sounds like we should integrate this now. I'll give it until today in the evening for any last-minute objections, then I'll merge it. |
Improve RGB and depth stream parsers
In the RGB stream parser, add an extra check using information the RGB packet footer revealed by new protocol analysis to detect JPEG EOI marker. Then use the marker's position to derive a correct JPEG length for some hardware JPEG decoders that can't handle garbage after the end of JPEG image.
In the depth stream parser, remove the scanning of a 8-byte magic footer which is very unreliable (the particular 8 bytes may appear in the middle) and inefficient. Based on analysis of the isochronous transfer protocol, assume packets have fixed size and the footer always resides at the end of a fixed sized packet. The changes made are minimized, and the execution order in the original parser is preserved, including the order of memcpy's and subsequence/sequence assembling order.
The code has been tested on Linux and Windows.