summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-23 17:21:44 -0800
committerJames Dong <jdong@google.com>2010-02-24 18:10:12 -0800
commit9b433f0b654d32530b0b48a7a653216ae0bb94d8 (patch)
tree164555367b9006e2212e0b63f608fc228b711417 /media/libmedia
parent9a56aaf12b462a064e81e02386eca8a1e77fe737 (diff)
downloadframeworks_base-9b433f0b654d32530b0b48a7a653216ae0bb94d8.zip
frameworks_base-9b433f0b654d32530b0b48a7a653216ae0bb94d8.tar.gz
frameworks_base-9b433f0b654d32530b0b48a7a653216ae0bb94d8.tar.bz2
Image encoding settings java API through xml configuration file
- I decided to completely remove jpeg decoding related stuff from this change I think that setting is better off if it is specified by the system properties. We don't have to include MediaProfiles.h header in skia files
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/MediaProfiles.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 0efade1..1263373 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -293,6 +293,13 @@ MediaProfiles::createCamcorderProfile(const char **atts)
return profile;
}
+/*static*/ int
+MediaProfiles::getImageEncodingQualityLevel(const char** atts)
+{
+ CHECK(!strcmp("quality", atts[0]));
+ return atoi(atts[1]);
+}
+
/*static*/ void
MediaProfiles::startElementHandler(void *userData, const char *name, const char **atts)
{
@@ -317,6 +324,8 @@ MediaProfiles::startElementHandler(void *userData, const char *name, const char
profiles->mEncoderOutputFileFormats.add(createEncoderOutputFileFormat(atts));
} else if (strcmp("EncoderProfile", name) == 0) {
profiles->mCamcorderProfiles.add(createCamcorderProfile(atts));
+ } else if (strcmp("ImageEncoding", name) == 0) {
+ profiles->mImageEncodingQualityLevels.add(getImageEncodingQualityLevel(atts));
}
}
@@ -446,6 +455,14 @@ MediaProfiles::createDefaultAmrNBEncoderCap()
AUDIO_ENCODER_AMR_NB, 5525, 12200, 8000, 8000, 1, 1);
}
+/*static*/ void
+MediaProfiles::createDefaultImageEncodingQualityLevels(MediaProfiles *profiles)
+{
+ profiles->mImageEncodingQualityLevels.add(70);
+ profiles->mImageEncodingQualityLevels.add(80);
+ profiles->mImageEncodingQualityLevels.add(90);
+}
+
/*static*/ MediaProfiles*
MediaProfiles::createDefaultInstance()
{
@@ -456,6 +473,7 @@ MediaProfiles::createDefaultInstance()
createDefaultVideoDecoders(profiles);
createDefaultAudioDecoders(profiles);
createDefaultEncoderOutputFileFormats(profiles);
+ createDefaultImageEncodingQualityLevels(profiles);
sIsInitialized = true;
return profiles;
}
@@ -627,6 +645,7 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name, camcorder_qu
return -1;
}
+ if (!strcmp("duration", name)) return mCamcorderProfiles[index]->mDuration;
if (!strcmp("file.format", name)) return mCamcorderProfiles[index]->mFileFormat;
if (!strcmp("vid.codec", name)) return mCamcorderProfiles[index]->mVideoCodec->mCodec;
if (!strcmp("vid.width", name)) return mCamcorderProfiles[index]->mVideoCodec->mFrameWidth;
@@ -642,6 +661,11 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name, camcorder_qu
return -1;
}
+Vector<int> MediaProfiles::getImageEncodingQualityLevels() const
+{
+ return mImageEncodingQualityLevels; // copy out
+}
+
MediaProfiles::~MediaProfiles()
{
CHECK("destructor should never be called" == 0);