Lines Matching defs:env

62 var = env->FindClass(className); \
66 var = env->GetMethodID(clazz, fieldName, fieldDescriptor); \
109 JNIMediaPlayerListener(JNIEnv* env, jobject thiz, jobject weak_thiz);
118 JNIMediaPlayerListener::JNIMediaPlayerListener(JNIEnv* env, jobject thiz, jobject weak_thiz)
123 jclass clazz = env->GetObjectClass(thiz);
126 jniThrowException(env, "java/lang/Exception", NULL);
129 mClass = (jclass)env->NewGlobalRef(clazz);
133 mObject = env->NewGlobalRef(weak_thiz);
139 JNIEnv *env = AndroidRuntime::getJNIEnv();
140 env->DeleteGlobalRef(mObject);
141 env->DeleteGlobalRef(mClass);
146 JNIEnv *env = AndroidRuntime::getJNIEnv();
148 jobject jParcel = createJavaParcelObject(env);
150 Parcel* nativeParcel = parcelForJavaObject(env, jParcel);
152 env->CallStaticVoidMethod(mClass, fields.post_event, mObject,
154 env->DeleteLocalRef(jParcel);
157 env->CallStaticVoidMethod(mClass, fields.post_event, mObject,
160 if (env->ExceptionCheck()) {
162 LOGW_EX(env);
163 env->ExceptionClear();
169 static sp<MediaPlayer> getMediaPlayer(JNIEnv* env, jobject thiz)
172 MediaPlayer* const p = (MediaPlayer*)env->GetLongField(thiz, fields.context);
176 static sp<MediaPlayer> setMediaPlayer(JNIEnv* env, jobject thiz, const sp<MediaPlayer>& player)
179 sp<MediaPlayer> old = (MediaPlayer*)env->GetLongField(thiz, fields.context);
186 env->SetLongField(thiz, fields.context, (jlong)player.get());
194 static void process_media_player_call(JNIEnv *env, jobject thiz, status_t opStatus, const char* exception, const char *message)
198 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
203 jniThrowException(env, "java/lang/IllegalStateException", NULL);
205 jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
207 jniThrowException(env, "java/lang/SecurityException", NULL);
211 jniThrowException( env, exception, message);
216 jniThrowException( env, exception, msg);
224 JNIEnv *env, jobject thiz, jobject httpServiceBinderObj, jstring path,
227 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
229 jniThrowException(env, "java/lang/IllegalStateException", NULL);
234 jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
238 const char *tmp = env->GetStringUTFChars(path, NULL);
245 env->ReleaseStringUTFChars(path, tmp);
251 env, keys, values, &headersVector)) {
257 sp<IBinder> binder = ibinderForJavaObject(env, httpServiceBinderObj);
268 env, thiz, opStatus, "java/io/IOException",
273 android_media_MediaPlayer_setDataSourceFD(JNIEnv *env, jobject thiz, jobject fileDescriptor, jlong offset, jlong length)
275 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
277 jniThrowException(env, "java/lang/IllegalStateException", NULL);
282 jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
285 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
287 process_media_player_call( env, thiz, mp->setDataSource(fd, offset, length), "java/io/IOException", "setDataSourceFD failed." );
291 android_media_MediaPlayer_setDataSourceCallback(JNIEnv *env, jobject thiz, jobject dataSource)
293 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
295 jniThrowException(env, "java/lang/IllegalStateException", NULL);
300 jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
303 sp<IDataSource> callbackDataSource = new JMediaDataSource(env, dataSource);
304 process_media_player_call(env, thiz, mp->setDataSource(callbackDataSource), "java/lang/RuntimeException", "setDataSourceCallback failed." );
308 getVideoSurfaceTexture(JNIEnv* env, jobject thiz) {
309 IGraphicBufferProducer * const p = (IGraphicBufferProducer*)env->GetLongField(thiz, fields.surface_texture);
314 decVideoSurfaceRef(JNIEnv *env, jobject thiz)
316 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
321 sp<IGraphicBufferProducer> old_st = getVideoSurfaceTexture(env, thiz);
328 setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlayerMustBeAlive)
330 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
333 jniThrowException(env, "java/lang/IllegalStateException", NULL);
338 decVideoSurfaceRef(env, thiz);
342 sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
346 jniThrowException(env, "java/lang/IllegalArgumentException",
352 jniThrowException(env, "java/lang/IllegalArgumentException",
358 env->SetLongField(thiz, fields.surface_texture, (jlong)new_st.get());
368 android_media_MediaPlayer_setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface)
370 setVideoSurface(env, thiz, jsurface, true /* mediaPlayerMustBeAlive */);
374 android_media_MediaPlayer_getBufferingParams(JNIEnv *env, jobject thiz)
376 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
378 jniThrowException(env, "java/lang/IllegalStateException", NULL);
385 env, thiz, mp->getBufferingSettings(&settings),
387 if (env->ExceptionCheck()) {
392 return bp.asJobject(env, gBufferingParamsFields);
396 android_media_MediaPlayer_setBufferingParams(JNIEnv *env, jobject thiz, jobject params)
402 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
404 jniThrowException(env, "java/lang/IllegalStateException", NULL);
409 bp.fillFromJobject(env, gBufferingParamsFields, params);
413 env, thiz, mp->setBufferingSettings(bp.settings),
418 android_media_MediaPlayer_prepare(JNIEnv *env, jobject thiz)
420 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
422 jniThrowException(env, "java/lang/IllegalStateException", NULL);
428 sp<IGraphicBufferProducer> st = getVideoSurfaceTexture(env, thiz);
431 process_media_player_call( env, thiz, mp->prepare(), "java/io/IOException", "Prepare failed." );
435 android_media_MediaPlayer_prepareAsync(JNIEnv *env, jobject thiz)
437 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
439 jniThrowException(env, "java/lang/IllegalStateException", NULL);
445 sp<IGraphicBufferProducer> st = getVideoSurfaceTexture(env, thiz);
448 process_media_player_call( env, thiz, mp->prepareAsync(), "java/io/IOException", "Prepare Async failed." );
452 android_media_MediaPlayer_start(JNIEnv *env, jobject thiz)
455 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
457 jniThrowException(env, "java/lang/IllegalStateException", NULL);
460 process_media_player_call( env, thiz, mp->start(), NULL, NULL );
464 android_media_MediaPlayer_stop(JNIEnv *env, jobject thiz)
467 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
469 jniThrowException(env, "java/lang/IllegalStateException", NULL);
472 process_media_player_call( env, thiz, mp->stop(), NULL, NULL );
476 android_media_MediaPlayer_pause(JNIEnv *env, jobject thiz)
479 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
481 jniThrowException(env, "java/lang/IllegalStateException", NULL);
484 process_media_player_call( env, thiz, mp->pause(), NULL, NULL );
488 android_media_MediaPlayer_isPlaying(JNIEnv *env, jobject thiz)
490 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
492 jniThrowException(env, "java/lang/IllegalStateException", NULL);
502 android_media_MediaPlayer_setPlaybackParams(JNIEnv *env, jobject thiz, jobject params)
504 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
506 jniThrowException(env, "java/lang/IllegalStateException", NULL);
511 pbp.fillFromJobject(env, gPlaybackParamsFields, params);
543 env, thiz, err,
548 android_media_MediaPlayer_getPlaybackParams(JNIEnv *env, jobject thiz)
550 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
552 jniThrowException(env, "java/lang/IllegalStateException", NULL);
559 env, thiz, mp->getPlaybackSettings(&audioRate),
561 if (env->ExceptionCheck()) {
572 return pbp.asJobject(env, gPlaybackParamsFields);
576 android_media_MediaPlayer_setSyncParams(JNIEnv *env, jobject thiz, jobject params)
578 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
580 jniThrowException(env, "java/lang/IllegalStateException", NULL);
585 scp.fillFromJobject(env, gSyncParamsFields, params);
614 env, thiz, err,
619 android_media_MediaPlayer_getSyncParams(JNIEnv *env, jobject thiz)
621 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
623 jniThrowException(env, "java/lang/IllegalStateException", NULL);
630 env, thiz, mp->getSyncSettings(&scp.sync, &scp.frameRate),
632 if (env->ExceptionCheck()) {
644 jniThrowException(env, "java/lang/IllegalStateException", NULL);
653 return scp.asJobject(env, gSyncParamsFields);
657 android_media_MediaPlayer_seekTo(JNIEnv *env, jobject thiz, jlong msec, jint mode)
659 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
661 jniThrowException(env, "java/lang/IllegalStateException", NULL);
665 process_media_player_call( env, thiz, mp->seekTo((int)msec, (MediaPlayerSeekMode)mode), NULL, NULL );
669 android_media_MediaPlayer_notifyAt(JNIEnv *env, jobject thiz, jlong mediaTimeUs)
671 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
673 jniThrowException(env, "java/lang/IllegalStateException", NULL);
677 process_media_player_call( env, thiz, mp->notifyAt((int64_t)mediaTimeUs), NULL, NULL );
681 android_media_MediaPlayer_getVideoWidth(JNIEnv *env, jobject thiz)
683 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
685 jniThrowException(env, "java/lang/IllegalStateException", NULL);
698 android_media_MediaPlayer_getVideoHeight(JNIEnv *env, jobject thiz)
700 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
702 jniThrowException(env, "java/lang/IllegalStateException", NULL);
715 android_media_MediaPlayer_native_getMetrics(JNIEnv *env, jobject thiz)
717 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
719 jniThrowException(env, "java/lang/IllegalStateException", NULL);
733 jobject mybundle = MediaMetricsJNI::writeMetricsToBundle(env, item, NULL);
743 android_media_MediaPlayer_getCurrentPosition(JNIEnv *env, jobject thiz)
745 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
747 jniThrowException(env, "java/lang/IllegalStateException", NULL);
751 process_media_player_call( env, thiz, mp->getCurrentPosition(&msec), NULL, NULL );
757 android_media_MediaPlayer_getDuration(JNIEnv *env, jobject thiz)
759 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
761 jniThrowException(env, "java/lang/IllegalStateException", NULL);
765 process_media_player_call( env, thiz, mp->getDuration(&msec), NULL, NULL );
771 android_media_MediaPlayer_reset(JNIEnv *env, jobject thiz)
774 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
776 jniThrowException(env, "java/lang/IllegalStateException", NULL);
779 process_media_player_call( env, thiz, mp->reset(), NULL, NULL );
783 android_media_MediaPlayer_setAudioStreamType(JNIEnv *env, jobject thiz, jint streamtype)
786 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
788 jniThrowException(env, "java/lang/IllegalStateException", NULL);
791 process_media_player_call( env, thiz, mp->setAudioStreamType((audio_stream_type_t) streamtype) , NULL, NULL );
795 android_media_MediaPlayer_getAudioStreamType(JNIEnv *env, jobject thiz)
797 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
799 jniThrowException(env, "java/lang/IllegalStateException", NULL);
803 process_media_player_call( env, thiz, mp->getAudioStreamType(&streamtype), NULL, NULL );
809 android_media_MediaPlayer_setParameter(JNIEnv *env, jobject thiz, jint key, jobject java_request)
812 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
814 jniThrowException(env, "java/lang/IllegalStateException", NULL);
818 Parcel *request = parcelForJavaObject(env, java_request);
828 android_media_MediaPlayer_setLooping(JNIEnv *env, jobject thiz, jboolean looping)
831 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
833 jniThrowException(env, "java/lang/IllegalStateException", NULL);
836 process_media_player_call( env, thiz, mp->setLooping(looping), NULL, NULL );
840 android_media_MediaPlayer_isLooping(JNIEnv *env, jobject thiz)
843 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
845 jniThrowException(env, "java/lang/IllegalStateException", NULL);
852 android_media_MediaPlayer_setVolume(JNIEnv *env, jobject thiz, jfloat leftVolume, jfloat rightVolume)
855 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
857 jniThrowException(env, "java/lang/IllegalStateException", NULL);
860 process_media_player_call( env, thiz, mp->setVolume((float) leftVolume, (float) rightVolume), NULL, NULL );
866 android_media_MediaPlayer_invoke(JNIEnv *env, jobject thiz,
869 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
871 jniThrowException(env, "java/lang/IllegalStateException", NULL);
875 Parcel *request = parcelForJavaObject(env, java_request);
876 Parcel *reply = parcelForJavaObject(env, java_reply);
885 android_media_MediaPlayer_setMetadataFilter(JNIEnv *env, jobject thiz, jobject request)
887 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
889 jniThrowException(env, "java/lang/IllegalStateException", NULL);
893 Parcel *filter = parcelForJavaObject(env, request);
896 jniThrowException(env, "java/lang/RuntimeException", "Filter is null");
904 android_media_MediaPlayer_getMetadata(JNIEnv *env, jobject thiz, jboolean update_only,
907 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
909 jniThrowException(env, "java/lang/IllegalStateException", NULL);
913 Parcel *metadata = parcelForJavaObject(env, reply);
916 jniThrowException(env, "java/lang/RuntimeException", "Reply parcel is null");
936 android_media_MediaPlayer_native_init(JNIEnv *env)
940 clazz = env->FindClass("android/media/MediaPlayer");
945 fields.context = env->GetFieldID(clazz, "mNativeContext", "J");
950 fields.post_event = env->GetStaticMethodID(clazz, "postEventFromNative",
956 fields.surface_texture = env->GetFieldID(clazz, "mNativeSurfaceTexture", "J");
961 env->DeleteLocalRef(clazz);
963 clazz = env->FindClass("android/net/ProxyInfo");
969 env->GetMethodID(clazz, "getHost", "()Ljava/lang/String;");
972 env->GetMethodID(clazz, "getPort", "()I");
975 env->GetMethodID(clazz, "getExclusionListAsString", "()Ljava/lang/String;");
977 env->DeleteLocalRef(clazz);
979 gBufferingParamsFields.init(env);
985 gStateExceptionFields.classId = static_cast<jclass>(env->NewGlobalRef(clazz));
987 env->DeleteLocalRef(clazz);
993 gPlaybackParamsFields.init(env);
994 gSyncParamsFields.init(env);
995 gVolumeShaperFields.init(env);
999 android_media_MediaPlayer_native_setup(JNIEnv *env, jobject thiz, jobject weak_this)
1004 jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
1009 sp<JNIMediaPlayerListener> listener = new JNIMediaPlayerListener(env, thiz, weak_this);
1013 setMediaPlayer(env, thiz, mp);
1017 android_media_MediaPlayer_release(JNIEnv *env, jobject thiz)
1020 decVideoSurfaceRef(env, thiz);
1021 sp<MediaPlayer> mp = setMediaPlayer(env, thiz, 0);
1030 android_media_MediaPlayer_native_finalize(JNIEnv *env, jobject thiz)
1033 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1037 android_media_MediaPlayer_release(env, thiz);
1040 static void android_media_MediaPlayer_set_audio_session_id(JNIEnv *env, jobject thiz,
1043 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1045 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1048 process_media_player_call( env, thiz, mp->setAudioSessionId((audio_session_t) sessionId), NULL,
1052 static jint android_media_MediaPlayer_get_audio_session_id(JNIEnv *env, jobject thiz) {
1054 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1056 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1064 android_media_MediaPlayer_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level)
1067 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1069 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1072 process_media_player_call( env, thiz, mp->setAuxEffectSendLevel(level), NULL, NULL );
1075 static void android_media_MediaPlayer_attachAuxEffect(JNIEnv *env, jobject thiz, jint effectId) {
1077 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1079 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1082 process_media_player_call( env, thiz, mp->attachAuxEffect(effectId), NULL, NULL );
1087 JNIEnv *env, jobject /* thiz */, jobject java_reply)
1092 jniThrowException(env, "java/lang/RuntimeException", "cannot get MediaPlayerService");
1096 Parcel *reply = parcelForJavaObject(env, java_reply);
1102 android_media_MediaPlayer_setRetransmitEndpoint(JNIEnv *env, jobject thiz,
1104 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1106 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1113 cAddrString = env->GetStringUTFChars(addrString, NULL);
1130 env->ReleaseStringUTFChars(addrString, cAddrString);
1134 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1141 android_media_MediaPlayer_setNextMediaPlayer(JNIEnv *env, jobject thiz, jobject java_player)
1144 sp<MediaPlayer> thisplayer = getMediaPlayer(env, thiz);
1146 jniThrowException(env, "java/lang/IllegalStateException", "This player not initialized");
1149 sp<MediaPlayer> nextplayer = (java_player == NULL) ? NULL : getMediaPlayer(env, java_player);
1151 jniThrowException(env, "java/lang/IllegalStateException", "That player not initialized");
1156 jniThrowException(env, "java/lang/IllegalArgumentException", "Next player can't be self");
1161 env, thiz, thisplayer->setNextMediaPlayer(nextplayer),
1168 static jint android_media_MediaPlayer_applyVolumeShaper(JNIEnv *env, jobject thiz,
1173 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1182 env, gVolumeShaperFields, jconfig);
1187 env, gVolumeShaperFields, joperation);
1198 static jobject android_media_MediaPlayer_getVolumeShaperState(JNIEnv *env, jobject thiz,
1200 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1209 return VolumeShaperHelper::convertStateToJobject(env, gVolumeShaperFields, state);
1216 static void throwDrmStateException(JNIEnv *env, const char *msg, status_t err)
1220 jobject exception = env->NewObject(gStateExceptionFields.classId,
1222 env->NewStringUTF(msg));
1223 env->Throw(static_cast<jthrowable>(exception));
1227 static bool throwDrmExceptionAsNecessary(JNIEnv *env, status_t err, const char *msg = NULL)
1267 jniThrowException(env, "java/lang/IllegalArgumentException", msg);
1270 jniThrowException(env, "android/media/NotProvisionedException", msg);
1273 jniThrowException(env, "android/media/ResourceBusyException", msg);
1276 jniThrowException(env, "android/media/DeniedByServerException", msg);
1279 jniThrowException(env, "android/media/MediaDrmResetException",
1292 throwDrmStateException(env, msg, err);
1298 static Vector<uint8_t> JByteArrayToVector(JNIEnv *env, jbyteArray const &byteArray)
1301 size_t length = env->GetArrayLength(byteArray);
1303 env->GetByteArrayRegion(byteArray, 0, length, (jbyte *)vector.editArray());
1307 static void android_media_MediaPlayer_prepareDrm(JNIEnv *env, jobject thiz,
1310 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1312 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1317 jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
1321 Vector<uint8_t> uuid = JByteArrayToVector(env, uuidObj);
1325 env,
1331 Vector<uint8_t> drmSessionId = JByteArrayToVector(env, drmSessionIdObj);
1335 env,
1345 env,
1350 env,
1354 throwDrmExceptionAsNecessary(env, err, "Failed to prepare DRM scheme");
1359 static void android_media_MediaPlayer_releaseDrm(JNIEnv *env, jobject thiz)
1361 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1363 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1371 env,
1382 static jboolean android_media_MediaPlayer_setOutputDevice(JNIEnv *env, jobject thiz, jint device_id)
1384 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1391 static jint android_media_MediaPlayer_getRoutedDeviceId(JNIEnv *env, jobject thiz)
1393 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1401 JNIEnv* env, jobject thiz, jboolean enabled)
1403 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
1410 jniThrowException(env, "java/lang/IllegalStateException", NULL);
1486 static int register_android_media_MediaPlayer(JNIEnv *env)
1488 return AndroidRuntime::registerNativeMethods(env,
1491 extern int register_android_media_ImageReader(JNIEnv *env);
1492 extern int register_android_media_ImageWriter(JNIEnv *env);
1493 extern int register_android_media_Crypto(JNIEnv *env);
1494 extern int register_android_media_Drm(JNIEnv *env);
1495 extern int register_android_media_Descrambler(JNIEnv *env);
1496 extern int register_android_media_MediaCodec(JNIEnv *env);
1497 extern int register_android_media_MediaExtractor(JNIEnv *env);
1498 extern int register_android_media_MediaCodecList(JNIEnv *env);
1499 extern int register_android_media_MediaHTTPConnection(JNIEnv *env);
1500 extern int register_android_media_MediaMetadataRetriever(JNIEnv *env);
1501 extern int register_android_media_MediaMuxer(JNIEnv *env);
1502 extern int register_android_media_MediaRecorder(JNIEnv *env);
1503 extern int register_android_media_MediaScanner(JNIEnv *env);
1504 extern int register_android_media_MediaSync(JNIEnv *env);
1505 extern int register_android_media_ResampleInputStream(JNIEnv *env);
1506 extern int register_android_media_MediaProfiles(JNIEnv *env);
1507 extern int register_android_mtp_MtpDatabase(JNIEnv *env);
1508 extern int register_android_mtp_MtpDevice(JNIEnv *env);
1509 extern int register_android_mtp_MtpServer(JNIEnv *env);
1513 JNIEnv* env = NULL;
1516 if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
1520 assert(env != NULL);
1522 if (register_android_media_ImageWriter(env) != JNI_OK) {
1527 if (register_android_media_ImageReader(env) < 0) {
1532 if (register_android_media_MediaPlayer(env) < 0) {
1537 if (register_android_media_MediaRecorder(env) < 0) {
1542 if (register_android_media_MediaScanner(env) < 0) {
1547 if (register_android_media_MediaMetadataRetriever(env) < 0) {
1552 if (register_android_media_ResampleInputStream(env) < 0) {
1557 if (register_android_media_MediaProfiles(env) < 0) {
1562 if (register_android_mtp_MtpDatabase(env) < 0) {
1567 if (register_android_mtp_MtpDevice(env) < 0) {
1572 if (register_android_mtp_MtpServer(env) < 0) {
1577 if (register_android_media_MediaCodec(env) < 0) {
1582 if (register_android_media_MediaSync(env) < 0) {
1587 if (register_android_media_MediaExtractor(env) < 0) {
1592 if (register_android_media_MediaMuxer(env) < 0) {
1597 if (register_android_media_MediaCodecList(env) < 0) {
1602 if (register_android_media_Crypto(env) < 0) {
1607 if (register_android_media_Drm(env) < 0) {
1612 if (register_android_media_Descrambler(env) < 0) {
1617 if (register_android_media_MediaHTTPConnection(env) < 0) {