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

Commit efe93ef1 authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Linux Build Service Account
Browse files

MediaRecorder: Add pause interface

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

Change-Id: I19372d496870f3729aa28464326995a71aa72299
CRs-Fixed: 587051
parent 7d043804
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -759,6 +759,10 @@ public class MediaRecorder
     */
     */
    public native void start() throws IllegalStateException;
    public native void start() throws IllegalStateException;


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

    /**
    /**
     * Stops recording. Call this after start(). Once recording is stopped,
     * Stops recording. Call this after start(). Once recording is stopped,
     * you will have to configure it again as if it has just been constructed.
     * you will have to configure it again as if it has just been constructed.
+9 −0
Original line number Original line Diff line number Diff line
@@ -378,6 +378,14 @@ android_media_MediaRecorder_start(JNIEnv *env, jobject thiz)
    process_media_recorder_call(env, mr->start(), "java/lang/RuntimeException", "start failed.");
    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
static void
android_media_MediaRecorder_stop(JNIEnv *env, jobject thiz)
android_media_MediaRecorder_stop(JNIEnv *env, jobject thiz)
{
{
@@ -499,6 +507,7 @@ static JNINativeMethod gMethods[] = {
    {"getSurface",           "()Landroid/view/Surface;",        (void *)android_media_MediaRecorder_getSurface},
    {"getSurface",           "()Landroid/view/Surface;",        (void *)android_media_MediaRecorder_getSurface},
    {"getMaxAmplitude",      "()I",                             (void *)android_media_MediaRecorder_native_getMaxAmplitude},
    {"getMaxAmplitude",      "()I",                             (void *)android_media_MediaRecorder_native_getMaxAmplitude},
    {"start",                "()V",                             (void *)android_media_MediaRecorder_start},
    {"start",                "()V",                             (void *)android_media_MediaRecorder_start},
    {"pause",                "()V",                             (void *)android_media_MediaRecorder_pause},
    {"stop",                 "()V",                             (void *)android_media_MediaRecorder_stop},
    {"stop",                 "()V",                             (void *)android_media_MediaRecorder_stop},
    {"native_reset",         "()V",                             (void *)android_media_MediaRecorder_native_reset},
    {"native_reset",         "()V",                             (void *)android_media_MediaRecorder_native_reset},
    {"release",              "()V",                             (void *)android_media_MediaRecorder_release},
    {"release",              "()V",                             (void *)android_media_MediaRecorder_release},