summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2011-09-30 17:52:15 -0700
committerEino-Ville Talvala <etalvala@google.com>2011-10-03 17:49:38 -0700
commitd5ec81fea464e1f9db3cb06f7db3de3cf2e3be94 (patch)
treec74bd71761f0f54251affe1d9cdded2c81a5a089
parentd519d3bff76107eda37dfc81b6d1a7c6e0091e42 (diff)
downloadpackages_apps_LegacyCamera-d5ec81fea464e1f9db3cb06f7db3de3cf2e3be94.zip
packages_apps_LegacyCamera-d5ec81fea464e1f9db3cb06f7db3de3cf2e3be94.tar.gz
packages_apps_LegacyCamera-d5ec81fea464e1f9db3cb06f7db3de3cf2e3be94.tar.bz2
Add support for rotating background video based on device orientation.
Bug: 5355973 Change-Id: I5c0145a717c22b9423341988b90c4962ad333337
-rw-r--r--res/raw/backdropper.graph3
-rw-r--r--res/raw/goofy_face.graph4
-rw-r--r--src/com/android/camera/EffectsRecorder.java3
3 files changed, 9 insertions, 1 deletions
diff --git a/res/raw/backdropper.graph b/res/raw/backdropper.graph
index e3fe877..25c86e6 100644
--- a/res/raw/backdropper.graph
+++ b/res/raw/backdropper.graph
@@ -35,6 +35,8 @@
@external previewWidth;
@external previewHeight;
+@external orientation;
+
@external learningDoneListener;
// Filters ---------------------------------------------------
@@ -52,6 +54,7 @@
sourceUrl = "no_file_specified";
waitForNewFrame = false;
sourceIsUrl = true;
+ orientation = $orientation;
}
// Background replacer
diff --git a/res/raw/goofy_face.graph b/res/raw/goofy_face.graph
index e346322..430c811 100644
--- a/res/raw/goofy_face.graph
+++ b/res/raw/goofy_face.graph
@@ -37,6 +37,10 @@
@external previewWidth;
@external previewHeight;
+// Not used by this graph, but simplifies higher-level
+// graph initialization code.
+@external orientation;
+
// Filters ---------------------------------------------------
// Camera input
diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java
index 301f2a2..f177387 100644
--- a/src/com/android/camera/EffectsRecorder.java
+++ b/src/com/android/camera/EffectsRecorder.java
@@ -300,7 +300,8 @@ public class EffectsRecorder {
mGraphEnv.addReferences(
"previewSurface", mPreviewSurfaceHolder.getSurface(),
"previewWidth", mPreviewWidth,
- "previewHeight", mPreviewHeight);
+ "previewHeight", mPreviewHeight,
+ "orientation", mOrientationHint);
if (mState == STATE_PREVIEW) {
// Switching effects while running. Inform video camera.
sendMessage(mCurrentEffect, EFFECT_MSG_SWITCHING_EFFECT);