Added specific resolution and time lapse profiles.

- Added enums QUALITY_{QCIF,480P,720P,1080P}
  QUALITY_TIME_LAPSE_{LOW,HIGH,QCIF,480P,720P,1080P} in CamcorderProfile
  and corresponding ones in MediaProfiles.
- Added functions createDefaultCamcorderTimeLapseLowProfile,
  createDefaultCamcorderTimeLapseHighProfile to set default values.
- Moved javadoc for constants to the get() function.

Change-Id: Ib8b3f8d29395dff77a397d1e6b44cfaf8c481d4d
diff --git a/include/media/MediaProfiles.h b/include/media/MediaProfiles.h
index c3cd361..df64ce8 100644
--- a/include/media/MediaProfiles.h
+++ b/include/media/MediaProfiles.h
@@ -25,7 +25,18 @@
 
 enum camcorder_quality {
     CAMCORDER_QUALITY_LOW  = 0,
-    CAMCORDER_QUALITY_HIGH = 1
+    CAMCORDER_QUALITY_HIGH = 1,
+    CAMCORDER_QUALITY_QCIF = 2,
+    CAMCORDER_QUALITY_480P = 3,
+    CAMCORDER_QUALITY_720P = 4,
+    CAMCORDER_QUALITY_1080P = 5,
+
+    CAMCORDER_QUALITY_TIME_LAPSE_LOW  = 1000,
+    CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001,
+    CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002,
+    CAMCORDER_QUALITY_TIME_LAPSE_480P = 1003,
+    CAMCORDER_QUALITY_TIME_LAPSE_720P = 1004,
+    CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1005
 };
 
 enum video_decoder {
@@ -283,6 +294,8 @@
     static MediaProfiles* createDefaultInstance();
     static CamcorderProfile *createDefaultCamcorderLowProfile();
     static CamcorderProfile *createDefaultCamcorderHighProfile();
+    static CamcorderProfile *createDefaultCamcorderTimeLapseLowProfile();
+    static CamcorderProfile *createDefaultCamcorderTimeLapseHighProfile();
     static void createDefaultCamcorderProfiles(MediaProfiles *profiles);
     static void createDefaultVideoEncoders(MediaProfiles *profiles);
     static void createDefaultAudioEncoders(MediaProfiles *profiles);
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 3869389..37a33ed 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -59,8 +59,19 @@
 };
 
 const MediaProfiles::NameToTagMap MediaProfiles::sCamcorderQualityNameMap[] = {
+    {"low", CAMCORDER_QUALITY_LOW},
     {"high", CAMCORDER_QUALITY_HIGH},
-    {"low",  CAMCORDER_QUALITY_LOW}
+    {"qcif", CAMCORDER_QUALITY_QCIF},
+    {"480p", CAMCORDER_QUALITY_480P},
+    {"720p", CAMCORDER_QUALITY_720P},
+    {"1080p", CAMCORDER_QUALITY_1080P},
+
+    {"timelapselow",  CAMCORDER_QUALITY_TIME_LAPSE_LOW},
+    {"timelapsehigh", CAMCORDER_QUALITY_TIME_LAPSE_HIGH},
+    {"timelapseqcif", CAMCORDER_QUALITY_TIME_LAPSE_QCIF},
+    {"timelapse480p", CAMCORDER_QUALITY_TIME_LAPSE_480P},
+    {"timelapse720p", CAMCORDER_QUALITY_TIME_LAPSE_720P},
+    {"timelapse1080p", CAMCORDER_QUALITY_TIME_LAPSE_1080P}
 };
 
 /*static*/ void
@@ -411,6 +422,40 @@
 }
 
 /*static*/ MediaProfiles::CamcorderProfile*
+MediaProfiles::createDefaultCamcorderTimeLapseHighProfile()
+{
+    MediaProfiles::VideoCodec *videoCodec =
+        new MediaProfiles::VideoCodec(VIDEO_ENCODER_H263, 20000000, 720, 480, 20);
+
+    AudioCodec *audioCodec = new AudioCodec(AUDIO_ENCODER_AMR_NB, 12200, 8000, 1);
+    CamcorderProfile *profile = new MediaProfiles::CamcorderProfile;
+    profile->mCameraId = 0;
+    profile->mFileFormat = OUTPUT_FORMAT_THREE_GPP;
+    profile->mQuality = CAMCORDER_QUALITY_TIME_LAPSE_HIGH;
+    profile->mDuration = 60;
+    profile->mVideoCodec = videoCodec;
+    profile->mAudioCodec = audioCodec;
+    return profile;
+}
+
+/*static*/ MediaProfiles::CamcorderProfile*
+MediaProfiles::createDefaultCamcorderTimeLapseLowProfile()
+{
+    MediaProfiles::VideoCodec *videoCodec =
+        new MediaProfiles::VideoCodec(VIDEO_ENCODER_H263, 1000000, 176, 144, 20);
+
+    AudioCodec *audioCodec = new AudioCodec(AUDIO_ENCODER_AMR_NB, 12200, 8000, 1);
+    CamcorderProfile *profile = new MediaProfiles::CamcorderProfile;
+    profile->mCameraId = 0;
+    profile->mFileFormat = OUTPUT_FORMAT_THREE_GPP;
+    profile->mQuality = CAMCORDER_QUALITY_TIME_LAPSE_LOW;
+    profile->mDuration = 60;
+    profile->mVideoCodec = videoCodec;
+    profile->mAudioCodec = audioCodec;
+    return profile;
+}
+
+/*static*/ MediaProfiles::CamcorderProfile*
 MediaProfiles::createDefaultCamcorderHighProfile()
 {
     MediaProfiles::VideoCodec *videoCodec =
@@ -449,6 +494,8 @@
 /*static*/ void
 MediaProfiles::createDefaultCamcorderProfiles(MediaProfiles *profiles)
 {
+    profiles->mCamcorderProfiles.add(createDefaultCamcorderTimeLapseHighProfile());
+    profiles->mCamcorderProfiles.add(createDefaultCamcorderTimeLapseLowProfile());
     profiles->mCamcorderProfiles.add(createDefaultCamcorderHighProfile());
     profiles->mCamcorderProfiles.add(createDefaultCamcorderLowProfile());
 }