Example #1
0
		protected AviInterop.StreamInfo GetStreamInfo()
		{
			var streamInfo = new AviInterop.StreamInfo();
			uint result = AviInterop.AVIStreamInfo(StreamPointer, ref streamInfo,
				Marshal.SizeOf(streamInfo));
			if (result != 0)
				throw new Exception("Exception in VideoStreamInfo: " + AviErrors.GetError(result));

			return streamInfo;
		}
Example #2
0
        protected AviInterop.StreamInfo GetStreamInfo()
        {
            var  streamInfo = new AviInterop.StreamInfo();
            uint result     = AviInterop.AVIStreamInfo(StreamPointer, ref streamInfo,
                                                       Marshal.SizeOf(streamInfo));

            if (result != 0)
            {
                throw new Exception("Exception in VideoStreamInfo: " + AviErrors.GetError(result));
            }

            return(streamInfo);
        }
Example #3
0
        public VideoStream(int filePtr, IntPtr streamPtr)
            : base(filePtr, streamPtr)
        {
            var bih  = new AviInterop.BitmapInfoHeader();
            int size = Marshal.SizeOf(bih);

            AviInterop.AVIStreamReadFormat(StreamPointer, 0, ref bih, ref size);
            AviInterop.StreamInfo streamInfo = GetStreamInfo();

            FrameRate         = streamInfo.dwRate / (float)streamInfo.dwScale;
            Width             = streamInfo.rcFrame.right;
            Height            = streamInfo.rcFrame.bottom;
            FrameSize         = bih.biSizeImage;
            CountBitsPerPixel = CalculateBitsPerPixel(bih.biBitCount);
            FirstFrame        = AviInterop.AVIStreamStart(StreamPointer);
            CountFrames       = AviInterop.AVIStreamLength(StreamPointer);
        }