fail to prepare with MediaRecorder

by awwa » Thu, 30 Sep 2010 15:09:52 GMT


Sponsored Links
 ello,

I have a problem with MediaRecorder. I want to record video. But fail
to prepare the MediaRecorder.
Here is the logs and source code. Is there anything wrong?

In the logs, [Failed to get camera(0x32e58) parameters].
I think that this is due to.
Why failed to get camera parameters?
Also, what should I do?

- Environment
-- Dev phone 1
-- OS 1.6

Thank you.

---- source code ----
private boolean initializeRecorder() {
Log.i(TAG, "initializeRecorder");
try {
releaseMediaRecorder();
mRecorder = new MediaRecorder();
mRecorder.setCamera(mCameraDevice);
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setMaxDuration(30000);
mRecorder.setOutputFile("/sdcard/sample.3gp");
mRecorder.setVideoFrameRate(10);
mRecorder.setVideoSize(176, 144);
mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
mRecorder.setMaxFileSize(50000000);
mRecorder.prepare(); // <-
occur exception
Log.i(TAG, "initializeRecorder prepared"); // <- not called
return true;
} catch (IllegalStateException e) {
releaseMediaRecorder();
e.printStackTrace();
} catch (IOException e) {
releaseMediaRecorder();
e.printStackTrace();
}
return false;
}
--------

---- logs ----

I/ActivityManager(72): Starting activity: Intent
{ cmp=com.wataru.test15/.RecordVideoActivity }
D/test15(1698): test15 onPause()
I/RecordVideoActivity(1698): startPreview
D/CameraService(51): CameraService::connect E (pid 1698, client
0x1c3f8)
D/CameraService(51): Client::Client E (pid 1698)
D/QualcommCameraHardware(51): createInstance: E
D/QualcommCameraHardware(51): createInstance: X created
hardware=0x20068
D/CameraService(51): Client::Client X (pid 1698)
D/CameraService(51): CameraService::connect X
D/CameraService(51): getParameters(antibanding=off;antibanding-
values=off;effect=none;effect-
values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua;jpeg-
quality=100;jpeg-thumbnail-height=384;jpeg-thumbnail-quality=90;jpeg-
thumbnail-width=512;picture-format=jpeg;picture-size=2048x1536;picture-
size-values=2048x1536,1600x1200,1024x768;preview-
format=yuv420sp;preview-frame-rate=15;preview-
size=480x320;whitebalance=auto;whitebalance-
values=auto,incandescent,florescent,daylight,cloudy,twilight,shade)
D/CameraService(51): setParameters(jpeg-thumbnail-
width=512;antibanding-values=off;preview-frame-rate=15;preview-
size=176x144;picture-format=jpeg;antibanding=off;jpeg-thumbnail-
height=384;picture-size=2048x1536;effect=none;whitebalance=auto;jpeg-
thumbnail-quality=90;jpeg-quality=100;whitebalance-
values=auto,incandescent,florescent,daylight,cloudy,twilight,shade;preview-
format=yuv420sp;effect-
values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua;picture-
size-values=2048x1536,1600x1200,1024x768)
D/Camera(1698): app passed NULL surface
D/CameraService(51): setPreviewDisplay(0x0) (pid 1698)
D/CameraService(51): startPreview (pid 1698)
D/CameraServic



Other Threads

1. Testing bluetooth on android dev phone 1

Android 2.0 has not been released for the dev phone 1 and so I was
wondering if it is possible to test applications that require
bluetooth in any other way. You can't test it on the emulator as well.
Any suggestions?

-- 

2. Important Undocumented styles

An important part of creating an android application is making the gui
look right. However where do I find documentation for this. An example
of what I am looking for is something like this

style="@android:style/ButtonBar"

what other interesting styles does exist. The eclipse layout xml
editor knows about some of the @android:style/'s but not this one.
Where is all this documented?

-- 

3. AppShare

4. searching doc about com.google.android.com

5. Milestone Nandroid Backup.

6. OOT WTB ipodtouch

7. mirink at pim