Example #1
0
 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");
 }
Example #2
0
        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);
        }
Example #3
0
        public static void setSliceTypeFlag(this EncodedBuffer destBuffer, uint slice_type)
        {
            eBufferFlags flags = sliceTypeFlags[slice_type];

            destBuffer.setFlags(flags);
        }