예제 #1
0
        public void AfterSave()
        {
            if (savingMetada)
            {
                Metadata.CleanupHash();
                savingMetada = false;
            }

            NotificationCenter.RaiseRefreshFileExplorer(this, false);
        }
예제 #2
0
        public void SetupMetadata()
        {
            // Setup Metadata global infos in case we want to flush it to a file (or mux).

            if (m_Metadata != null)
            {
                Size imageSize = new Size(m_VideoFile.Infos.iDecodingWidth, m_VideoFile.Infos.iDecodingHeight);

                m_Metadata.ImageSize = imageSize;
                m_Metadata.AverageTimeStampsPerFrame          = m_VideoFile.Infos.iAverageTimeStampsPerFrame;
                m_Metadata.CalibrationHelper.FramesPerSeconds = m_VideoFile.Infos.fFps;
                m_Metadata.FirstTimeStamp = m_VideoFile.Infos.iFirstTimeStamp;
                m_Metadata.Plane.SetLocations(imageSize, 1.0, new Point(0, 0));
                m_Metadata.Grid.SetLocations(imageSize, 1.0, new Point(0, 0));

                log.Debug("Setup metadata.");
                m_Metadata.CleanupHash();
            }
        }
예제 #3
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;
        }
예제 #4
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;
        }