summaryrefslogtreecommitdiffstats
path: root/samples/browseable/MediaRecorder
diff options
context:
space:
mode:
authorTrevor Johns <trevorjohns@google.com>2014-11-12 11:39:30 -0800
committerTrevor Johns <trevorjohns@google.com>2014-11-12 11:39:30 -0800
commit527a4f30a69aaa54fc9654539f0b6d839e37af3c (patch)
tree38f816a286e672e8f00caed6a0344c3c18632a78 /samples/browseable/MediaRecorder
parentfcd28181a15ebe95724fe096a8b5198c964b0d7f (diff)
downloadandroid_development-527a4f30a69aaa54fc9654539f0b6d839e37af3c.tar.gz
android_development-527a4f30a69aaa54fc9654539f0b6d839e37af3c.tar.bz2
android_development-527a4f30a69aaa54fc9654539f0b6d839e37af3c.zip
Update browseable samples for lmp-docs
Synced to commit df5e5013422b81b4fd05c0ac9fd964b13624847a. Includes new samples for Android Auto. Change-Id: I3fec46e2a6b3f196682a92f1afd91eb682dc2dc1
Diffstat (limited to 'samples/browseable/MediaRecorder')
-rw-r--r--samples/browseable/MediaRecorder/AndroidManifest.xml4
-rw-r--r--samples/browseable/MediaRecorder/_index.jd10
-rw-r--r--samples/browseable/MediaRecorder/res/values-v21/template-styles.xml22
-rw-r--r--samples/browseable/MediaRecorder/res/values/base-strings.xml3
-rw-r--r--samples/browseable/MediaRecorder/src/com.example.android.common.media/MediaCodecWrapper.java3
5 files changed, 32 insertions, 10 deletions
diff --git a/samples/browseable/MediaRecorder/AndroidManifest.xml b/samples/browseable/MediaRecorder/AndroidManifest.xml
index 32f88f64f..539dc2c3d 100644
--- a/samples/browseable/MediaRecorder/AndroidManifest.xml
+++ b/samples/browseable/MediaRecorder/AndroidManifest.xml
@@ -22,9 +22,7 @@
android:versionCode="1"
android:versionName="1.0">
- <uses-sdk
- android:minSdkVersion="14"
- android:targetSdkVersion="17" />
+ <!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle -->
<!-- This app records A/V content from camera and stores it to disk -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
diff --git a/samples/browseable/MediaRecorder/_index.jd b/samples/browseable/MediaRecorder/_index.jd
index dac835aa8..28c55901f 100644
--- a/samples/browseable/MediaRecorder/_index.jd
+++ b/samples/browseable/MediaRecorder/_index.jd
@@ -2,6 +2,10 @@ page.tags="MediaRecorder"
sample.group=Media
@jd:body
-<p>This sample demonstrates how to use the {@link android.media.MediaRecorder}
-API to record video from a camera or camcorder, and display a preview of the
-recording.</p>
+<p>
+
+ This sample uses the camera/camcorder as the A/V source for the MediaRecorder API.
+ A TextureView is used as the camera preview which limits the code to API 14+. This
+ can be easily replaced with a SurfaceView to run on older devices.
+
+ </p>
diff --git a/samples/browseable/MediaRecorder/res/values-v21/template-styles.xml b/samples/browseable/MediaRecorder/res/values-v21/template-styles.xml
new file mode 100644
index 000000000..134fcd9d3
--- /dev/null
+++ b/samples/browseable/MediaRecorder/res/values-v21/template-styles.xml
@@ -0,0 +1,22 @@
+<!--
+ Copyright 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+
+ <!-- Activity themes -->
+ <style name="Theme.Base" parent="android:Theme.Material.Light" />
+
+</resources>
diff --git a/samples/browseable/MediaRecorder/res/values/base-strings.xml b/samples/browseable/MediaRecorder/res/values/base-strings.xml
index f9ade8c45..3e2b6baae 100644
--- a/samples/browseable/MediaRecorder/res/values/base-strings.xml
+++ b/samples/browseable/MediaRecorder/res/values/base-strings.xml
@@ -14,9 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<resources>
<string name="app_name">MediaRecorder</string>
<string name="intro_message">
diff --git a/samples/browseable/MediaRecorder/src/com.example.android.common.media/MediaCodecWrapper.java b/samples/browseable/MediaRecorder/src/com.example.android.common.media/MediaCodecWrapper.java
index a511221f5..a48337404 100644
--- a/samples/browseable/MediaRecorder/src/com.example.android.common.media/MediaCodecWrapper.java
+++ b/samples/browseable/MediaRecorder/src/com.example.android.common.media/MediaCodecWrapper.java
@@ -21,6 +21,7 @@ import android.os.Handler;
import android.os.Looper;
import android.view.Surface;
+import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
import java.util.Queue;
@@ -136,7 +137,7 @@ public class MediaCodecWrapper {
* @return
*/
public static MediaCodecWrapper fromVideoFormat(final MediaFormat trackFormat,
- Surface surface) {
+ Surface surface) throws IOException {
MediaCodecWrapper result = null;
MediaCodec videoCodec = null;