Lines Matching refs:MediaPlayer
19 #define LOG_TAG "MediaPlayer-JNI"
22 #include <media/mediaplayer.h>
72 jclass mClass; // Reference to MediaPlayer class
73 jobject mObject; // Weak ref to MediaPlayer Java object to call on
79 // Hold onto the MediaPlayer class for use in calling the static method
83 LOGE("Can't find android/media/MediaPlayer");
89 // We use a weak reference so the MediaPlayer object can be garbage collected.
123 static sp<MediaPlayer> getMediaPlayer(JNIEnv* env, jobject thiz)
126 MediaPlayer* const p = (MediaPlayer*)env->GetIntField(thiz, fields.context);
127 return sp<MediaPlayer>(p);
130 static sp<MediaPlayer> setMediaPlayer(JNIEnv* env, jobject thiz, const sp<MediaPlayer>& player)
133 sp<MediaPlayer> old = (MediaPlayer*)env->GetIntField(thiz, fields.context);
152 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
179 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
226 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
250 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
264 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
290 // can be the case if setDisplay() on MediaPlayer.java has been called
305 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
322 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
340 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
352 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
364 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
375 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
389 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
401 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
418 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
436 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
450 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
465 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
477 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
489 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
501 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
513 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
535 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
554 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
574 sp<MediaPlayer> media_player = getMediaPlayer(env, thiz);
596 // It is called from a static block in MediaPlayer, which won't run until the
603 clazz = env->FindClass("android/media/MediaPlayer");
629 sp<MediaPlayer> mp = new MediaPlayer();
635 // create new listener and give it to MediaPlayer
639 // Stow our new C++ MediaPlayer in an opaque field in the Java object.
648 sp<MediaPlayer> mp = setMediaPlayer(env, thiz, 0);
660 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
662 LOGW("MediaPlayer finalized without being released");
669 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
679 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
692 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
702 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
729 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
748 sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
804 static const char* const kClassPathName = "android/media/MediaPlayer";
810 "android/media/MediaPlayer", gMethods, NELEM(gMethods));
835 LOGE("ERROR: MediaPlayer native registration failed\n");