예제 #1
0
        private void bgWorkerSave_DoWork(object sender, DoWorkEventArgs e)
        {
            // This is executed in Worker Thread space. (Do not call any UI methods)

            string metadata = "";

            if (m_SaveMetadata != null)
            {
                // Get the metadata as XML string.
                // If frame duplication is going to occur (when saving in slow motion at less than 8fps)
                // We have to store this in the xml output to be able to match frames with timestamps later.
                int iDuplicateFactor = (int)Math.Ceiling(m_fSaveFramesInterval / 125.0);
                metadata = m_SaveMetadata.ToXmlString(iDuplicateFactor);
            }

            try
            {
                m_SaveResult = m_VideoFile.Save(m_SaveFile,
                                                m_fSaveFramesInterval,
                                                m_iSaveStart,
                                                m_iSaveEnd,
                                                metadata,
                                                m_bSaveFlushDrawings,
                                                m_bSaveKeyframesOnly,
                                                m_bSavePausedVideo,
                                                m_SaveDelegateOutputBitmap);
                if (m_SaveMetadata != null)
                {
                    m_SaveMetadata.CleanupHash();
                }
            }
            catch (Exception exp)
            {
                m_SaveResult = SaveResult.UnknownError;
                log.Error("Unknown error while saving video.");
                log.Error(exp.StackTrace);
            }

            e.Result = 0;
        }
예제 #2
0
        private void bgWorkerSave_DoWork(object sender, DoWorkEventArgs e)
        {
            // This is executed in Worker Thread space. (Do not call any UI methods)

            string metadata = "";

            if (m_SaveMetadata != null)
            {
                metadata = m_SaveMetadata.ToXmlString();
            }

            try
            {
                m_SaveResult = m_VideoFile.Save(m_SaveFile,
                                                m_iSaveFramesInterval,
                                                m_iSaveStart,
                                                m_iSaveEnd,
                                                metadata,
                                                m_bSaveFlushDrawings,
                                                m_bSaveKeyframesOnly,
                                                m_bSavePausedVideo,
                                                m_SaveDelegateOutputBitmap);
                if (m_SaveMetadata != null)
                {
                    m_SaveMetadata.CleanupHash();
                }
            }
            catch (Exception exp)
            {
                m_SaveResult = SaveResult.UnknownError;
                log.Error("Unknown error while saving video.");
                log.Error(exp.StackTrace);
            }

            e.Result = 0;
        }