Tuesday, April 9, 2013

[android-developers] Re: MediaRecorder prepare() causes segfault

where is your mediarecorder.setOutputFile(); method

On Monday, March 29, 2010 2:54:28 AM UTC+5:30, dwilde1 wrote:
Folks,

I have a situation where my MediaRecorder instance causes a segfault.
I'm working with a HTC Hero, Android 1.5+APIs. In the log i see (after
the segfault announcement) a register dump and then a numbered list
#00 libmedia_jni.so to  #18 linker, then a stack trace.

My Eclipse won't let me copy the log buffer, but I've done three
screen captures that sum it up. If you have time to examine, send me a
direct e-mail.

<pre><code>
    if (mRecorder == null) mRecorder = new MediaRecorder();
    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
//         mRecorder.setVideoSize(640, 480);
//         mRecorder.setVideoFrameRate(20);
    mRecorder.setPreviewDisplay(surfaceHolder.getSurface());
    mRecorder.prepare();
    mRecorder.start();
</code></pre>

I've tried other variants, including H263 and 3gp. What else can I do
to debug this? Everythin g seems fine up to prepare().

I tried adding the onErrorListener, but it seems to interfere with the
MediaPlayer's onErrorListener. I'm using a 4-second beep-count to
prepare for auto triggering of the camera, and when I enable the error
handler for the MR everything in my handler state machines goes awry.

Thanks in advance! :D

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment