Example #1
0
 internal static extern int StreamDecoderInitStream(
     [NotNull] StreamDecoderHandle handle,
     [NotNull] NativeCallbacks.StreamDecoderReadCallback readCallback,
     [CanBeNull] NativeCallbacks.StreamDecoderSeekCallback seekCallback,
     [CanBeNull] NativeCallbacks.StreamDecoderTellCallback tellCallback,
     [CanBeNull] NativeCallbacks.StreamDecoderLengthCallback lengthCallback,
     [CanBeNull] NativeCallbacks.StreamDecoderEofCallback eofCallback,
     [NotNull] NativeCallbacks.StreamDecoderWriteCallback writeCallback,
     [CanBeNull] NativeCallbacks.StreamDecoderMetadataCallback metadataCallback,
     [NotNull] NativeCallbacks.StreamDecoderErrorCallback errorCallback,
     IntPtr userData);
Example #2
0
        internal StreamDecoder([NotNull] Stream stream)
        {
            // Need a reference to the callbacks for the lifetime of the decoder
            _readCallback     = ReadCallback;
            _seekCallback     = SeekCallback;
            _tellCallback     = TellCallback;
            _lengthCallback   = LengthCallback;
            _eofCallback      = EofCallback;
            _writeCallback    = WriteCallback;
            _metadataCallback = MetadataCallback;
            _errorCallback    = ErrorCallback;

            _stream       = stream;
            _streamLength = stream.Length;
        }