private void OnLoad(object sender, EventArgs e) { OpenFileDialog path = new OpenFileDialog(); path.Filter = "avr files(*.avr)|*.avr|All files (*.*)|*.*"; if (path.ShowDialog() == DialogResult.OK) { string inputstring = path.FileName.ToString(); //This function will need a window handle to process video frames, user should give this function a window handle. //This window can be a small and invisible one like what we do in this sample //The progress will be shown in the callback function StatusCallbackMethod //AsyncFileTrans asyncFileTrans = new AsyncFileTrans(FileTransNew); //asyncFileTrans.BeginInvoke(inputstring, outputstring, lChannel, lStartTime, lEndTime, uiInterval, NullHandle, null, null); stImgLogParam = CreateDeviceParamImgLog(ModalType.MV_IMAGE); stImgLogParam.szFileName = inputstring; int iResult = 0; iResult = SdkShellInitialSource(ref ImgLogPtr, DeviceType.DEVICE_FILE, stImgLogParam.dwModal, 0); iResult = SdkShellOpenSource(ImgLogPtr, ref stImgLogParam, ViewType.IMGLOG, 0); if (iResult < 0) { MessageBox.Show("FileOpen Fail"); } } else { MessageBox.Show("No File has been selected"); } }
public void Initialshell_Source() { int result; OPEN_DEVICE_PARAM_T stOpenParam = CreateDeviceParam(MTModalType); if (MTModalType == ModalType.MV_HDD) { stOpenParam.dwDiskID = uint_HDDNo; } else if (MTModalType == ModalType.MV_IMAGE) { MessageBox.Show("Error Device Type"); return; } else { MessageBox.Show("Error Device Type"); return; } //Initial shell and Source result = SdkShellInitialSource(ref ptr, DTDeviceType, stOpenParam.dwModal, 0); result = SdkShellOpenSource(ptr, ref stOpenParam, ViewType.NONE, 0); if (result < 0) { MessageBox.Show("Open archive log from HDD fail"); } }
public void Initialshell_Source() { int result; OPEN_DEVICE_PARAM_T stOpenParam = CreateDeviceParam(MTModalType); result = SdkShellInitialSource(ref ptr, DTDeviceType, stOpenParam.dwModal, 0); result = SdkShellOpenSource(ptr, ref stOpenParam, ViewType.NONE, 0); }
/** ********************************************************************* * @fn<CreateDeviceParam> * @brief<This function will new a OPEN_DEVICE_PARAM_T structure and set the values of it> * <After setting value,the pointer of this structure will be returned> * * @param[in] * <ModalType __mtSelectedType> * @param[out] * none * @retval * none * @return <OPEN_DEVICE_PARAM_T> ********************************************************************* */ private OPEN_DEVICE_PARAM_T CreateDeviceParam(ModalType _mtSelectedType) { OPEN_DEVICE_PARAM_T stOpenParam = new OPEN_DEVICE_PARAM_T(); if (_mtSelectedType == ModalType.MV_DVR) { stOpenParam.dwDeviceType = DeviceType.DEVICE_DVR; } else if (_mtSelectedType == ModalType.MV_HDD) { stOpenParam.dwDeviceType = DeviceType.DEVICE_HDD; } else { stOpenParam.dwDeviceType = DeviceType.DEVICE_DVR; } if (stOpenParam.dwDeviceType == DeviceType.DEVICE_DVR) { stOpenParam.dwModal = ModalType.MV_DVR; CONNECT_PARAM_T conn_param = new CONNECT_PARAM_T(); conn_param.dwModal = ModalType.MV_DVR; conn_param.device = new DEVICE(); conn_param.device.mv = new moblie_view(); conn_param.device.mv.szUrl = str_IP; conn_param.device.mv.usWebPort = (ushort)Math.Min(ushort.MaxValue, int_port); conn_param.device.mv.szUID = str_username; conn_param.device.mv.szPWD = str_password; stOpenParam.mDvrParam = conn_param; } else if (stOpenParam.dwDeviceType == DeviceType.DEVICE_HDD) { stOpenParam.dwModal = ModalType.MV_HDD; CONNECT_PARAM_T conn_param = new CONNECT_PARAM_T(); conn_param.dwModal = ModalType.MV_HDD; conn_param.device = new DEVICE(); conn_param.device.mv = new moblie_view(); stOpenParam.mDvrParam = conn_param; } else { MessageBox.Show("Device type error!!!"); } return(stOpenParam); }
/** ********************************************************************* * @fn<ArchiveStartbtn_Click> * @brief<This function will use _stOpenParam as an input parameter.> * <This structure contains device information that SdkShell will needed> * @param[in] * none * @param[out] * none * @retval * none * @return <void> ********************************************************************* */ public void GetFormValue(OPEN_DEVICE_PARAM_T _stOpenParam) { stArchiveParam = _stOpenParam; //ArchiveDT=stArchiveParam.dwDeviceType; if (stArchiveParam.dwDeviceType == DeviceType.DEVICE_DVR) { Sele_DeviceType.Text = "DVR"; } else if (stArchiveParam.dwDeviceType == DeviceType.DEVICE_HDD) { Sele_DeviceType.Text = "HDD"; ResumeArchive_btn.Enabled = false; } Initialshell_Source(); }
public void Initialshell_Source() { int result; OPEN_DEVICE_PARAM_T stOpenParam = CreateDeviceParam(MTModalType); if (MTModalType == ModalType.MV_HDD) { stOpenParam.dwDiskID = uint_HDDNo; } else if (MTModalType == ModalType.MV_IMAGE) { if (stOpenParam.szFileName == null) { return; } } //Initial shell and Source result = SdkShellInitialSource(ref ptr, DTDeviceType, stOpenParam.dwModal, 0); result = SdkShellOpenSource(ptr, ref stOpenParam, ViewType.SEARCH, 0); }
/** ********************************************************************* * @fn<CreateDeviceParam> * @brief<This function will new a OPEN_DEVICE_PARAM_T structure and set the values of it> * <After setting value,the pointer of this structure will be returned> * * @param[in] * <ModalType __mtSelectedType> * @param[out] * none * @retval * none * @return <OPEN_DEVICE_PARAM_T> ********************************************************************* */ private OPEN_DEVICE_PARAM_T CreateDeviceParam(ModalType _mtSelectedType) { OPEN_DEVICE_PARAM_T stOpenParam = new OPEN_DEVICE_PARAM_T(); if (_mtSelectedType == ModalType.MV_DVR) { stOpenParam.dwDeviceType = DeviceType.DEVICE_DVR; } else if (_mtSelectedType == ModalType.MV_HDD) { stOpenParam.dwDeviceType = DeviceType.DEVICE_HDD; } else if (_mtSelectedType == ModalType.MV_IMAGE) { stOpenParam.dwDeviceType = DeviceType.DEVICE_FILE; } else { stOpenParam.dwDeviceType = DeviceType.DEVICE_DVR; } if (stOpenParam.dwDeviceType == DeviceType.DEVICE_DVR) { stOpenParam.dwModal = ModalType.MV_DVR; CONNECT_PARAM_T conn_param = new CONNECT_PARAM_T(); conn_param.dwModal = ModalType.MV_DVR; conn_param.device = new DEVICE(); conn_param.device.mv = new moblie_view(); conn_param.device.mv.szUrl = str_IP; conn_param.device.mv.usWebPort = (ushort)Math.Min(ushort.MaxValue, int_port); conn_param.device.mv.szUID = str_username; conn_param.device.mv.szPWD = str_password; stOpenParam.mDvrParam = conn_param; } else if (stOpenParam.dwDeviceType == DeviceType.DEVICE_HDD) { stOpenParam.dwModal = ModalType.MV_HDD; CONNECT_PARAM_T conn_param = new CONNECT_PARAM_T(); conn_param.dwModal = ModalType.MV_HDD; conn_param.device = new DEVICE(); conn_param.device.mv = new moblie_view(); stOpenParam.mDvrParam = conn_param; } else if (stOpenParam.dwDeviceType == DeviceType.DEVICE_FILE) { OpenFileDialog path = new OpenFileDialog(); path.Filter = "avr files(*.avr)|*.avr|All files (*.*)|*.*"; if (path.ShowDialog() == DialogResult.OK) { stOpenParam.szFileName = path.FileName.ToString(); } stOpenParam.dwModal = ModalType.MV_IMAGE; CONNECT_PARAM_T conn_param = new CONNECT_PARAM_T(); conn_param.device = new DEVICE(); conn_param.device.mv = new moblie_view(); stOpenParam.mDvrParam = conn_param; } else { MessageBox.Show("Device type error!!!"); } return(stOpenParam); }
private static extern int SdkShellOpenSource(IntPtr hDevice, ref OPEN_DEVICE_PARAM_T stOpenParam, ViewType dwViewMode, int lParameter1);