public VideoDecoder(MemoryStream inputStream, VideoFormat format, int sampleLength)
 {
     this.format = format;
     this.sampleLength = sampleLength;
     this.inputStream = inputStream;
     this.inputStream.Seek(0, SeekOrigin.Begin);
 }
        protected override void OnFormatChange(VideoFormat videoFormat)
        {
            if (videoFormat.PixelFormat != PixelFormatType.Format32bppArgb) throw new Exception();

            VideoFormat = videoFormat;

            if (OnFormatInit != null)
                OnFormatInit(VideoFormat);
        }
      /// <summary>
      /// Invoked when a video device reports a  video format change.
      /// </summary>
      /// <param name="videoFormat">The new video format.</param>
      protected override void OnFormatChange(VideoFormat videoFormat)
      {
         if (videoFormat.PixelFormat != PixelFormatType.Format32bppArgb)
         {
            throw new InvalidOperationException(String.Format("Only 32 Bit ARGB pixel format is supported, not {0}.", videoFormat.PixelFormat));
         }

         detector.ChangeFormat(videoFormat.PixelWidth, videoFormat.PixelHeight);
         vidFormat = videoFormat;
      }
Beispiel #4
0
		protected abstract void OnFormatChange (VideoFormat videoFormat);
 protected override void OnFormatChange(VideoFormat videoFormat)
 {
     this.aviFileWriter.StartFile((uint)videoFormat.Width, (uint)videoFormat.Height,
     (uint)videoFormat.FramesPerSecond);
 }
Beispiel #6
0
 protected abstract void OnFormatChange(VideoFormat videoFormat);
 protected override void OnFormatChange(VideoFormat format)
 {
     this.Format = format;
     Debug.WriteLine(this.Format.FramesPerSecond.ToString());
 }
Beispiel #8
0
 protected override void OnFormatChange(VideoFormat videoFormat)
 {
     if (CapturedFormat != null)
     {   
         throw new InvalidOperationException("Ошибка!");
     }
     this.CapturedFormat = new VideoFormat(PixelFormatType.Format32bppArgb, 640, 480, videoFormat.FramesPerSecond);
     
 }