예제 #1
0
        public static FileItem NewSourceVideoFileItem(FileContainer fileContainer, string sourceFilePath)
        {
            FileItem fileItem = new FileItem(fileContainer, sourceFilePath, TypeFile.SourceVideo);

            fileItem.VideoSize = VideoSize.Source;
            return(fileItem);
        }
예제 #2
0
        public static FileItem NewSourceImageFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, fileContainer.OriginFilePath, TypeFile.SourceImage);

            fileItem.IpfsProcess = new ProcessItem(fileItem);
            return(fileItem);
        }
예제 #3
0
        public static FileItem NewSpriteVideoFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, null, TypeFile.SpriteVideo);

            fileItem.VideoSize = VideoSize.Source;
            return(fileItem);
        }
예제 #4
0
        public static FileItem NewSpriteVideoFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, null, false);

            fileItem.ModeSprite = true;
            fileItem.VideoSize  = VideoSize.Source;
            return(fileItem);
        }
예제 #5
0
        public static FileContainer NewImageContainer(string sourceFilePath)
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Image);

            fileContainer.SourceFileItem = FileItem.NewSourceImageFileItem(fileContainer, sourceFilePath);

            return(fileContainer);
        }
예제 #6
0
        public static FileContainer NewOverlayContainer(string sourceFilePath)
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Overlay);

            fileContainer.SourceFileItem  = FileItem.NewSourceImageFileItem(fileContainer, sourceFilePath);
            fileContainer.OverlayFileItem = FileItem.NewOverlayImageFileItem(fileContainer); // TMP cancel overlay

            return(fileContainer);
        }
예제 #7
0
        public static FileItem NewSpriteVideoFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, fileContainer.OriginFilePath, TypeFile.SpriteVideo);

            fileItem.VideoSize           = VideoSize.Source;
            fileItem.SpriteEncodeProcess = new ProcessItem(fileItem);
            fileItem.IpfsProcess         = new ProcessItem(fileItem);
            return(fileItem);
        }
예제 #8
0
        public static FileContainer NewSubtitleContainer()
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Subtitle, null);

            fileContainer.SubtitleFileItem = FileItem.NewSubtitleFileItem(fileContainer);

            ProgressManager.RegisterProgress(fileContainer);
            return(fileContainer);
        }
예제 #9
0
        public static FileContainer NewOverlayContainer(string originFilePath)
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Overlay, originFilePath);

            fileContainer.SourceFileItem  = FileItem.NewSourceImageFileItem(fileContainer);
            fileContainer.OverlayFileItem = FileItem.NewOverlayImageFileItem(fileContainer);

            ProgressManager.RegisterProgress(fileContainer);
            return(fileContainer);
        }
예제 #10
0
        public static FileItem NewEncodedVideoFileItem(FileContainer fileContainer, VideoSize videoSize)
        {
            if (videoSize == VideoSize.Undefined)
            {
                throw new InvalidOperationException("VideoSize inconnu");
            }

            FileItem fileItem = new FileItem(fileContainer, null, TypeFile.EncodedVideo);

            fileItem.VideoSize = videoSize;
            return(fileItem);
        }
예제 #11
0
        public static FileContainer NewVideoContainer(string sourceFilePath, params VideoSize[] videoSizes)
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Video);

            fileContainer.SourceFileItem = FileItem.NewSourceVideoFileItem(fileContainer, sourceFilePath);

            fileContainer.EncodedFileItems = new List <FileItem>();
            foreach (VideoSize videoSize in videoSizes)
            {
                fileContainer.EncodedFileItems.Add(FileItem.NewEncodedVideoFileItem(fileContainer, videoSize));
            }

            return(fileContainer);
        }
