internal Video(string fileName, GraphicsDevice device) { GraphicsDevice = device; Theorafile.tf_fopen(fileName, out theora); int width, height; double fps; Theorafile.tf_videoinfo(theora, out width, out height, out fps); Width = width; Height = height; FramesPerSecond = (float)fps; // FIXME: This is a part of the Duration hack! Duration = TimeSpan.MaxValue; needsDurationHack = true; }
internal Video(string fileName, GraphicsDevice device) { GraphicsDevice = device; Theorafile.tf_fopen(fileName, out theora); Theorafile.tf_videoinfo( theora, out yWidth, out yHeight, out fps ); uvWidth = yWidth / 2; uvHeight = yHeight / 2; // FIXME: This is a part of the Duration hack! Duration = TimeSpan.MaxValue; needsDurationHack = true; }
internal Video(string fileName, GraphicsDevice device) { GraphicsDevice = device; Theorafile.th_pixel_fmt fmt; Theorafile.tf_fopen(fileName, out theora); Theorafile.tf_videoinfo( theora, out yWidth, out yHeight, out fps, out fmt ); if (fmt == Theorafile.th_pixel_fmt.TH_PF_420) { uvWidth = yWidth / 2; uvHeight = yHeight / 2; } else if (fmt == Theorafile.th_pixel_fmt.TH_PF_422) { uvWidth = yWidth / 2; uvHeight = yHeight; } else if (fmt == Theorafile.th_pixel_fmt.TH_PF_444) { uvWidth = yWidth; uvHeight = yHeight; } else { throw new NotSupportedException( "Unrecognized YUV format!" ); } // FIXME: This is a part of the Duration hack! Duration = TimeSpan.MaxValue; needsDurationHack = true; }