Exemplo n.º 1
0
 // DLL_PUBLIC HRESULT ADVOpenFile(char* fileName, AdvLib::AdvFileInfo* fileInfo);
 public static extern int ADVOpenFile(string fileName, [In, Out] ref AdvFileInfo fileInfo);
Exemplo n.º 2
0
        private AstroDigitalVideoStream(string fileName, ref AdvFileMetadataInfo fileMetadataInfo, ref GeoLocationInfo geoLocation)
        {
            CheckAdvFileFormat(fileName, ref fileMetadataInfo, ref geoLocation);

            m_FileName = fileName;
            var fileInfo = new AdvFileInfo();

            TangraCore.ADVOpenFile(fileName, ref fileInfo);

            m_FirstFrame = 0;
            m_CountFrames = fileInfo.CountFrames;

            m_BitPix = fileInfo.Bpp;
            m_Width = fileInfo.Width;
            m_Height = fileInfo.Height;
            m_Aav16NormVal = fileInfo.Aav16NormVal;

            m_FrameRate = fileInfo.FrameRate;

            // Get the last frame in the video and read the Almanac Offset and Almanac Status so they are applied
            // to the frames that didn't have Almanac Status = Updated
            if (m_CountFrames > 0)
            {
                GetPixelmap(m_FirstFrame + m_CountFrames - 1);

                m_AlamanacOffsetLastFrameIsGood = m_CurrentFrameInfo.AlmanacStatusIsGood;
                m_AlmanacOffsetLastFrame = m_CurrentFrameInfo.GetSignedAlamancOffset();
            }
            else
            {
                m_AlamanacOffsetLastFrameIsGood = false;
                m_AlmanacOffsetLastFrame = 0;
            }

            m_Engine = fileMetadataInfo.Engine;
            m_CameraModel = fileMetadataInfo.Camera;
            m_UsesNtpTimestamps = fileMetadataInfo.HasNTPTimeStamps;

            if (m_Engine == "AAV")
            {
                m_VideoStandard = GetFileTag("NATIVE-VIDEO-STANDARD");
                double.TryParse(GetFileTag("NATIVE-FRAME-RATE"), out m_NativeFrameRate);

                int.TryParse(GetFileTag("OSD-FIRST-LINE"), out m_OsdFirstLine);
                int.TryParse(GetFileTag("OSD-LAST-LINE"), out m_OsdLastLine);

                if (m_OsdLastLine > m_Height) m_OsdLastLine = m_Height;
                if (m_OsdFirstLine < 0) m_OsdFirstLine = 0;

                m_IntegratedAAVFrames = -1;

                if (double.TryParse(GetFileTag("EFFECTIVE-FRAME-RATE"), out m_EffectiveFrameRate) && m_NativeFrameRate != 0)
                {
                    m_IntegratedAAVFrames = (int)Math.Round(m_NativeFrameRate / m_EffectiveFrameRate);
                }

                int.TryParse(GetFileTag("FRAME-STACKING-RATE"), out m_StackingRate);
                if (m_StackingRate == 1) m_StackingRate = 0; // Video stacked at x1 is a non-stacked video
            }
            else
            {
                m_OsdFirstLine = 0;
                m_OsdLastLine = 0;
            }

            m_OcrDataAvailable = null;
        }