public void Parse(DateTime frameTimestamp, ArraySegment <byte> byteSegment, bool dontSliceForce, bool generateFrame) { Debug.Assert(byteSegment.Array != null, "byteSegment.Array != null"); if (ArrayUtils.StartsWith(byteSegment.Array, byteSegment.Offset, byteSegment.Count, RawH264Frame.StartMarker)) { if (dontSliceForce) { ProcessNalUnit(frameTimestamp, byteSegment, true, generateFrame); } else { H264Slicer.Slice(byteSegment, SlicerOnNalUnitFound); } } else { ProcessNalUnit(frameTimestamp, byteSegment, false, false); } if (generateFrame && _frameBuffer.CountData != 0) { ArraySegment <byte> frameBytes = _frameBuffer.GetAccumulatedBytes(); TryGenerateFrame(frameTimestamp, frameBytes); } }
public void Parse(ArraySegment <byte> byteSegment, bool dontSliceForce, bool generateFrame) { Debug.Assert(byteSegment.Array != null, "byteSegment.Array != null"); if (ArrayUtils.StartsWith(byteSegment.Array, byteSegment.Offset, byteSegment.Count, RawH264Frame.StartMarker)) { if (dontSliceForce) { ProcessNalUnit(byteSegment, true, generateFrame); } else { H264Slicer.Slice(byteSegment, SlicerOnNalUnitFound); } } else { ProcessNalUnit(byteSegment, false, false); } if (generateFrame) { TryGenerateFrame(); } }
public void Parse(ArraySegment <byte> byteSegment, bool generateFrame) { Debug.Assert(byteSegment.Array != null, "byteSegment.Array != null"); if (ArrayUtils.StartsWith(byteSegment.Array, byteSegment.Offset, byteSegment.Count, RawH264Frame.StartMarker)) { H264Slicer.Slice(byteSegment, SlicerOnNalUnitFound); } else { ProcessNalUnit(byteSegment, false, ref generateFrame); } if (generateFrame) { TryGenerateFrame(); } else { #if DEBUG Console.WriteLine("[H264Parser] Marker bit not set."); #endif } }
public void Parse(int mediaId, ArraySegment <byte> byteSegment, bool generateFrame) { Debug.Assert(byteSegment.Array != null, "byteSegment.Array != null"); if (ArrayUtils.StartsWith(byteSegment.Array, byteSegment.Offset, byteSegment.Count, RawH264Frame.StartMarker)) { H264Slicer.Slice(mediaId, byteSegment, SlicerOnNalUnitFound); } else { ProcessNalUnit(mediaId, byteSegment, false, ref generateFrame); } if (generateFrame) { TryGenerateFrame(mediaId); } }