Loading media/java/android/media/MediaMetadataRetriever.java +19 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.net.Uri; import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; Loading Loading @@ -57,7 +58,24 @@ public class MediaMetadataRetriever * @param path The path of the input media file. * @throws IllegalArgumentException If the path is invalid. */ public native void setDataSource(String path) throws IllegalArgumentException; public void setDataSource(String path) throws IllegalArgumentException { FileInputStream is = null; try { is = new FileInputStream(path); FileDescriptor fd = is.getFD(); setDataSource(fd, 0, 0x7ffffffffffffffL); } catch (FileNotFoundException fileEx) { throw new IllegalArgumentException(); } catch (IOException ioEx) { throw new IllegalArgumentException(); } try { if (is != null) { is.close(); } } catch (Exception e) {} } /** * Sets the data source (URI) to use. Call this Loading media/jni/android_media_MediaMetadataRetriever.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -131,13 +131,6 @@ android_media_MediaMetadataRetriever_setDataSourceAndHeaders( "setDataSource failed"); } static void android_media_MediaMetadataRetriever_setDataSource( JNIEnv *env, jobject thiz, jstring path) { android_media_MediaMetadataRetriever_setDataSourceAndHeaders( env, thiz, path, NULL, NULL); } static void android_media_MediaMetadataRetriever_setDataSourceFD(JNIEnv *env, jobject thiz, jobject fileDescriptor, jlong offset, jlong length) { ALOGV("setDataSource"); Loading Loading @@ -447,8 +440,6 @@ static void android_media_MediaMetadataRetriever_native_setup(JNIEnv *env, jobje // JNI mapping between Java methods and native methods static JNINativeMethod nativeMethods[] = { {"setDataSource", "(Ljava/lang/String;)V", (void *)android_media_MediaMetadataRetriever_setDataSource}, { "_setDataSource", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V", Loading Loading
media/java/android/media/MediaMetadataRetriever.java +19 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Bitmap; import android.net.Uri; import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; Loading Loading @@ -57,7 +58,24 @@ public class MediaMetadataRetriever * @param path The path of the input media file. * @throws IllegalArgumentException If the path is invalid. */ public native void setDataSource(String path) throws IllegalArgumentException; public void setDataSource(String path) throws IllegalArgumentException { FileInputStream is = null; try { is = new FileInputStream(path); FileDescriptor fd = is.getFD(); setDataSource(fd, 0, 0x7ffffffffffffffL); } catch (FileNotFoundException fileEx) { throw new IllegalArgumentException(); } catch (IOException ioEx) { throw new IllegalArgumentException(); } try { if (is != null) { is.close(); } } catch (Exception e) {} } /** * Sets the data source (URI) to use. Call this Loading
media/jni/android_media_MediaMetadataRetriever.cpp +0 −9 Original line number Diff line number Diff line Loading @@ -131,13 +131,6 @@ android_media_MediaMetadataRetriever_setDataSourceAndHeaders( "setDataSource failed"); } static void android_media_MediaMetadataRetriever_setDataSource( JNIEnv *env, jobject thiz, jstring path) { android_media_MediaMetadataRetriever_setDataSourceAndHeaders( env, thiz, path, NULL, NULL); } static void android_media_MediaMetadataRetriever_setDataSourceFD(JNIEnv *env, jobject thiz, jobject fileDescriptor, jlong offset, jlong length) { ALOGV("setDataSource"); Loading Loading @@ -447,8 +440,6 @@ static void android_media_MediaMetadataRetriever_native_setup(JNIEnv *env, jobje // JNI mapping between Java methods and native methods static JNINativeMethod nativeMethods[] = { {"setDataSource", "(Ljava/lang/String;)V", (void *)android_media_MediaMetadataRetriever_setDataSource}, { "_setDataSource", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V", Loading