001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.repository.model.FileVersion;
018    
019    import java.io.InputStream;
020    
021    import java.util.Set;
022    
023    /**
024     * @author Sergio González
025     */
026    public interface VideoProcessor {
027    
028            public static final String THUMBNAIL_TYPE = "jpg";
029    
030            public void generateVideo(FileVersion fileVersion) throws Exception;
031    
032            public InputStream getPreviewAsStream(FileVersion fileVersion)
033                    throws Exception;
034    
035            public InputStream getPreviewAsStream(FileVersion fileVersion, String type)
036                    throws Exception;
037    
038            public long getPreviewFileSize(FileVersion fileVersion)
039                    throws Exception;
040    
041            public long getPreviewFileSize(FileVersion fileVersion, String type)
042                    throws Exception;
043    
044            public InputStream getThumbnailAsStream(
045                            FileVersion fileVersion, int thumbnailIndex)
046                    throws Exception;
047    
048            public long getThumbnailFileSize(
049                            FileVersion fileVersion, int thumbnailIndex)
050                    throws Exception;
051    
052            public Set<String> getVideoMimeTypes();
053    
054            public boolean hasVideo(FileVersion fileVersion);
055    
056            public boolean isSupported(String mimeType);
057    
058            public boolean isVideoSupported(FileVersion fileVersion);
059    
060            public boolean isVideoSupported(String mimeType);
061    
062            public void trigger(FileVersion fileVersion);
063    
064    }