summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-11-06 16:25:39 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-11-06 16:25:39 -0700
commit08caf9e84f730837999e26753cb87f2aea0500c5 (patch)
treeba54603cbbe573a474a1f1868d79cd4a4c7de26f /media
parent76b970cb93e93a4e23cb1bf2f21260ae6a65cdf4 (diff)
parentbb97d7bbf33393af842de1d8fd8512a24c73b6b3 (diff)
downloadframeworks_base-08caf9e84f730837999e26753cb87f2aea0500c5.zip
frameworks_base-08caf9e84f730837999e26753cb87f2aea0500c5.tar.gz
frameworks_base-08caf9e84f730837999e26753cb87f2aea0500c5.tar.bz2
am bb97d7bb: am 0467b0ab: Merge "Add a new public API to support recording rotated videos" into gingerbread
* commit 'bb97d7bbf33393af842de1d8fd8512a24c73b6b3': Add a new public API to support recording rotated videos
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaRecorder.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index fcf6510..866c853 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -314,6 +314,31 @@ public class MediaRecorder
}
/**
+ * Sets the orientation hint for output video playback.
+ * This method should be called before start(). This method will not
+ * trigger the source video frame to rotate during video recording, but to
+ * add a composition matrix containing the rotation angle in the output
+ * video if the output format is OutputFormat.THREE_GPP or
+ * OutputFormat.MPEG_4 so that a video player can choose the proper
+ * orientation for playback. Note that some video players may choose
+ * to ignore the compostion matrix in a video during playback.
+ *
+ * @param degrees the angle to be rotated clockwise in degrees.
+ * The supported angles are 0, 90, 180, and 270 degrees.
+ * @throws IllegalArgumentException if the angle is not supported.
+ *
+ */
+ public void setOrientationHint(int degrees) {
+ if (degrees != 0 &&
+ degrees != 90 &&
+ degrees != 180 &&
+ degrees != 270) {
+ throw new IllegalArgumentException("Unsupported angle: " + degrees);
+ }
+ setParameter(String.format("video-param-rotation-angle-degrees=%d", degrees));
+ }
+
+ /**
* Sets the format of the output file produced during recording. Call this
* after setAudioSource()/setVideoSource() but before prepare().
*