public static void writePps(this EncodedBuffer buffer, byte[] source) { if (MiscUtils.getNaluType(source[0]) != eNaluType.PPS) { throw new ApplicationException("The PPS is invalid, wrong NALU type"); } buffer.writeParameters(source, "PPS"); }
static void writeParameters(this EncodedBuffer buffer, byte[] source, string what) { var span = buffer.span; int pos = EmulationPrevention.writeStartCode4(span, 0); // pos = EmulationPrevention.writeBytes( span, source.AsSpan(), pos ); source.AsSpan().CopyTo(span.Slice(pos)); pos += source.Length; buffer.setLength(pos); Logger.logVerbose("Wrote {0} into buffer #{1}; took {2} bytes including start code", what, buffer.index, pos); }
public static void setSliceTypeFlag(this EncodedBuffer destBuffer, uint slice_type) { eBufferFlags flags = sliceTypeFlags[slice_type]; destBuffer.setFlags(flags); }