use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailForVideoDurationLessFileDuration.
/**
*To test ThumbnailList for file where video duration is less
* than file duration.
*/
@LargeTest
public void testThumbnailForVideoDurationLessFileDuration() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_640x480_15fps_1200Kbps_AACLC_48KHz_64kps_m_0_27.3gp";
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = (mediaVideoItem.getWidth() / 2);
final int outHeight = (mediaVideoItem.getHeight() / 2);
final long atTime = mediaVideoItem.getDuration() - 2000;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailWithHeight.
/**
* Check the thumbnail for Height = 10
*/
@LargeTest
public void testThumbnailWithHeight() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_176x144_30fps_256kbps_AACLC_44.1kHz_96kbps_s_1_17.3gp";
final int atTime = 1000;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = (mediaVideoItem.getWidth() / 2);
final int outHeight = 10;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailForH264QCIF.
/**
* To test thumbnail / frame extraction on H264 QCIF.
*/
@LargeTest
public void testThumbnailForH264QCIF() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_176x144_15fps_144kbps_AMRNB_8kHz_12.2kbps_m_1_17.3gp";
final int atTime = 0;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = mediaVideoItem.getWidth() * 2;
final int outHeight = mediaVideoItem.getHeight() * 2;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailListForH264WVGAWithCount.
/**
*To test ThumbnailList for H264 WVGA with count > frame available
*/
@LargeTest
public void testThumbnailListForH264WVGAWithCount() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "H264_BP_800x480_15fps_512kbps_AACLC_24KHz_38Kbps_s_1_17.mp4";
final int tnCount = 70;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = (mediaVideoItem.getWidth() / 2);
final int outHeight = (mediaVideoItem.getHeight() / 2);
final long thumbNailStartTime = mediaVideoItem.getDuration() / 2;
final long thumbNailEndTime = thumbNailStartTime + 4000;
Bitmap[] thumbNailBmp = null;
boolean flagForException = false;
try {
thumbNailBmp = mediaVideoItem.getThumbnailList(outWidth, outHeight, thumbNailStartTime, thumbNailEndTime, tnCount);
} catch (Exception e) {
assertTrue("Unable to get Thumbnail list", flagForException);
}
if (thumbNailBmp.length <= tnCount) {
flagForException = true;
}
assertTrue("Thumbnail count more than asked", flagForException);
}
use of android.media.videoeditor.MediaVideoItem in project android_frameworks_base by ParanoidAndroid.
the class MediaItemThumbnailTest method testThumbnailForMPEG4NTSC.
/**
* To test thumbnail / frame extraction on MPEG4 NTSC.
*/
@LargeTest
public void testThumbnailForMPEG4NTSC() throws Exception {
final String videoItemFilename = INPUT_FILE_PATH + "MPEG4_SP_720x480_30fps_280kbps_AACLC_48kHz_96kbps_s_0_21.mp4";
final int atTime = 0;
final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER;
final MediaVideoItem mediaVideoItem = mVideoEditorHelper.createMediaItem(mVideoEditor, "m1", videoItemFilename, renderingMode);
final int outWidth = mediaVideoItem.getWidth() / 2;
final int outHeight = mediaVideoItem.getHeight() / 2;
final Bitmap thumbNailBmp = mediaVideoItem.getThumbnail(outWidth, outHeight, atTime);
validateThumbnail(thumbNailBmp, outWidth, outHeight);
}
Aggregations