summaryrefslogtreecommitdiffstats
path: root/media/libmedia/MediaProfiles.cpp
diff options
context:
space:
mode:
authorNipun Kwatra <nkwatra@google.com>2010-09-09 16:25:08 -0700
committerNipun Kwatra <nkwatra@google.com>2010-09-10 14:22:11 -0700
commit8bb5603cc735315c8691dc9b7a81b4ad4d6e253e (patch)
treee1b026cd15a4bf8cba990adee7c12969a4e55bd6 /media/libmedia/MediaProfiles.cpp
parentc0a84782589eececdfa7e723e8aa0e572d0d79f5 (diff)
downloadframeworks_av-8bb5603cc735315c8691dc9b7a81b4ad4d6e253e.zip
frameworks_av-8bb5603cc735315c8691dc9b7a81b4ad4d6e253e.tar.gz
frameworks_av-8bb5603cc735315c8691dc9b7a81b4ad4d6e253e.tar.bz2
Adding hasProfile.
- Added hasProfile to CamcorderProfile and JNI. - Added hasCamcorderProfile to MediaProfiles. - using android.hardware.Camera.CAMERA_ID_DEFAULT for default camera in get(). Change-Id: Ib57bb49ae79492d7cbc0ec6c7b6efcbf74f80013
Diffstat (limited to 'media/libmedia/MediaProfiles.cpp')
-rw-r--r--media/libmedia/MediaProfiles.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 37a33ed..81647e0 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -715,13 +715,8 @@ Vector<audio_decoder> MediaProfiles::getAudioDecoders() const
return decoders; // copy out
}
-int MediaProfiles::getCamcorderProfileParamByName(const char *name,
- int cameraId,
- camcorder_quality quality) const
+int MediaProfiles::getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const
{
- LOGV("getCamcorderProfileParamByName: %s for camera %d, quality %d",
- name, cameraId, quality);
-
int index = -1;
for (size_t i = 0, n = mCamcorderProfiles.size(); i < n; ++i) {
if (mCamcorderProfiles[i]->mCameraId == cameraId &&
@@ -730,6 +725,17 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name,
break;
}
}
+ return index;
+}
+
+int MediaProfiles::getCamcorderProfileParamByName(const char *name,
+ int cameraId,
+ camcorder_quality quality) const
+{
+ LOGV("getCamcorderProfileParamByName: %s for camera %d, quality %d",
+ name, cameraId, quality);
+
+ int index = getCamcorderProfileIndex(cameraId, quality);
if (index == -1) {
LOGE("The given camcorder profile camera %d quality %d is not found",
cameraId, quality);
@@ -752,6 +758,11 @@ int MediaProfiles::getCamcorderProfileParamByName(const char *name,
return -1;
}
+bool MediaProfiles::hasCamcorderProfile(int cameraId, camcorder_quality quality) const
+{
+ return (getCamcorderProfileIndex(cameraId, quality) != -1);
+}
+
Vector<int> MediaProfiles::getImageEncodingQualityLevels(int cameraId) const
{
Vector<int> result;