Ejemplo n.º 1
0
        /// <summary>
        /// 下载指定任务单元的视频
        /// </summary>
        /// <param name="downloadInfo">下载信息</param>
        /// <param name="userData"></param>
        /// <returns>下载句柄</returns>
        public Int32 DownloadVideoByTaskUnit(DownloadInfo downloadInfo, UInt32 userData)
        {
            TVDASDK_TASK_UNIT_DOWNLOAD_INFO info = new TVDASDK_TASK_UNIT_DOWNLOAD_INFO();

            info.bIsDownloadAllFile  = downloadInfo.IsDownloadAllFile;
            info.dwEndTime           = ModelParser.ConvertLinuxTime(downloadInfo.EndTime);
            info.dwStartTime         = ModelParser.ConvertLinuxTime(downloadInfo.StartTime);
            info.dwVideoTaskUnitID   = downloadInfo.VideoTaskUnitID;
            info.szLocalSaveFilePath = downloadInfo.LocalSaveFilePath;

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, string.Format("IVXSDKProtocol VdaSdk_DownloadVideoByTaskUnit dwVideoTaskUnitID:{0}"
                                                                                                       + ",szLocalSaveFilePath:{1}"
                                                                                                       + ",bIsDownloadAllFile:{2}"
                                                                                                       + ",dwStartTime:{3}"
                                                                                                       + ",dwEndTime:{4}"
                                                                                                       , info.dwVideoTaskUnitID
                                                                                                       , info.szLocalSaveFilePath
                                                                                                       , info.bIsDownloadAllFile
                                                                                                       , info.dwStartTime
                                                                                                       , info.dwEndTime
                                                                                                       ));

            m_TfuncDownLoadVideoPosCB    = TfuncDownLoadVideoPosCB;
            m_TfuncDownLoadVideoStatusCB = TfuncDownLoadVideoStatusCB;

            int retVal = IVXSDKProtocol.VdaSdk_DownloadVideoByTaskUnit(ref info, m_TfuncDownLoadVideoPosCB, m_TfuncDownLoadVideoStatusCB, userData);

            if (-1 == retVal)
            {
                // 调用失败,抛异常
                CheckError();
            }

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXSDKProtocol VdaSdk_DownloadVideoByTaskUnit ret:" + retVal);

            return(retVal);
        }
Ejemplo n.º 2
0
 public static extern Int32 VdaSdk_DownloadVideoByTaskUnit(ref TVDASDK_TASK_UNIT_DOWNLOAD_INFO ptDownloadInfo,
                                                           TfuncDownLoadVideoPosCB pfuncDownLoadPos, TfuncDownLoadVideoStatusCB pfuncDownLoadStatus, UInt32 dwUserData);