Hi folks,

I am facing the same error when I am trying to do an audio encode from WAV 
to AMR on android emulator

Here is my code.
        MediaCodec codec = MediaCodec.createEncoderByType("audio/3gpp");
    MediaFormat toFormat = MediaFormat.createAudioFormat("audio/3gpp", 
8000, 1);
    codec.configure(toFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);

And I get the following errors. First of all it seems it can't open the 
libwvm.so file which seems suspicious.
Next it fails at the MediaCodec.configure functions.

10-31 11:20:30.333: E/WVMExtractor(18234): Failed to open libwvm.so
10-31 11:20:30.343: I/OMXClient(18234): Using client-side OMX mux.
10-31 11:20:30.363: E/ACodec(18234): [OMX.google.amrnb.encoder] 
configureCodec returning error -38
10-31 11:20:30.363: E/MediaCodec(18234): Codec reported an error. (omx 
error 0x80001001, internalError -38)
10-31 11:20:30.363: W/System.err(18234): java.lang.IllegalStateException
10-31 11:20:30.383: W/System.err(18234): at 
android.media.MediaCodec.native_configure(Native Method)
10-31 11:20:30.383: W/System.err(18234): at 
android.media.MediaCodec.configure(MediaCodec.java:257)

If anyone has got past it, please reply.

Thanks
Shakti
352 222 6866

On Monday, September 17, 2012 8:07:29 PM UTC-7, David Hagege wrote:
>
> Hi,
>
> I have a strange issue regarding the new MediaCodec API on Jellybean.
> The native function android.media.MediaCodec.native_configure is throwing 
> a java.lang.IllegalStateException.
> I'm using the OMX.TI.DUCATI1.VIDEO.H264E codec on a Galaxy Nexus (maguro).
>
> Here is my Scala code:
>
>
> class ScreenshotView(context: Context, attr: AttributeSet, style: Int)
>> extends SurfaceView(context, attr, style) with SurfaceHolder.Callback {
>> private def startEncoder = {
>> var surface = getHolder.getSurface
>> var codec: MediaCodec = MediaCodec.createEncoderByType("video/avc")
>>         codec.configure(MediaFormat.createVideoFormat("video/avc",
>>           getWidth, getHeight), surface, null, 
>> MediaCodec.CONFIGURE_FLAG_ENCODE)
>>     }
>> }
>
>  
>
>
>
> When calling the startEncoder method, the codec.configure() fails.
> Here is what I can see in the logcat:
>
> I/OMXClient( 1193): Using client-side OMX mux.
>> E/OHELP   ( 1193): CODEC:android.media.MediaCodec@42124b70
>> E/OHELP   ( 1193): MediaFormat:{height=1038, width=720, mime=video/avc}
>> E/ACodec  ( 1193): [OMX.TI.DUCATI1.VIDEO.H264E] configureCodec returning 
>> error -38
>> E/MediaCodec( 1193): Codec reported an error. (omx error 0x80001001, 
>> internalError -38)
>> D/AndroidRuntime( 1193): Shutting down VM
>> W/dalvikvm( 1193): threadid=1: thread exiting with uncaught exception 
>> (group=0x41bf3300)
>> E/AndroidRuntime( 1193): FATAL EXCEPTION: main
>> E/AndroidRuntime( 1193): java.lang.IllegalStateException
>> E/AndroidRuntime( 1193):        at 
>> android.media.MediaCodec.native_configure(Native Method)
>> E/AndroidRuntime( 1193):        at 
>> android.media.MediaCodec.configure(MediaCodec.java:257)
>
>
> If I'm looking at the JNI, here is where the exception is thrown 
> (frameworks/base/media/jni/android_media_MediaCodec.cpp:338):
>
>
> static jint throwExceptionAsNecessary(
>         JNIEnv *env, status_t err, const char *msg = NULL) {
>     if (err >= ERROR_DRM_WV_VENDOR_MIN && err <= ERROR_DRM_WV_VENDOR_MAX) {
>         // We'll throw our custom MediaCodec.CryptoException
>         throwCryptoException(env, err, msg);
>         return 0;
>     }
>     switch (err) {
>         case OK:
>             return 0;
>         case -EAGAIN:
>             return DEQUEUE_INFO_TRY_AGAIN_LATER;
>         case INFO_FORMAT_CHANGED:
>             return DEQUEUE_INFO_OUTPUT_FORMAT_CHANGED;
>         case INFO_OUTPUT_BUFFERS_CHANGED:
>             return DEQUEUE_INFO_OUTPUT_BUFFERS_CHANGED;
>         default:
>         {
>             jniThrowException(env, "java/lang/IllegalStateException", 
> NULL);   /// I'm getting there                                     
>             break;
>         }
>     }
>     return 0;
> }
>
>
> This call is made in the last line of 
> android_media_MediaCodec_native_configure() (line 389):
>
>     err = codec->configure(format, surfaceTexture, crypto, flags);
>>     throwExceptionAsNecessary(env, err);                                 
>>                                            
>
>
>
> Is there anything I'm doing wrong?
> My surface is valid (isValid() is returning true). Everything passed to 
> codec->configure() in the JNI seems to be ok too.
> Any clues?
>
> Thanks,
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to