Detecting cameras on citrix

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Detecting cameras on citrix

Post by BillG »

We have the vintasoft portion of our application working perfectly on desktop machines. The issue we are having is when the software is run on a citrix server, it sees the camera on the server, but it is unable to start the camera. Is there anything we have to do differently to start a camera on a citrix server than on a desktop. We do have a valid license for the server. at the top of the viewer it properly displays the name of the camera on the citrix server it just does not start the servers camera.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detecting cameras on citrix

Post by Alex »

Hi Bill,

Do you have any error or exception when you trying to start the camera? Please send us more info about your problem.

Best regards, Alexander
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Re: Detecting cameras on citrix

Post by BillG »

when i click the start button i get the following exception. I should add the code works on a standalone machine. the only problem is when it is run on a citrix server. I can see the name of the camera above the viewer control so it seems to be able to detect the camera. And Yes we are checking for the appropriate licenses in our code.

cannot start camera or fetch image
System.ArgumentException: Value does not fall within the specified range.

here is the code where the problem is

Code: Select all

        private void SlaveWebcamViewer_Click(object sender, EventArgs e)     // this is the code attached to the start button
        {
            WebcamViewer viewer = (WebcamViewer)sender;
            if (viewer.CaptureDevice != null)
            {
                MasterWebcamViewer.CaptureDevice = viewer.CaptureDevice;
                try
                {
                    MasterWebcamViewer.Start();              //this is the line prodcuing the exception
                }
                catch (Exception ex)
                {
                    ShowErrorMessage(ex);
                }
            }
        }
Here is my constructor to initialize the viewer.

Code: Select all

        public WebcamViewerForm()
        {
            InitializeComponent();
            _slaveViewers = new WebcamViewer[]
            {
                ImageViewer1,
                ImageViewer2

            };
            _viewers = new WebcamViewer[]
            {
                MasterWebcamViewer,
                ImageViewer1,
                ImageViewer2

            };

            MasterWebcamViewer.CaptureTimeout = 5; // ms
            MasterWebcamViewer.SizeMode = ImageSizeMode.BestFit;
            foreach (WebcamViewer viewer in _slaveViewers)
            {
                viewer.SizeMode = ImageSizeMode.BestFit;
                viewer.CaptureTimeout = 1000/25; // ms
            }

           

            _captureDevicesMonitor = new ImageCaptureDevicesMonitor();
            _captureDevicesMonitor.Timeout = 500;
            _captureDevicesMonitor.CaptureDevicesChanged += new EventHandler<ImageCaptureDevicesChangedEventArgs>(CaptureDevicesMonitor_CaptureDevicesChanged);
            _captureDevicesMonitor.Start();

        }

     private void WebcamViewerForm_Shown(object sender, EventArgs e)
        {
            ReadOnlyCollection<ImageCaptureDevice> devices = ImageCaptureDeviceConfiguration.GetCaptureDevices();
            int viewerIndex = 0;
            foreach (ImageCaptureDevice device in devices)
            {
                switch (viewerIndex)
                {
                    case 0:

                        MasterWebcamViewer.CaptureDevice = device;
                        _slaveViewers[0].CaptureDevice = device;
                        break;

                    case 1:
 
                        _slaveViewers[1].CaptureDevice = device;
                        break;

                }
                viewerIndex++;

            }
            if (MasterWebcamViewer.CaptureDevice != null)
            {
                Camera1Name.Text = MasterWebcamViewer.CaptureDevice.FriendlyName;
            }
            else
            {
                Camera1Name.Text = "No Camera Found";
            }

            if (_slaveViewers[1].CaptureDevice != null)
            {
                Camera2Name.Text = _slaveViewers[1].CaptureDevice.FriendlyName;
            }
            else
            {
                Camera2Name.Text = "No Camera Found";
            }
            
            StartAll();
        }


The form is similar to your one example. there are two slave viewers at the top of the form and a master viewer in the bottom half.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detecting cameras on citrix

Post by Alex »

Hello Bill,

Please provide information about stack trace of exception.

Best regards, Alexander
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Re: Detecting cameras on citrix

Post by BillG »

Cannot start camera or fetch image
System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.InteropServices.Marshall.ThrowExceptionForHRInteral(Int32 errorCode, intPtr errorinfo)
at System.Runtime.InteropServices.Marshall.ThrowExceptionForHR(Int32 errorCode)
at 5.t.I()
at 5.t.Start()
at Vintasoft.Imaging.Media.ImageCaptureDevice.1(ImageCaptureSource)
at Vintasoft.Imaging.Media.ImageCaptureSource.Start()
at UnionAdministrator.Helpers.WebcamViewer.Start()
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Detecting cameras on citrix

Post by Alex »

Hello Bill,

Thank you for information.

Your exception means that one or more DirectShow filters failed to run.

Please do the following tests:
  • Run our Imaging Demo on your Citrix server and try to capture images from webcam
  • Try to use webcam using different softwares
  • Try to run your application with administraive privileges
and let me know results.

Best regards, Alexander
Post Reply