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

Commit 8f5cc869 authored by Surajit Podder's avatar Surajit Podder Committed by Linux Build Service Account
Browse files

video: Add support for MediaRecorder pause interface

* Add pause() API to java MediaRecorder
* Add change in jni to instantiate extended native MediaRecorder
  which supports pause/resume

Change-Id: I168e187dc33ce32cd3a846123a3e55fa8ac600a0
parent fe1eeb5e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -807,6 +807,15 @@ public class MediaRecorder
     */
    public native void start() throws IllegalStateException;


    /** @hide
    */
    public void pause() throws IllegalStateException
    {
        setParameter("pause=1");
    }


    /**
     * Stops recording. Call this after start(). Once recording is stopped,
     * you will have to configure it again as if it has just been constructed.
+3 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ LOCAL_REQUIRED_MODULES := \
LOCAL_STATIC_LIBRARIES := \
    libstagefright_amrnbenc

LOCAL_WHOLE_STATIC_LIBRARIES := libavmediaextentions

LOCAL_C_INCLUDES += \
    external/libexif/ \
    external/tremor/Tremor \
@@ -63,6 +65,7 @@ LOCAL_C_INCLUDES += \
    frameworks/av/media/libstagefright/codecs/amrnb/common \
    frameworks/av/media/libstagefright/codecs/amrnb/common/include \
    frameworks/av/media/mtp \
    frameworks/av/media/libavextensions \
    frameworks/native/include/media/openmax \
    $(call include-path-for, libhardware)/hardware \
    system/media/camera/include \
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@

#include <system/audio.h>
#include <android_runtime/android_view_Surface.h>

#include <media/AVMediaExtensions.h>
// ----------------------------------------------------------------------------

using namespace android;
@@ -463,7 +463,7 @@ android_media_MediaRecorder_native_setup(JNIEnv *env, jobject thiz, jobject weak

    ScopedUtfChars opPackageNameStr(env, opPackageName);

    sp<MediaRecorder> mr = new MediaRecorder(String16(opPackageNameStr.c_str()));
    sp<MediaRecorder> mr = AVMediaUtils::get()->createMediaRecorder(String16(opPackageNameStr.c_str()));
    if (mr == NULL) {
        jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
        return;