summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2011-08-16 16:14:05 +0300
committerIliyan Malchev <malchev@google.com>2011-08-16 17:27:13 -0700
commit8dc6e2e3019301a256d3025ecaf266d7a0979871 (patch)
treeecec263cee64d61f7efb5d74f8f9542984706d5a /test
parent95ad4f3815f0eabf70707bcf65b52eb8195accc0 (diff)
downloadhardware_ti_omap4xxx-8dc6e2e3019301a256d3025ecaf266d7a0979871.zip
hardware_ti_omap4xxx-8dc6e2e3019301a256d3025ecaf266d7a0979871.tar.gz
hardware_ti_omap4xxx-8dc6e2e3019301a256d3025ecaf266d7a0979871.tar.bz2
Camera_test: Removes the SurfaceFlinger WA
- Not needed any more. - Adds support for disabling audio during video record. Change-Id: I2eeec1e9cdae0c18fbd72561fe923d998565572a Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
Diffstat (limited to 'test')
-rw-r--r--test/CameraHal/camera_test_menu.cpp47
1 files changed, 12 insertions, 35 deletions
diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp
index 87c2d91..4680229 100644
--- a/test/CameraHal/camera_test_menu.cpp
+++ b/test/CameraHal/camera_test_menu.cpp
@@ -294,7 +294,8 @@ audio_Codecs audioCodecs[] = {
{ AUDIO_ENCODER_AMR_WB, "AMR_WB" },
{ AUDIO_ENCODER_AAC, "AAC" },
{ AUDIO_ENCODER_AAC_PLUS, "AAC+" },
- { AUDIO_ENCODER_EAAC_PLUS, "EAAC+" }
+ { AUDIO_ENCODER_EAAC_PLUS, "EAAC+" },
+ { AUDIO_ENCODER_LIST_END, "disabled"},
};
size_t length_audio_Codecs = ARRAY_SIZE(audioCodecs);
@@ -892,10 +893,12 @@ int configureRecorder() {
}
- if ( recorder->setAudioSource(AUDIO_SOURCE_MIC) < 0 ) {
- printf("error while configuring camera audio source\n");
+ if ( AUDIO_ENCODER_LIST_END != audioCodecs[audioCodecIDX].type ) {
+ if ( recorder->setAudioSource(AUDIO_SOURCE_DEFAULT) < 0 ) {
+ printf("error while configuring camera audio source\n");
- return -1;
+ return -1;
+ }
}
if ( recorder->setOutputFormat(outputFormat[outputFormatIDX].type) < 0 ) {
@@ -949,10 +952,12 @@ int configureRecorder() {
return -1;
}
- if ( recorder->setAudioEncoder(audioCodecs[audioCodecIDX].type) < 0 ) {
- printf("error while configuring audio codec\n");
+ if ( AUDIO_ENCODER_LIST_END != audioCodecs[audioCodecIDX].type ) {
+ if ( recorder->setAudioEncoder(audioCodecs[audioCodecIDX].type) < 0 ) {
+ printf("error while configuring audio codec\n");
- return -1;
+ return -1;
+ }
}
if ( recorder->setPreviewSurface( surfaceControl->getSurface() ) < 0 ) {
@@ -1049,33 +1054,6 @@ int closeCamera() {
return 0;
}
-//Workaround for an issue seen with ICS SurfaceFlinger.
-//The last surface created is not getting rendered on screen,
-//in our case this is the preview surface. Here we artificially wait
-//for the preview to start and create a new temporary surface, which
-//gets destroyed immediately.
-int surfaceWorkaround(unsigned int width, unsigned int height, int32_t pixFormat) {
- sleep(1);
-
- if ( NULL == client.get() ) {
- return NO_INIT;
- }
-
- sp<SurfaceControl> tmpSurface = client->createSurface(0,
- width,
- height,
- pixFormat);
-
- if ( NULL != tmpSurface.get() ) {
- tmpSurface->clear();
- tmpSurface.clear();
- } else {
- return -ENOMEM;
- }
-
- return NO_ERROR;
-}
-
int startPreview() {
int previewWidth, previewHeight;
if (reSizePreview) {
@@ -1114,7 +1092,6 @@ int startPreview() {
previewRunning = true;
reSizePreview = false;
- surfaceWorkaround( previewWidth, previewHeight, pixelformat[previewFormat].pixelFormatDesc);
}
return 0;