diff options
author | Rodrigo Carceroni <carceroni@google.com> | 2011-10-14 14:00:39 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-14 14:00:39 -0700 |
commit | f3d505afe66e0961e904027e8ab98455ccd3bd2e (patch) | |
tree | 4982cc864aa4f041c5fb17082aed9d7d2a9a1df6 /src/com/android/camera/EffectsRecorder.java | |
parent | f3b7efa21a1f2b365655acd8efffbdc1b83e6b0c (diff) | |
parent | caf8466dcdf6d6c496e46961bb3132126363ef83 (diff) | |
download | packages_apps_LegacyCamera-f3d505afe66e0961e904027e8ab98455ccd3bd2e.zip packages_apps_LegacyCamera-f3d505afe66e0961e904027e8ab98455ccd3bd2e.tar.gz packages_apps_LegacyCamera-f3d505afe66e0961e904027e8ab98455ccd3bd2e.tar.bz2 |
Merge "Bug 5383077: handle video thumbnail generation correctly when effects are on" into ics-mr0
Diffstat (limited to 'src/com/android/camera/EffectsRecorder.java')
-rw-r--r-- | src/com/android/camera/EffectsRecorder.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java index 3059281..5e8bfc1 100644 --- a/src/com/android/camera/EffectsRecorder.java +++ b/src/com/android/camera/EffectsRecorder.java @@ -25,9 +25,10 @@ import android.filterfw.core.GraphRunner; import android.filterfw.core.GraphRunner.OnRunnerDoneListener; import android.filterfw.geometry.Point; import android.filterfw.geometry.Quad; -import android.filterpacks.videosrc.SurfaceTextureSource.SurfaceTextureSourceListener; import android.filterpacks.videoproc.BackDropperFilter; import android.filterpacks.videoproc.BackDropperFilter.LearningDoneListener; +import android.filterpacks.videosink.MediaEncoderFilter.OnRecordingDoneListener; +import android.filterpacks.videosrc.SurfaceTextureSource.SurfaceTextureSourceListener; import android.graphics.SurfaceTexture; import android.hardware.Camera; @@ -71,6 +72,7 @@ public class EffectsRecorder { public static final int EFFECT_MSG_DONE_LEARNING = 1; public static final int EFFECT_MSG_SWITCHING_EFFECT = 2; public static final int EFFECT_MSG_EFFECTS_STOPPED = 3; + public static final int EFFECT_MSG_RECORDING_DONE = 4; private Context mContext; private Handler mHandler; @@ -370,7 +372,8 @@ public class EffectsRecorder { "recordingHeight", mProfile.videoFrameHeight, "recordingProfile", mProfile, "audioSource", MediaRecorder.AudioSource.CAMCORDER, - "learningDoneListener", mLearningDoneListener); + "learningDoneListener", mLearningDoneListener, + "recordingDoneListener", mRecordingDoneListener); mRunner = null; mGraphId = -1; @@ -542,6 +545,16 @@ public class EffectsRecorder { } }; + // A callback to finalize the media after the recording is done. + private OnRecordingDoneListener mRecordingDoneListener = + new OnRecordingDoneListener() { + // Forward the callback to the VideoCamera object (as an asynchronous event). + public void onRecordingDone() { + if (mLogVerbose) Log.v(TAG, "Recording done callback triggered"); + sendMessage(EFFECT_NONE, EFFECT_MSG_RECORDING_DONE); + } + }; + public synchronized void startRecording() { if (mLogVerbose) Log.v(TAG, "Starting recording (" + this + ")"); @@ -755,4 +768,5 @@ public class EffectsRecorder { }); } } + } |