예제 #1
0
 private VideoStream(VideoFileInfo openedfileInfo, string fileName)
 {
     m_OpenedFileInfo = openedfileInfo;
     m_FileName = fileName;
 }
예제 #2
0
 //HRESULT TangraVideoOpenFile(char* fileName, VideoFileInfo* fileInfo);
 private static extern int TangraVideoOpenFile(string fileName, [In, Out] VideoFileInfo fileInfo);
예제 #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;
        }
예제 #4
0
 public static void CloseFile()
 {
     TangraVideoCloseFile();
     s_fileInfo = null;
 }
예제 #5
0
 public static void CloseFile()
 {
     TangraVideoCloseFile();
     s_fileInfo = null;
 }