예제 #12
0
        public static FileItem NewEncodedVideoFileItem(FileContainer fileContainer, VideoSize videoSize)
        {
            if (videoSize == VideoSize.Undefined)
            {
                throw new InvalidOperationException("VideoSize inconnu");
            }

            FileItem fileItem = new FileItem(fileContainer, fileContainer.SourceFileItem.SourceFilePath, TypeFile.EncodedVideo);

            fileItem.VideoSize = videoSize;
            if (!VideoSettings.GpuEncodeMode)
            {
                fileItem.AudioVideoCpuEncodeProcess = new ProcessItem(fileItem);
            }
            fileItem.IpfsProcess = new ProcessItem(fileItem);
            return(fileItem);
        }
예제 #13
0
        public static FileItem NewSourceVideoFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, fileContainer.OriginFilePath, TypeFile.SourceVideo);

            fileItem.VideoSize         = VideoSize.Source;
            fileItem.InfoSourceProcess = new ProcessItem(fileItem);

            if (VideoSettings.GpuEncodeMode)
            {
                fileItem.AudioCpuEncodeProcess = new ProcessItem(fileItem);
                fileItem.VideoGpuEncodeProcess = new ProcessItem(fileItem);
            }

            if (IpfsSettings.AddVideoSource)
            {
                fileItem.AddIpfsProcess(fileItem.SourceFilePath);
            }

            return(fileItem);
        }
예제 #14
0
        public static FileContainer NewVideoContainer(string originFilePath, bool sprite, params VideoSize[] videoSizes)
        {
            FileContainer fileContainer = new FileContainer(TypeContainer.Video, originFilePath);

            fileContainer.SourceFileItem = FileItem.NewSourceVideoFileItem(fileContainer);

            // si sprite demandé
            if (sprite)
            {
                fileContainer.SpriteVideoFileItem = FileItem.NewSpriteVideoFileItem(fileContainer);
            }

            var list = new List <FileItem>();

            foreach (VideoSize videoSize in videoSizes)
            {
                list.Add(FileItem.NewEncodedVideoFileItem(fileContainer, videoSize));
            }
            fileContainer.EncodedFileItems = list;

            ProgressManager.RegisterProgress(fileContainer);
            return(fileContainer);
        }
예제 #15
0
        private FileItem(FileContainer fileContainer, string sourceFilePath, TypeFile typeFile)
        {
            FileContainer = fileContainer;
            FilesToDelete = new List <string>();
            CreationDate  = DateTime.UtcNow;
            SetSourceFilePath(sourceFilePath);
            TypeFile = typeFile;
            switch (typeFile)
            {
            case TypeFile.EncodedVideo:
            case TypeFile.SourceVideo:
                SetTempFilePath(Path.ChangeExtension(TempFileManager.GetNewTempFilePath(), ".mp4"));
                break;

            case TypeFile.SpriteVideo:
                SetTempFilePath(Path.ChangeExtension(TempFileManager.GetNewTempFilePath(), ".jpeg"));
                break;

            case TypeFile.SourceImage:
            case TypeFile.OverlayImage:
                SetTempFilePath(Path.ChangeExtension(TempFileManager.GetNewTempFilePath(), ".png"));
                break;
            }
        }
예제 #16
0
        public static FileItem NewAttachedImageFileItem(FileContainer fileContainer, string filePath)
        {
            FileItem fileItem = new FileItem(fileContainer, filePath, false);

            return(fileItem);
        }
예제 #17
0
 private FileItem(FileContainer fileContainer, string filePath, TypeFile typeFile)
 {
     FileContainer = fileContainer;
     FilePath      = filePath;
     TypeFile      = typeFile;
 }
예제 #18
0
        public static FileItem NewOverlayImageFileItem(FileContainer fileContainer)
        {
            FileItem fileItem = new FileItem(fileContainer, null, TypeFile.OverlayImage);

            return(fileItem);
        }
예제 #19
0
        public static FileItem NewSourceImageFileItem(FileContainer fileContainer, string sourceFilePath)
        {
            FileItem fileItem = new FileItem(fileContainer, sourceFilePath, TypeFile.SourceImage);

            return(fileItem);
        }
예제 #20
0
 private FileItem(FileContainer fileContainer, string filePath, bool isSource)
 {
     IsSource      = isSource;
     FileContainer = fileContainer;
     FilePath      = filePath;
 }