1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.videoeditor.util; 18 19 import com.android.videoeditor.service.MovieMediaItem; 20 21 /** 22 * Media item utilities 23 */ 24 public class MediaItemUtils { 25 /** 26 * It is not possible to instantiate this type 27 */ 28 private MediaItemUtils() { 29 } 30 31 /** 32 * @return The default duration of an image in the timeline 33 */ 34 public static long getDefaultImageDuration() { 35 return 3000; 36 } 37 38 /** 39 * @return The minimum image item duration 40 */ 41 public static long getMinimumImageItemDuration() { 42 return 1000; 43 } 44 45 /** 46 * @return The minimum video clip duration 47 */ 48 public static long getMinimumVideoItemDuration() { 49 return 1000; 50 } 51 52 /** 53 * @return The minimum media duration 54 */ 55 public static long getMinimumMediaItemDuration(MovieMediaItem mediaItem) { 56 return mediaItem.isVideoClip() ? getMinimumVideoItemDuration() : 57 getMinimumVideoItemDuration(); 58 } 59 } 60