Exemple #1
0
        /// <summary>
        /// 得到所有Camera
        /// </summary>
        private void GetCameras()
        {
            OeipDevices.Clear();
            int count = OeipHelper.getDeviceCount();

            if (count <= 0)
            {
                return;
            }
            int deviceLenght = Marshal.SizeOf(typeof(OeipDeviceInfo));
            var devices      = PInvokeHelper.GetPInvokeArray <OeipDeviceInfo>(count,
                                                                              (IntPtr ptr, int pcount) =>
            {
                OeipHelper.getDeviceList(ptr, pcount);
            });

            OeipDevices = devices.ToList();
        }
Exemple #2
0
        public List <VideoFormat> GetCameraFormats(int cameraId)
        {
            if (cameraId < 0 && cameraId >= OeipDevices.Count)
            {
                return(null);
            }
            int count = OeipHelper.getFormatCount(cameraId);

            if (count > 0)
            {
                var videoFormats = PInvokeHelper.GetPInvokeArray <VideoFormat>(count,
                                                                               (IntPtr ptr, int pcount) =>
                {
                    OeipHelper.getFormatList(cameraId, ptr, pcount);
                });
                return(videoFormats.ToList());
            }
            return(new List <VideoFormat>());
        }