示例#1
0
        private EncodeResult EncodeFrame(byte[] source, int srcOffset, byte[] destination, int destOffset)
        {
            bool isKeyFrame;
            var  result = encoder.EncodeFrame(source, srcOffset, destination, destOffset, out isKeyFrame);

            return(new EncodeResult
            {
                EncodedLength = result,
                IsKeyFrame = isKeyFrame
            });
        }
示例#2
0
 /// <summary>Encodes and writes a frame.</summary>
 public override void WriteFrame(bool isKeyFrame, byte[] frameData, int startIndex, int count)
 {
     // Prevent accessing encoded buffer by multiple threads simultaneously
     lock (syncBuffer)
     {
         count = encoder.EncodeFrame(frameData, startIndex, encodedBuffer, 0, out isKeyFrame);
         base.WriteFrame(isKeyFrame, encodedBuffer, 0, count);
     }
 }