Exemplo n.º 1
0
 private VideoStream(VideoFileInfo openedfileInfo, string fileName)
 {
     m_OpenedFileInfo = openedfileInfo;
     m_FileName = fileName;
 }
Exemplo n.º 2
0
 //HRESULT TangraVideoOpenFile(char* fileName, VideoFileInfo* fileInfo);
 private static extern int TangraVideoOpenFile(string fileName, [In, Out] VideoFileInfo fileInfo);
Exemplo n.º 3
0
        public static VideoFileInfo OpenFile(string fileName)
        {
            string fileExtension = Path.GetExtension(fileName).ToLower().Trim('.');

            if (fileExtension != "avi" && fileExtension != "avs")
            {
                throw new TangraVideoException(string.Format("'.{0}' video files are not supported.", fileExtension));
            }

            VideoFileInfo fileInfo = new VideoFileInfo();

            TangraVideoOpenFile(fileName, fileInfo);

            if (fileInfo.CountFrames == 0)
            {
                // TODO: Get an error message from TangraVideo
                throw new TangraVideoException("Tangra was unable to load this file. Check file format and integrity.");
            }

            s_fileInfo = new VideoFileInfo()
            {
                Width = fileInfo.Width,
                Height = fileInfo.Height,
                FrameRate = fileInfo.FrameRate,
                CountFrames = fileInfo.CountFrames,
                FirstFrame = fileInfo.FirstFrame,
                VideoEncodedBitmapImageSize = fileInfo.VideoEncodedBitmapImageSize,
                VideoFileTypeBuffer = fileInfo.VideoFileTypeBuffer,
                EngineBuffer = fileInfo.EngineBuffer
            };

            return fileInfo;
        }
Exemplo n.º 4
0
 public static void CloseFile()
 {
     TangraVideoCloseFile();
     s_fileInfo = null;
 }
Exemplo n.º 5
0
 public static void CloseFile()
 {
     TangraVideoCloseFile();
     s_fileInfo = null;
 }