diff options
author | James Dong <jdong@google.com> | 2010-02-25 15:11:29 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-25 15:11:29 -0800 |
commit | b93003649d0d58e6824b54d6e9e1386912c34448 (patch) | |
tree | 9a23e503e60dcfa756211dda05461c53109a2d40 /media/java/android | |
parent | a4b1fe6b2651ab8f77d5a3ce1a607945f6427b02 (diff) | |
parent | 9b433f0b654d32530b0b48a7a653216ae0bb94d8 (diff) | |
download | frameworks_base-b93003649d0d58e6824b54d6e9e1386912c34448.zip frameworks_base-b93003649d0d58e6824b54d6e9e1386912c34448.tar.gz frameworks_base-b93003649d0d58e6824b54d6e9e1386912c34448.tar.bz2 |
Merge "Image encoding settings java API through xml configuration file"
Diffstat (limited to 'media/java/android')
-rw-r--r-- | media/java/android/media/CamcorderProfile.java | 13 | ||||
-rw-r--r-- | media/java/android/media/CameraProfile.java | 52 |
2 files changed, 64 insertions, 1 deletions
diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java index ce56443..eade680 100644 --- a/media/java/android/media/CamcorderProfile.java +++ b/media/java/android/media/CamcorderProfile.java @@ -38,6 +38,7 @@ package android.media; */ public class CamcorderProfile { + private final int mDuration; // Recording duration in seconds /** * The Quality class represents the quality level of each CamcorderProfile. @@ -56,6 +57,14 @@ public class CamcorderProfile }; /** + * Returns the recording duration in seconds for LOW quality CamcorderProfile + * used by the MMS application. + */ + public static final int getMmsRecordingDurationInSeconds() { + return get(Quality.LOW).mDuration; + } + + /** * The quality level of the camcorder profile * @see android.media.CamcorderProfile.Quality */ @@ -129,7 +138,8 @@ public class CamcorderProfile } // Private constructor called by JNI - private CamcorderProfile(int quality, + private CamcorderProfile(int duration, + int quality, int fileFormat, int videoCodec, int videoBitRate, @@ -141,6 +151,7 @@ public class CamcorderProfile int audioSampleRate, int audioChannels) { + mDuration = duration; mQuality = Quality.values()[quality]; mFileFormat = fileFormat; mVideoCodec = videoCodec; diff --git a/media/java/android/media/CameraProfile.java b/media/java/android/media/CameraProfile.java new file mode 100644 index 0000000..9685e7e --- /dev/null +++ b/media/java/android/media/CameraProfile.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 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. + */ + +package android.media; + +/** + * The CameraProfile class is used to retrieve the pre-defined still image + * capture (jpeg) quality levels (0-100) used for low, medium, and high + * quality settings in the Camera application. + * + * {@hide} + */ +public class CameraProfile +{ + /** + * Returns a list of the pre-defined still image capture (jpeg) quality levels + * used for low, medium and high quality settings in the Camera application. + */ + public static int[] getImageEncodingQualityLevels() { + int nLevels = native_get_num_image_encoding_quality_levels(); + if (nLevels == 0) return null; + + int[] levels = new int[nLevels]; + for (int i = 0; i < nLevels; ++i) { + levels[i] = native_get_image_encoding_quality_level(i); + } + return levels; + } + + static { + System.loadLibrary("media_jni"); + native_init(); + } + + // Methods implemented by JNI + private static native final void native_init(); + private static native final int native_get_num_image_encoding_quality_levels(); + private static native final int native_get_image_encoding_quality_level(int index); +} |