diff options
| author | James Dong <jdong@google.com> | 2010-11-04 19:11:27 -0700 |
|---|---|---|
| committer | James Dong <jdong@google.com> | 2010-11-05 15:53:00 -0700 |
| commit | ad8f19c6b3167cadc90a35f4d795b07aa2f04ffa (patch) | |
| tree | b7f7f7f125d1843b8a22040d5c6d13547103720f | |
| parent | ce22d608733953e367a590efd9c7656a68ffc24d (diff) | |
| download | frameworks_base-ad8f19c6b3167cadc90a35f4d795b07aa2f04ffa.zip frameworks_base-ad8f19c6b3167cadc90a35f4d795b07aa2f04ffa.tar.gz frameworks_base-ad8f19c6b3167cadc90a35f4d795b07aa2f04ffa.tar.bz2 | |
Add a new public API to support recording rotated videos
o changed a comment about the rotation orientation from counter-clockwise
to clockwise.
Change-Id: I16ad73ce1a55cc627d9a516e23d1325753b3037e
| -rw-r--r-- | api/current.xml | 13 | ||||
| -rw-r--r-- | media/java/android/media/MediaRecorder.java | 25 |
2 files changed, 38 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml index 833fb6b..ac92b7a 100644 --- a/api/current.xml +++ b/api/current.xml @@ -86967,6 +86967,19 @@ <parameter name="listener" type="android.media.MediaRecorder.OnInfoListener"> </parameter> </method> +<method name="setOrientationHint" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="degrees" type="int"> +</parameter> +</method> <method name="setOutputFile" return="void" abstract="false" diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index b38124e..c102de4 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -285,6 +285,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(). * |
