Пример #1
0
 public MediaFile(string fileName, bool manageLifespan)
 {
     _manageLifespan    = manageLifespan;
     _fileName          = fileName;
     _realLengthInUnits = MediaInspector.GetLength(fileName);
     _lengthUsedInUnits = _realLengthInUnits;
     LengthInFrames     = -1;
 }
 public MediaFile(string fileName, bool manageLifespan)
 {
     _fileName          = !Path.IsPathRooted(fileName) ? Path.GetFullPath(fileName) : fileName;
     _manageLifespan    = manageLifespan;
     _realLengthInUnits = MediaInspector.GetLength(fileName);
     _lengthUsedInUnits = _realLengthInUnits;
     LengthInFrames     = -1;
 }
Пример #3
0
        protected void AssertLengths(double fps, string file1, string file2)
        {
            long length1 = MediaInspector.GetLength(file1);
            long length2 = MediaInspector.GetLength(file2);

            long frameLength = TimelineBuilder.ToUnits(1.0 / fps);

            long difference = Math.Abs(length1 - length2);

            Assert.IsTrue(difference <= frameLength);
        }
Пример #4
0
        protected void AssertLengths(double fps, double expected, string file)
        {
            long length1 = TimelineBuilder.ToUnits(expected);
            long length2 = MediaInspector.GetLength(file);

            long frameLength = TimelineBuilder.ToUnits(1.0 / fps) * 4; // allow for 4 frames difference

            long difference = Math.Abs(length1 - length2);

            Assert.IsTrue(difference <= frameLength,
                          string.Format("expected {0} +/- {1}, but was {2}", length1, frameLength, length2));
        }