Beispiel #1
0
        internal BitmapVideoPlayer(AviTools aviTools, bool useEmbeddedVideo, string bitmapFilesLocation, int playbackBufferSize)
        {
            this.aviTools           = aviTools;
            this.cameraImage        = new CameraImage();
            this.playbackBufferSize = playbackBufferSize;

            integration = 1;

            if (!imagesBuffered)
            {
                UIThreadCaller.Invoke((frm, prms) => BufferVideoInternal(frm, prms), useEmbeddedVideo, bitmapFilesLocation);

                imagesBuffered = true;
            }

            if (errorBitmap != null)
            {
                width  = errorBitmap.Width;
                height = errorBitmap.Height;
            }
            else if (allImagesPixels.Count > 0)
            {
                width  = bufferedImageWidth;
                height = bufferedImageHeight;
            }
            else
            {
                width  = 0;
                height = 0;
            }
        }
Beispiel #2
0
 private void DisplayCurrentDeviceFilterPropertyPage(IBaseFilter dev, IntPtr hwndOwner)
 {
     if (dxManagedThreadId != -1 && dxManagedThreadId != Thread.CurrentThread.ManagedThreadId)
     {
         if (dxSyncContext != null)
         {
             int  counter      = 0;
             bool callFinished = false;
             dxSyncContext.Post(new SendOrPostCallback(delegate(object state)
             {
                 DisplayPropertyPage(dev, hwndOwner);
                 callFinished = true;
             }), null);
             while (!callFinished && counter < 300 /* 3 sec timeout */)
             {
                 Thread.Sleep(10);
                 counter++;
             }
         }
         else
         {
             // Cannot safely show the property pages because the DirectShow objects have been created on a different thread
             UIThreadCaller.Invoke((frm, args) => MessageBox.Show(frm, "Cannot display the properties of a DirectShow device filter created on a different thread.", "Tangra Video Capture", MessageBoxButtons.OK, MessageBoxIcon.Error));
         }
     }
     else
     {
         DisplayPropertyPage(dev, hwndOwner);
     }
 }
Beispiel #3
0
 /// <exception cref="T:ASCOM.DriverException">Must throw an exception if the call was not successful</exception>
 public void SetupDialog()
 {
     UIThreadCaller.Invoke((frm, args) =>
     {
         SetupDialogInternal(frm);
         TraceSwitches.DebugTracing.Level = Properties.Settings.Default.TraceLevel;
     });
 }
Beispiel #4
0
        public virtual void ConfigureDeviceProperties()
        {
            AssertConnected();

            UIThreadCaller.Invoke((frm, args) => camera.ShowDeviceProperties());
        }
Beispiel #5
0
        ///	<exception cref="T:ASCOM.NotConnectedException">Must throw an exception if the camera is not connected.</exception>
        ///	<exception cref="T:ASCOM.PropertyNotImplementedException">Must throw an exception if ConfigureImage is not supported.</exception>
        public void ConfigureDeviceProperties()
        {
            AssertConnected();

            UIThreadCaller.Invoke((frm, args) => ConfigureDevideProperiesInternal(frm));
        }
Beispiel #6
0
 /// <exception cref="T:ASCOM.DriverException">Must throw an exception if the call was not successful</exception>
 public void SetupDialog()
 {
     UIThreadCaller.Invoke((frm, args) => SetupDialogInternal(frm));
 }