summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorSurajit Podder <spodder@codeaurora.org>2015-08-13 02:37:40 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:28:14 -0600
commit8f5cc869db28a9bfb5c9cec90852f92914444639 (patch)
tree97e55e41250a0edeb95df036fc93ec319f891b98 /media
parentfe1eeb5e28c6bdd6ec4c876c4b01567ae10ade37 (diff)
downloadframeworks_base-8f5cc869db28a9bfb5c9cec90852f92914444639.zip
frameworks_base-8f5cc869db28a9bfb5c9cec90852f92914444639.tar.gz
frameworks_base-8f5cc869db28a9bfb5c9cec90852f92914444639.tar.bz2
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
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaRecorder.java9
-rw-r--r--media/jni/Android.mk3
-rw-r--r--media/jni/android_media_MediaRecorder.cpp4
3 files changed, 14 insertions, 2 deletions
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index a5aeec6..3a21fe9 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -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.
diff --git a/media/jni/Android.mk b/media/jni/Android.mk
index 79557bc..4d039c5 100644
--- a/media/jni/Android.mk
+++ b/media/jni/Android.mk
@@ -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 \
diff --git a/media/jni/android_media_MediaRecorder.cpp b/media/jni/android_media_MediaRecorder.cpp
index 9e52111..3a17f0e 100644
--- a/media/jni/android_media_MediaRecorder.cpp
+++ b/media/jni/android_media_MediaRecorder.cpp
@@ -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;