Created
September 16, 2019 13:27
-
-
Save BogdanovKirill/8fb7d7b4f6fd858ffe67d6f0b03c0082 to your computer and use it in GitHub Desktop.
Test fix for JPEG parser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void GenerateFrame(TimeSpan timeOffset) | |
{ | |
if (!ArrayUtils.EndsWith(_frameStream.GetBuffer(),0, | |
(int)_frameStream.Position, RawJpegFrame.EndMarkerBytes)) | |
_frameStream.Write(JpegEndMarkerByteSegment.Array, JpegEndMarkerByteSegment.Offset, JpegEndMarkerByteSegment.Count); | |
DateTime timestamp = GetFrameTimestamp(timeOffset); | |
var frameBytes = new ArraySegment<byte>(_frameStream.GetBuffer(), 0, (int)_frameStream.Position); | |
_frameStream.Position = 0; | |
var frame = new RawJpegFrame(timestamp, frameBytes); | |
OnFrameGenerated(frame); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment