summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/CameraSource.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-06-08 11:58:53 -0700
committerJames Dong <jdong@google.com>2010-06-08 12:30:58 -0700
commitddcc4a66d848deef6fb4689e64e30cd9bd2684fe (patch)
treee34375b6ca52818e02b45af527e68e4b42c92be1 /media/libstagefright/CameraSource.cpp
parent365a963142093a1cd8efdcea76b5f65096a5b115 (diff)
downloadframeworks_av-ddcc4a66d848deef6fb4689e64e30cd9bd2684fe.zip
frameworks_av-ddcc4a66d848deef6fb4689e64e30cd9bd2684fe.tar.gz
frameworks_av-ddcc4a66d848deef6fb4689e64e30cd9bd2684fe.tar.bz2
Remove some hard-coded encoding parameters
Change-Id: I7a8ccd5d57891a6a585c8da2ee53acb094955913
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rw-r--r--media/libstagefright/CameraSource.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index 416b75c..67759c0 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -128,7 +128,7 @@ CameraSource::CameraSource(const sp<Camera> &camera)
String8 s = mCamera->getParameters();
printf("params: \"%s\"\n", s.string());
- int32_t width, height;
+ int32_t width, height, stride, sliceHeight;
CameraParameters params(s);
params.getPreviewSize(&width, &height);
@@ -136,11 +136,19 @@ CameraSource::CameraSource(const sp<Camera> &camera)
CHECK(colorFormatStr != NULL);
int32_t colorFormat = getColorFormat(colorFormatStr);
+ // XXX: query camera for the stride and slice height
+ // when the capability becomes available.
+ stride = width;
+ sliceHeight = height;
+
mMeta = new MetaData;
mMeta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_RAW);
mMeta->setInt32(kKeyColorFormat, colorFormat);
mMeta->setInt32(kKeyWidth, width);
mMeta->setInt32(kKeyHeight, height);
+ mMeta->setInt32(kKeyStride, stride);
+ mMeta->setInt32(kKeySliceHeight, sliceHeight);
+
}
CameraSource::~CameraSource() {