summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-10-18 19:45:07 (GMT)
committerSteve Kondik <steve@cyngn.com>2015-10-18 19:45:11 (GMT)
commitc1330ec0c5ef804beef398a2608c751eb89a2489 (patch)
tree0e81af80c5a2ab5738f7a18be214161ee3b36270
parent0455309dcd9af6dfdef5c72b6939ecceef935fe9 (diff)
downloadandroid_packages_apps_Gallery2-c1330ec0c5ef804beef398a2608c751eb89a2489.zip
android_packages_apps_Gallery2-c1330ec0c5ef804beef398a2608c751eb89a2489.tar.gz
android_packages_apps_Gallery2-c1330ec0c5ef804beef398a2608c751eb89a2489.tar.bz2
Revert "Gallery2: Enable Suspend/Resume"
This reverts commit 9b1ab3613c9e22f45c7404d5a5acd6b24df4dce6. Change-Id: Ic023655b4dd47be35cf5efa43557af1c60cb1420
-rwxr-xr-xsrc/org/codeaurora/gallery3d/video/CodeauroraVideoView.java41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index c637c29..ecc2ac9 100755
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -371,6 +371,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
if (LOG) {
Log.v(TAG, "surfaceCreated(" + holder + ")");
}
+ /*
if (mCurrentState == STATE_SUSPENDED) {
mSurfaceHolder = holder;
mMediaPlayer.setDisplay(mSurfaceHolder);
@@ -387,6 +388,12 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
release(false);
}
}
+ */
+ if (mCurrentState == STATE_SUSPENDED) {
+ mSurfaceHolder = holder;
+ mMediaPlayer.setDisplay(mSurfaceHolder);
+ release(false);
+ }
mSurfaceHolder = holder;
openVideo();
}
@@ -623,9 +630,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
}
public void surfaceCreated(SurfaceHolder holder) {
- if (LOG) {
- Log.v(TAG, "surfaceCreated(" + holder + ")");
- }
+ /*
if (mCurrentState == STATE_SUSPENDED) {
mSurfaceHolder = holder;
mMediaPlayer.setDisplay(mSurfaceHolder);
@@ -644,6 +649,17 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
}
mSurfaceHolder = holder;
openVideo();
+ */
+ if (LOG) {
+ Log.v(TAG, "surfaceCreated(" + holder + ")");
+ }
+ if (mCurrentState == STATE_SUSPENDED) {
+ mSurfaceHolder = holder;
+ mMediaPlayer.setDisplay(mSurfaceHolder);
+ release(false);
+ }
+ mSurfaceHolder = holder;
+ openVideo();
}
public void surfaceDestroyed(SurfaceHolder holder) {
@@ -773,6 +789,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
}
public void suspend() {
+ /*
// HTTP streaming will call mMediaPlayer->suspend(), others will call release()
if (isHTTPStreaming(mUri) && mCurrentState != STATE_PREPARING) {
if (mMediaPlayer != null) {
@@ -782,13 +799,13 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
return;
}
}
- }
+ }*/
release(false);
}
public void resume() {
- // HTTP streaming (with suspended status) will call mMediaPlayer->resume(),
- // others will call openVideo()
+ /*
+ // HTTP streaming (with suspended status) will call mMediaPlayer->resume(), others will call openVideo()
if (mCurrentState == STATE_SUSPENDED) {
if (mSurfaceHolder != null) {
// The surface hasn't been destroyed
@@ -806,8 +823,16 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
release(false);
}
} else {
- // The surface has been destroyed, resume operation will be done
- // after surface created
+ // The surface has been destroyed, resume operation will be done after surface created
+ return;
+ }
+ }*/
+ // HTTP streaming (with suspended status) will call mMediaPlayer->resume(), others will call openVideo()
+ if (mCurrentState == STATE_SUSPENDED) {
+ if (mSurfaceHolder != null) {
+ release(false);
+ } else {
+ // The surface has been destroyed, resume operation will be done after surface created
return;
}
}