Esempio n. 1
0
        public bool StopEncodingFile()
        {
            log.Context = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name;

            // verify that the Encoder is recording
            if (!m_bIsEncoderArchiving)
            {
                log.WriteLog("Archiver stop requested while Encoder is not archiving...");
                return false;
            }
            try
            {
                m_encoder.Archive(WMEncoderLib.WMENC_ARCHIVE_TYPE.WMENC_ARCHIVE_LOCAL, WMEncoderLib.WMENC_ARCHIVE_OPERATION.WMENC_ARCHIVE_STOP);
                // wait for archiving to stop
                System.Threading.Thread.Sleep(200);
                log.WriteLog("Archiver stopped...");
                m_bIsEncoderArchiving = false;
                // send acknowledgement
                log.WriteLog("Disposed of recording timeout timer.");
                ScheduledFTPFile uploadFile =
                    new ScheduledFTPFile();
                uploadFile.FileUpload.AddFileUploadRow(WMVFilename,
                    UploadServer, UploadPort,
                    "", "", DateTime.MinValue,
                    UploadUser,
                    UploadPassword,
                    true);
                string wmvFileTitle = System.IO.Path.GetFileNameWithoutExtension(WMVFilename);
                string wmvFilePath = System.IO.Path.GetDirectoryName(WMVFilename);
                uploadFile.WriteXml(
                    wmvFilePath + "\\" + wmvFileTitle + ".xml");
                log.WriteLog(wmvFilePath + "\\" + wmvFileTitle + ".xml written");
                return true;
            }
            catch(Exception Err)
            {
                log.WriteLog("Archiver error detected during stop attempt: " + Err.Message);
                return false;
            }
        }
Esempio n. 2
0
 public bool StopEncodingFile()
 {
     // verify that the Encoder is recording
     if (!m_bIsEncoderArchiving)
     {
         Logger.LogError("Archiver stop requested while Encoder is not archiving...");
         return false;
     }
     try
     {
         m_encoder.Archive(WMENC_ARCHIVE_TYPE.WMENC_ARCHIVE_LOCAL,
             WMENC_ARCHIVE_OPERATION.WMENC_ARCHIVE_STOP);
         // wait for archiving to stop
         Thread.Sleep(200);
         Logger.LogInformation("Archiver stopped...");
         m_bIsEncoderArchiving = false;
         // send acknowledgement
         Logger.LogInformation("Disposed of recording timeout timer.");
         ScheduledFTPFile uploadFile = new ScheduledFTPFile();
         uploadFile.FileUpload.AddFileUploadRow(WMVFilename,
                                                UploadServer, UploadPort,
                                                "", "", DateTime.MinValue,
                                                UploadUser,
                                                UploadPassword,
                                                true);
         string wmvFileTitle = Path.GetFileNameWithoutExtension(WMVFilename);
         string wmvFilePath = Path.GetDirectoryName(WMVFilename);
         uploadFile.WriteXml(
             wmvFilePath + "\\" + wmvFileTitle + ".xml");
         Logger.LogInformation(wmvFilePath + "\\" + wmvFileTitle + ".xml written");
         return true;
     }
     catch (Exception Err)
     {
         Logger.LogError("Archiver error detected during stop attempt: " + Err.Message);
         return false;
     }
 }