Loading media/jni/android_media_MediaPlayer.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -101,10 +101,9 @@ void JNIMediaPlayerListener::notify(int msg, int ext1, int ext2) // ---------------------------------------------------------------------------- static sp<Surface> get_surface(JNIEnv* env, jobject clazz) static Surface* get_surface(JNIEnv* env, jobject clazz) { Surface* const p = (Surface*)env->GetIntField(clazz, fields.surface_native); return sp<Surface>(p); return (Surface*)env->GetIntField(clazz, fields.surface_native); } static sp<MediaPlayer> getMediaPlayer(JNIEnv* env, jobject thiz) Loading Loading @@ -205,7 +204,7 @@ static void setVideoSurface(const sp<MediaPlayer>& mp, JNIEnv *env, jobject thiz { jobject surface = env->GetObjectField(thiz, fields.surface); if (surface != NULL) { const sp<Surface>& native_surface = get_surface(env, surface); const sp<Surface> native_surface = get_surface(env, surface); LOGV("prepare: surface=%p (id=%d)", native_surface.get(), native_surface->ID()); mp->setVideoSurface(native_surface); Loading Loading @@ -245,7 +244,7 @@ android_media_MediaPlayer_prepareAsync(JNIEnv *env, jobject thiz) } jobject surface = env->GetObjectField(thiz, fields.surface); if (surface != NULL) { const sp<Surface>& native_surface = get_surface(env, surface); const sp<Surface> native_surface = get_surface(env, surface); LOGV("prepareAsync: surface=%p (id=%d)", native_surface.get(), native_surface->ID()); mp->setVideoSurface(native_surface); Loading media/libmedia/mediaplayer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -233,7 +233,10 @@ status_t MediaPlayer::setVideoSurface(const sp<Surface>& surface) LOGV("setVideoSurface"); Mutex::Autolock _l(mLock); if (mPlayer == 0) return NO_INIT; if (surface != NULL) return mPlayer->setVideoSurface(surface->getISurface()); else return mPlayer->setVideoSurface(NULL); } // must call with lock held Loading Loading
media/jni/android_media_MediaPlayer.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -101,10 +101,9 @@ void JNIMediaPlayerListener::notify(int msg, int ext1, int ext2) // ---------------------------------------------------------------------------- static sp<Surface> get_surface(JNIEnv* env, jobject clazz) static Surface* get_surface(JNIEnv* env, jobject clazz) { Surface* const p = (Surface*)env->GetIntField(clazz, fields.surface_native); return sp<Surface>(p); return (Surface*)env->GetIntField(clazz, fields.surface_native); } static sp<MediaPlayer> getMediaPlayer(JNIEnv* env, jobject thiz) Loading Loading @@ -205,7 +204,7 @@ static void setVideoSurface(const sp<MediaPlayer>& mp, JNIEnv *env, jobject thiz { jobject surface = env->GetObjectField(thiz, fields.surface); if (surface != NULL) { const sp<Surface>& native_surface = get_surface(env, surface); const sp<Surface> native_surface = get_surface(env, surface); LOGV("prepare: surface=%p (id=%d)", native_surface.get(), native_surface->ID()); mp->setVideoSurface(native_surface); Loading Loading @@ -245,7 +244,7 @@ android_media_MediaPlayer_prepareAsync(JNIEnv *env, jobject thiz) } jobject surface = env->GetObjectField(thiz, fields.surface); if (surface != NULL) { const sp<Surface>& native_surface = get_surface(env, surface); const sp<Surface> native_surface = get_surface(env, surface); LOGV("prepareAsync: surface=%p (id=%d)", native_surface.get(), native_surface->ID()); mp->setVideoSurface(native_surface); Loading
media/libmedia/mediaplayer.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -233,7 +233,10 @@ status_t MediaPlayer::setVideoSurface(const sp<Surface>& surface) LOGV("setVideoSurface"); Mutex::Autolock _l(mLock); if (mPlayer == 0) return NO_INIT; if (surface != NULL) return mPlayer->setVideoSurface(surface->getISurface()); else return mPlayer->setVideoSurface(NULL); } // must call with lock held Loading