Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20623512 authored by Kim Zhang's avatar Kim Zhang Committed by Steve Kondik
Browse files

MediaRecorder: add pause interface

--add pause in java level
--add pause in jni level

Change-Id: I7f2d5d5ebb97716458b55a5780fd6cc3d09e9f11
parent 913f365d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -712,6 +712,10 @@ public class MediaRecorder
     */
    public native void start() throws IllegalStateException;

/** @hide
*/
    public native void pause() throws IllegalStateException;

    /**
     * Stops recording. Call this after start(). Once recording is stopped,
     * you will have to configure it again as if it has just been constructed.
+9 −0
Original line number Diff line number Diff line
@@ -352,6 +352,14 @@ android_media_MediaRecorder_start(JNIEnv *env, jobject thiz)
    process_media_recorder_call(env, mr->start(), "java/lang/RuntimeException", "start failed.");
}

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_stop(JNIEnv *env, jobject thiz)
{
@@ -472,6 +480,7 @@ static JNINativeMethod gMethods[] = {
    {"_prepare",             "()V",                             (void *)android_media_MediaRecorder_prepare},
    {"getMaxAmplitude",      "()I",                             (void *)android_media_MediaRecorder_native_getMaxAmplitude},
    {"start",                "()V",                             (void *)android_media_MediaRecorder_start},
    {"pause",                "()V",                             (void *)android_media_MediaRecorder_pause},
    {"stop",                 "()V",                             (void *)android_media_MediaRecorder_stop},
    {"native_reset",         "()V",                             (void *)android_media_MediaRecorder_native_reset},
    {"release",              "()V",                             (void *)android_media_MediaRecorder_release},