summaryrefslogtreecommitdiffstats
path: root/res/raw
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-08-19 18:14:06 -0700
committerEino-Ville Talvala <etalvala@google.com>2011-09-06 13:32:46 -0700
commit9efb0b19fa929c528253f0a9b6f5b27791e1ee52 (patch)
tree74e44529a5682ea73905cff667a65eacb51c745e /res/raw
parentfc404e9a87e2f7e1fa9bc0ede998ed9cf75a047d (diff)
downloadpackages_apps_LegacyCamera-9efb0b19fa929c528253f0a9b6f5b27791e1ee52.zip
packages_apps_LegacyCamera-9efb0b19fa929c528253f0a9b6f5b27791e1ee52.tar.gz
packages_apps_LegacyCamera-9efb0b19fa929c528253f0a9b6f5b27791e1ee52.tar.bz2
Add video recording with effects into Camera.
Initial support for video recording in the Camera app, with the goofyface and background replacement effects. Bug: 5212166 Change-Id: I30995e305c202ba57bf76ff18c885bf16c5ea14f
Diffstat (limited to 'res/raw')
-rw-r--r--res/raw/backdropper.graph83
-rw-r--r--res/raw/goofy_face.graph100
2 files changed, 183 insertions, 0 deletions
diff --git a/res/raw/backdropper.graph b/res/raw/backdropper.graph
new file mode 100644
index 0000000..e3fe877
--- /dev/null
+++ b/res/raw/backdropper.graph
@@ -0,0 +1,83 @@
+//
+// Copyright (C) 2011 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.
+//
+
+// Imports ---------------------------------------------------
+@import android.filterpacks.base;
+@import android.filterpacks.ui;
+@import android.filterpacks.videosrc;
+@import android.filterpacks.videoproc;
+@import android.filterpacks.videosink;
+
+@setting autoBranch = "synced";
+
+// Externals -------------------------------------------------
+
+@external textureSourceCallback;
+@external recordingWidth;
+@external recordingHeight;
+@external recordingProfile;
+@external audioSource;
+
+@external previewSurface;
+@external previewWidth;
+@external previewHeight;
+
+@external learningDoneListener;
+
+// Filters ---------------------------------------------------
+
+// Camera input
+@filter SurfaceTextureSource source {
+ sourceListener = $textureSourceCallback;
+ width = $recordingWidth;
+ height = $recordingHeight;
+ closeOnTimeout = true;
+}
+
+// Background video input
+@filter MediaSource background {
+ sourceUrl = "no_file_specified";
+ waitForNewFrame = false;
+ sourceIsUrl = true;
+}
+
+// Background replacer
+@filter BackDropperFilter replacer {
+ autowbToggle = 1;
+ learningDoneListener = $learningDoneListener;
+}
+
+// Display output
+@filter SurfaceTargetFilter display {
+ surface = $previewSurface;
+ owidth = $previewWidth;
+ oheight = $previewHeight;
+}
+
+// Recording output
+@filter MediaEncoderFilter recorder {
+ audioSource = $audioSource;
+ recordingProfile = $recordingProfile;
+ recording = false;
+ // outputFile, orientationHint, listeners will be set when recording starts
+}
+
+// Connections -----------------------------------------------
+@connect source[video] => replacer[video];
+@connect background[video] => replacer[background];
+@connect replacer[video] => display[frame];
+@connect replacer[video] => recorder[videoframe];
+
diff --git a/res/raw/goofy_face.graph b/res/raw/goofy_face.graph
new file mode 100644
index 0000000..344e137
--- /dev/null
+++ b/res/raw/goofy_face.graph
@@ -0,0 +1,100 @@
+//
+// Copyright (C) 2011 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.
+//
+
+// Imports ---------------------------------------------------
+@import android.filterpacks.videosrc;
+@import android.filterpacks.videosink;
+@import android.filterpacks.ui;
+@import android.filterpacks.base;
+@import android.filterpacks.imageproc;
+
+@import com.google.android.filterpacks.facedetect;
+
+@setting autoBranch = "synced";
+
+// Externals -------------------------------------------------
+
+@external textureSourceCallback;
+@external recordingWidth;
+@external recordingHeight;
+@external recordingProfile;
+@external audioSource;
+
+@external previewSurface;
+@external previewWidth;
+@external previewHeight;
+
+// Filters ---------------------------------------------------
+
+// Camera input
+@filter SurfaceTextureSource source {
+ sourceListener = $textureSourceCallback;
+ width = $recordingWidth;
+ height = $recordingHeight;
+ closeOnTimeout = true;
+}
+
+// Face detection
+@filter ToPackedGrayFilter toPackedGray {
+ owidth = 320;
+ oheight = 240;
+}
+
+@filter MultiFaceTrackerFilter faceTracker {
+ numChannelsDetector = 3;
+ quality = 0.0f;
+ smoothness = 0.2f;
+ minEyeDist = 25.0f;
+ rollRange = 45.0f;
+ numSkipFrames = 9;
+ trackingError = 1.0;
+ mouthOnlySmoothing = 0;
+ useAffineCorrection = 1;
+ patchSize = 15;
+}
+
+// Goofyface
+@filter GoofyRenderFilter goofyrenderer {
+ distortionAmount = 1.0;
+}
+
+// Display output
+@filter SurfaceTargetFilter display {
+ surface = $previewSurface;
+ owidth = $previewWidth;
+ oheight = $previewHeight;
+}
+
+// Recording output
+@filter MediaEncoderFilter recorder {
+ audioSource = $audioSource;
+ recordingProfile = $recordingProfile;
+ recording = false;
+ // outputFile, orientationHint, listeners will be set when recording starts
+}
+
+// Connections -----------------------------------------------
+// camera -> faceTracker
+@connect source[video] => toPackedGray[image];
+@connect toPackedGray[image] => faceTracker[image];
+// camera -> goofy
+@connect source[video] => goofyrenderer[image];
+// faceTracker -> goofy
+@connect faceTracker[faces] => goofyrenderer[faces];
+// goofy -> display out
+@connect goofyrenderer[outimage] => display[frame];
+// goofy -> record
+@connect goofyrenderer[outimage] => recorder[videoframe];