001/* 002 * (C) Copyright 2006-2016 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Thomas Roger <[email protected]> 018 */ 019package org.nuxeo.ecm.platform.video.service; 020 021import java.util.Collection; 022 023import org.nuxeo.ecm.core.api.DocumentModel; 024import org.nuxeo.ecm.platform.video.TranscodedVideo; 025import org.nuxeo.ecm.platform.video.Video; 026import org.nuxeo.ecm.platform.video.VideoConversionStatus; 027 028/** 029 * Service to asynchronously launch and monitor video conversions. 030 * <p> 031 * 032 * @author <a href="mailto:[email protected]">Thomas Roger</a> 033 * @since 5.5 034 */ 035public interface VideoService { 036 037 /** 038 * Returns the available registered video conversions that can be run on a Video document. 039 */ 040 Collection<VideoConversion> getAvailableVideoConversions(); 041 042 /** 043 * Launch an asynchronously video conversion of the given {@code doc}. 044 * 045 * @param doc the video document to be converted 046 * @param conversionName the video conversion to use 047 */ 048 void launchConversion(DocumentModel doc, String conversionName); 049 050 /** 051 * Launch all the registered automatic video conversions on the given {@code doc}. 052 * 053 * @param doc the video document to be converted 054 */ 055 void launchAutomaticConversions(DocumentModel doc); 056 057 /** 058 * Convert the {@code originalVideo} using the given {@code conversionName}. 059 * 060 * @param originalVideo the video to convert 061 * @param conversionName the video conversion to use 062 * @return a {@code TranscodedVideo} object of the converted video. 063 */ 064 TranscodedVideo convert(Video originalVideo, String conversionName); 065 066 067 /** 068 * Returns the status of the video conversion with the given conversion name on the given document. 069 * 070 * @since 5.7.3 071 */ 072 VideoConversionStatus getProgressStatus(String repositoryName, String docId, String conversionName); 073 074 /** 075 * @since 7.2 076 */ 077 VideoConversion getVideoConversion(String conversionName); 078 079 /** 080 * @since 7.4 081 */ 082 Configuration getConfiguration(); 083 084}