Esempio n. 1
0
 public static Mp4RepairJob SourceContainsIllegalFilenames()
 {
     Dimension oldDimensions = new Dimension(320, 240);
       Dimension newDimensions = new Dimension(640, 480);
       FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.TempDestinationDirectory);
       return new Mp4RepairJob(SampleFilenames.FileWithIllegalCharacters, oldDimensions, newDimensions, fileSaveRule);
 }
Esempio n. 2
0
 /// <summary>Initializes a new instance of the <see cref="Mp4RepairJob"/> class.</summary>
 /// <param name="pathToOriginalFiles">A string referencing the file or folder to be processed</param>
 /// <param name="oldDimensions">The dimensions that are incorrectly stored on the source MP4 file(s)</param>
 /// <param name="newDimensions">The correct dimensions of the MP4 file(s)</param>
 /// <param name="fileSaveRule">The destination and naming conventions to use for the converted files</param>
 public Mp4RepairJob(string pathToOriginalFiles, Dimension oldDimensions, Dimension newDimensions, FileSaveRule fileSaveRule)
 {
     this.pathToOriginalFiles = pathToOriginalFiles;
       this.oldDimensions = oldDimensions;
       this.newDimensions = newDimensions;
       this.fileSaveRule = fileSaveRule;
       this.jobResults = new List<JobResult>();
 }
Esempio n. 3
0
        public static Mp4RepairJob NoFilesExist()
        {
            CreateTempDirectory();

              Dimension oldDimensions = new Dimension(320, 240);
              Dimension newDimensions = new Dimension(640, 480);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.TempDestinationDirectory);

              return new Mp4RepairJob(SampleFilenames.TempDirectory, oldDimensions, newDimensions, fileSaveRule);
        }
Esempio n. 4
0
        public static Mp4RepairJob DestinationHasIllegalFilenames()
        {
            CreateTempDirectory();
              CreateSampleFilesAndNonMp4Files();

              Dimension oldDimensions = new Dimension(320, 240);
              Dimension newDimensions = new Dimension(640, 480);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.FileWithIllegalCharacters);

              return new Mp4RepairJob(SampleFilenames.TempDirectory, oldDimensions, newDimensions, fileSaveRule);
        }
Esempio n. 5
0
        public static Mp4RepairJob AllFilesSuccess()
        {
            CreateTempDirectory();
              CreateSampleFilesWithStandardByteArray();

              Dimension oldDimensions = new Dimension(320, 240);
              Dimension newDimensions = new Dimension(640, 480);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.TempDestinationDirectory);

              return new Mp4RepairJob(SampleFilenames.TempDirectory, oldDimensions, newDimensions, fileSaveRule);
        }
Esempio n. 6
0
        public static Mp4RepairJob OneFileWithoutOldDimensions()
        {
            CreateTempDirectory();
              CreateSampleFilesWithStandardByteArray();

              SampleBinaryFile sampleBinaryFile = new SampleBinaryFile(SampleFilenames.TempDirectory + "SampleFile_0007.mp4", SampleByteArrays.ArrayToSearchWithoutPattern, FileResult.Success);
              WriteFile overwriteOneFile = new WriteFile(sampleBinaryFile);

              Dimension oldDimensions = new Dimension(320, 240);
              Dimension newDimensions = new Dimension(640, 480);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, SampleFilenames.TempDestinationDirectory);

              return new Mp4RepairJob(SampleFilenames.TempDirectory, oldDimensions, newDimensions, fileSaveRule);
        }
Esempio n. 7
0
        private Mp4RepairJob PrepareRepairJob()
        {
            string sourcePath = String.Empty;
              Dimension orginalDimensions = new Dimension(0, 0);
              Dimension actualDimensions = new Dimension(0, 0);
              FileSaveRule fileSaveRule = new FileSaveRule(string.Empty, string.Empty, string.Empty);

              if (ValidateMp4RepairJob())
              {
            sourcePath = this.txtSourcePath.Text;
            orginalDimensions = new Dimension(this.txtOriginalDimensionsWidth.Text.ToUInt16(), this.txtOriginalDimensionsHeight.Text.ToUInt16());
            actualDimensions = new Dimension(this.txtActualDimensionsWidth.Text.ToUInt16(), this.txtActualDimensionsHeight.Text.ToUInt16());
            fileSaveRule = new FileSaveRule(this.txtFilenamePrefix.Text, this.txtFilenameSuffix.Text, this.txtDestinationPath.Text.AppendBackslashIfNecessary());
              }

              Mp4RepairJob mp4RepairJob = new Mp4RepairJob(sourcePath, orginalDimensions, actualDimensions, fileSaveRule);

              return mp4RepairJob;
        }
Esempio n. 8
0
 internal Destination(FileSaveRule fileSaveRule, string pathToModify)
 {
     this.originalFilename = pathToModify;
       this.fileSaveRule = fileSaveRule;
 }