Exemple #1
0
        /** Retrieves the device ID of the current video recording device.
         *
         * @param deviceId The device ID of the current video recording device.
         *
         * @return
         * - 0: Success.
         * - < 0: Failure.
         */
        public override int GetCurrentVideoDevice(ref string deviceId)
        {
            if (_mEngine == null)
            {
                return((int)ERROR_CODE.ERROR_NOT_INIT_ENGINE);
            }

            if (GetVideoDeviceCount() > 0)
            {
                System.IntPtr videoDeviceId = Marshal.AllocHGlobal(512);
                int           ret           = IRtcEngineNative.getCurrentVideoDevice(videoDeviceId);
                deviceId = Marshal.PtrToStringAnsi(videoDeviceId);
                Marshal.FreeHGlobal(videoDeviceId);
                return(ret);
            }
            else
            {
                return((int)ERROR_CODE.ERROR_NO_DEVICE_PLUGIN);
            }
        }