Ejemplo n.º 1
0
        internal static long GetFileSize(string mlvFileName, string content)
        {
            switch (GetFileType(content))
            {
            case eFileType.Txt:
                return(GetInfoFields(mlvFileName).Aggregate <string>(addString).Length);

            case eFileType.Wav:
                if (!HasAudio(mlvFileName))
                {
                    return(0);
                }
                return(GetWaveDataStream(mlvFileName).Length);
            }

            MLVCachedReader cache = GetReader(mlvFileName);
            int             frame = GetFrameNumber(mlvFileName, content);

            object[] metadata = cache.reader.GetVideoFrameMetadata((uint)frame);

            switch (GetFileType(content))
            {
            case eFileType.Dng:
                return(DNGCreator.GetSize(mlvFileName, cache.handler.VidfHeader, cache.handler.RawPixelData, metadata));

            case eFileType.Fits:
                return(20000000);   //GetDataStream(mlvFileName, content, 0).Length;

            case eFileType.Jpg:
                return(100000);

            case eFileType.MJpeg:
                return(1000000);
            }

            return(0);
        }