Example #1
0
        private bool CheckStreamingCaptureModeConfiguration()
        {
            if (this.StreamingCaptureMode == StreamingCaptureMode.Video ||
                this.StreamingCaptureMode == StreamingCaptureMode.AudioAndVideo)
            {
                Debug.Assert(!string.IsNullOrEmpty(this.VideoDeviceId));

                if (string.IsNullOrEmpty(this.VideoDeviceId))
                {
                    // Fallbacks
                    if (this.StreamingCaptureMode == StreamingCaptureMode.Video)
                    {
                        return(true);
                    }
                    this.StreamingCaptureMode = StreamingCaptureMode.Audio;
                }
            }

            if (this.StreamingCaptureMode == StreamingCaptureMode.Audio ||
                this.StreamingCaptureMode == StreamingCaptureMode.AudioAndVideo)
            {
                Debug.Assert(!string.IsNullOrEmpty(this.AudioDeviceId));

                if (string.IsNullOrEmpty(this.AudioDeviceId))
                {
                    // Fallbacks
                    if (this.StreamingCaptureMode == StreamingCaptureMode.Audio)
                    {
                        return(true);
                    }
                    this.StreamingCaptureMode = StreamingCaptureMode.Video;
                }
            }
            return(false);
        }
Example #2
0
        private void TraceDeviceDetails()
        {
            int i = 0;

            try
            {
                foreach (var device in _videoCaptureDevices)
                {
                    Debug.WriteLine("* Device [{0}]", i++);

                    if (device.EnclosureLocation == null)
                    {
                        Debug.WriteLine("EnclosureLocation: null");
                    }
                    else
                    {
                        Debug.WriteLine("EnclosureLocation.InDock: " + device.EnclosureLocation.InDock);
                        Debug.WriteLine("EnclosureLocation.InLid: " + device.EnclosureLocation.InLid);
                        Debug.WriteLine("EnclosureLocation.Panel: " + device.EnclosureLocation.Panel);
                    }

                    Debug.WriteLine("Id: " + device.Id);
                    Debug.WriteLine("IsDefault: " + device.IsDefault);
                    Debug.WriteLine("IsEnabled: " + device.IsEnabled);
                    Debug.WriteLine("Name: " + device.Name);
                    Debug.WriteLine("Properties:");

                    foreach (var property in device.Properties)
                    {
                        Debug.WriteLine("\t{0}({1}): {2}", property.Key, property.Value.GetType(), property.Value);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);

                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }
            }
        }