예제 #1
0
        public VideoFile ConvertVideo(String fileName, String format)
        {
            Console.WriteLine("VideoConversionFacade: conversion started.");
            VideoFile file        = new VideoFile(fileName);
            Codec     sourceCodec = CodecFactory.Extract(file);
            Codec     destinationCodec;

            if (format.Equals("mp4"))
            {
                destinationCodec = new OggCompressionCodec();
            }
            else
            {
                destinationCodec = new MPEG4CompressionCodec();
            }
            VideoFile buffer             = BitrateReader.Read(file, sourceCodec);
            VideoFile intermediateResult = BitrateReader.Convert(buffer, destinationCodec);
            VideoFile result             = (new AudioMixer()).Fix(intermediateResult);

            Console.WriteLine("VideoConversionFacade: conversion completed.");
            return(result);
        }
예제 #2
0
 public static VideoFile Convert(VideoFile buffer, Codec codec)
 {
     Console.WriteLine("BitrateReader: writing file...");
     return(buffer);
 }
예제 #3
0
 public static VideoFile Read(VideoFile file, Codec codec)
 {
     Console.WriteLine("BitrateReader: reading file...");
     return(file);
 }
예제 #4
0
 public VideoFile Fix(VideoFile result)
 {
     Console.WriteLine("AudioMixer: fixing audio...");
     return(new VideoFile("tmp"));
 }