summaryrefslogtreecommitdiffstats
path: root/media/tests/MediaFrameworkTest
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-12-03 17:00:48 -0800
committerJames Dong <jdong@google.com>2010-12-03 17:14:25 -0800
commitf6bd1ea0c79516a5ef3c0c463761deec1a80e419 (patch)
treecef6c2c8920438a9e3e3f4917bffd1cf30200214 /media/tests/MediaFrameworkTest
parent7c2bacf6a904f470a7e850841c306065049feedc (diff)
downloadframeworks_base-f6bd1ea0c79516a5ef3c0c463761deec1a80e419.zip
frameworks_base-f6bd1ea0c79516a5ef3c0c463761deec1a80e419.tar.gz
frameworks_base-f6bd1ea0c79516a5ef3c0c463761deec1a80e419.tar.bz2
Replace MediaMetadataRetriever.captureFrame() with MediaMetadataRetriever.getFrameAtTime()
as part of the preparation for publishing MediaMetadataRetriever as public Java API bug - 2433195 Change-Id: I6e8a771347e3d89bfe359ae403ebfe3205ea6313
Diffstat (limited to 'media/tests/MediaFrameworkTest')
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java2
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java
index 0c0974c..2eea206 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/CodecTest.java
@@ -532,7 +532,7 @@ public class CodecTest {
e.printStackTrace();
return false;
}
- Bitmap outThumbnail = mMediaMetadataRetriever.captureFrame();
+ Bitmap outThumbnail = mMediaMetadataRetriever.getFrameAtTime(-1);
//Verify the thumbnail
Bitmap goldenBitmap = mBitmapFactory.decodeFile(goldenPath);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
index 484f6e7..a0c72e6 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
@@ -87,7 +87,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
continue;
}
retriever.setDataSource(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i]);
- Bitmap bitmap = retriever.captureFrame();
+ Bitmap bitmap = retriever.getFrameAtTime(-1);
assertTrue(bitmap != null);
try {
java.io.OutputStream stream = new FileOutputStream(MediaNames.THUMBNAIL_CAPTURE_TEST_FILES[i] + ".jpg");
@@ -146,7 +146,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(MediaNames.TEST_PATH_1);
- Bitmap bitmap = retriever.captureFrame();
+ Bitmap bitmap = retriever.getFrameAtTime(-1);
assertTrue(bitmap != null);
try {
java.io.OutputStream stream = new FileOutputStream("/sdcard/thumbnailout.jpg");
@@ -164,7 +164,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
assertTrue(!hasFailed);
}
- // If setDataSource() has not been called, both captureFrame() and extractMetadata() must
+ // If setDataSource() has not been called, both getFrameAtTime() and extractMetadata() must
// return null.
@MediumTest
public static void testBasicAbnormalMethodCallSequence() {
@@ -175,7 +175,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
Log.e(TAG, "No album metadata expected, but is available");
hasFailed = true;
}
- if (retriever.captureFrame() != null) {
+ if (retriever.getFrameAtTime(-1) != null) {
Log.e(TAG, "No frame expected, but is available");
hasFailed = true;
}
@@ -249,13 +249,13 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
boolean hasFailed = false;
retriever.setDataSource(MediaNames.TEST_PATH_1);
- assertTrue(retriever.captureFrame() != null);
+ assertTrue(retriever.getFrameAtTime(-1) != null);
assertTrue(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS) != null);
// Do not capture frame or retrieve metadata
retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY & MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
- if (retriever.captureFrame() != null) {
+ if (retriever.getFrameAtTime(-1) != null) {
Log.e(TAG, "No frame expected, but is available");
hasFailed = true;
}
@@ -272,7 +272,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
// Retriever metadata only
retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
- if (retriever.captureFrame() != null) {
+ if (retriever.getFrameAtTime(-1) != null) {
Log.e(TAG, "No frame expected, but is available");
hasFailed = true;
}
@@ -280,7 +280,7 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
// Capture frame and retrieve metadata
retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY | MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
- assertTrue(retriever.captureFrame() != null);
+ assertTrue(retriever.getFrameAtTime(-1) != null);
assertTrue(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS) != null);
retriever.release();
assertTrue(!hasFailed);