public native void stop() throws IllegalStateException;
/**
+ * Pauses recording. Call this after start(). You may resume recording
+ * with resume() without reconfiguration, as opposed to stop(). It does
+ * nothing if the recording is already paused.
+ *
+ * When the recording is paused and resumed, the resulting output would
+ * be as if nothing happend during paused period, immediately switching
+ * to the resumed scene.
+ *
+ * @throws IllegalStateException if it is called before start() or after
+ * stop()
+ * {@hide}
+ */
+ public native void pause() throws IllegalStateException;
+
+ /**
+ * Resumes recording. Call this after start(). It does nothing if the
+ * recording is not paused.
+ *
+ * @throws IllegalStateException if it is called before start() or after
+ * stop()
+ * @see android.media.MediaRecorder#pause
+ * {@hide}
+ */
+ public native void resume() throws IllegalStateException;
+
+ /**
* Restarts the MediaRecorder to its idle state. After calling
* this method, you will have to configure it again as if it had just been
* constructed.
}
static void
+android_media_MediaRecorder_pause(JNIEnv *env, jobject thiz)
+{
+ ALOGV("pause");
+ sp<MediaRecorder> mr = getMediaRecorder(env, thiz);
+ process_media_recorder_call(env, mr->pause(), "java/lang/RuntimeException", "pause failed.");
+}
+
+static void
+android_media_MediaRecorder_resume(JNIEnv *env, jobject thiz)
+{
+ ALOGV("resume");
+ sp<MediaRecorder> mr = getMediaRecorder(env, thiz);
+ process_media_recorder_call(env, mr->resume(), "java/lang/RuntimeException", "resume failed.");
+}
+
+static void
android_media_MediaRecorder_native_reset(JNIEnv *env, jobject thiz)
{
ALOGV("native_reset");
{"getMaxAmplitude", "()I", (void *)android_media_MediaRecorder_native_getMaxAmplitude},
{"start", "()V", (void *)android_media_MediaRecorder_start},
{"stop", "()V", (void *)android_media_MediaRecorder_stop},
+ {"pause", "()V", (void *)android_media_MediaRecorder_pause},
+ {"resume", "()V", (void *)android_media_MediaRecorder_resume},
{"native_reset", "()V", (void *)android_media_MediaRecorder_native_reset},
{"release", "()V", (void *)android_media_MediaRecorder_release},
{"native_init", "()V", (void *)android_media_MediaRecorder_native_init},