Пример #1
0
        public void Dispose_Twice()
        {
            using var stream = File.OpenRead("video.h264");

            var decoder = new H264Decoder(stream);

            decoder.Dispose();
            decoder.Dispose();
        }
Пример #2
0
        public void Disposed_ThrowsException()
        {
            var decoder = new H264Decoder(Stream.Null);

            decoder.Dispose();

            Assert.Throws <ObjectDisposedException>(() => decoder.Start());
            Assert.Throws <ObjectDisposedException>(() => decoder.FrameBuffer.CopyFramebuffer(Array.Empty <byte>()));
            Assert.Throws <ObjectDisposedException>(() => decoder.Decode());
        }