2016-03-31 3 views
0

Ich arbeite daran, meinen Java-Dekodierungsprozess in JNI zu verwandeln. Erstens, ich bin den folgenden Quellcode mit dem mediacodec Erstausbildung.NdkMediaCodec gibt ERROR (0x90000012) zurück

AMediaCodec* codec; 
AMediaFormat* format = AMediaFormat_new(); 
AMediaFormat_setInt32(format,AMEDIAFORMAT_KEY_WIDTH,1920); 
AMediaFormat_setInt32(format,AMEDIAFORMAT_KEY_HEIGHT,1080); 
AMediaFormat_setString(format,AMEDIAFORMAT_KEY_MIME,"video/avc"); 

codec = AMediaCodec_createDecoderByType(AVR_MEDIA_MIME_FORMAT); 
AMediaCodec_configure(codec, format, newNativeWindow, NULL, 0); 
AMediaCodec_start(codec); 

und dann mit den Puffer füllen (die Daten in Ordnung in Java)

buffer = AMediaCodec_getOutputBuffer(codec, buffer_index, &buffer_size); 
if(buffer >=0){ 
    memcpy(buffer, background, background_size); 
    AMediaCodec_queueInputBuffer(codec,buffer_index, 0, background_size, 0, 0); 
} 

aber es funktioniert nicht Arbeit. das Protokoll ist:

I/ACodec(19130): [] Now uninitialized 
I/OMXClient(19130): Using client-side OMX mux. 
I/ACodec(19130): can't find wfdsink-exynos-enable 
I/ACodec(19130): [OMX.Exynos.avc.dec] configureOutputBuffersFromNativeWindow setBufferCount : 6, minUndequeuedBuffers : 4 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xed110060 (pointer = 0xf49e5000) 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xed110510 (pointer = 0xf49e5020) 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xecf06970 (pointer = 0xf49e5040) 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xed406290 (pointer = 0xf49e5060) 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xed1106f0 (pointer = 0xf49e5080) 
I/ACodec(19130): [OMX.Exynos.avc.dec] allocated meta buffer with ID 0xed406100 (pointer = 0xf49e50a0) 
I/ACodec(19130): [OMX.Exynos.avc.dec] Now Executing 
I/Timeline(19130): Timeline: Activity_idle id: [email protected] time:6236268 
E/ACodec(19130): [OMX.Exynos.avc.dec] ERROR(0x90000012) 
E/ACodec(19130): signalError(omxError 0x90000012, internalError -2147483648) 
E/MediaCodec(19130): Codec reported err 0x90000012, actionCode 0, while in state 6 
E/NdkMediaCodec(19130): sf error code: -38 
E/NdkMediaCodec(19130): sf error code: -38 
E/NdkMediaCodec(19130): sf error code: -38 

Antwort

0

gibt es zwei mögliche Probleme in Ihrem Code:

  1. die Bedingung "if (Puffer> = 0)" ist nicht richtig, sein "wenn (Puffer)"
  2. sicher sein background_size < = puffergröße