问题
I am trying to playback a m3u8 file in Android Emulator.
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
It's not able to playback the video but audio is heard.
I get the following error E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
.
I traced the calls and I see that the video decoder is not instantiated properly,
I find that OMXNodeInstance::enableGraphicBuffers
is getting called and that calls,OMX_ERRORTYPE err = OMX_GetExtensionIndex(...,const_cast<OMX_STRING>("OMX.google.android.index.enableAndroidNativeBuffers"),...);
which is then calling OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex
,
but there is no implementation for this function.
It just returns UndefinedError (code below)
OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex(const char *name, OMX_INDEXTYPE *index)
{
return OMX_ErrorUndefined;
}
Can somebody please help me to overcome this GetExtentionIndex failure. Log Below
/ChromiumHTTPDataSource( 39): connect to http://devimages.apple.com/iphone/samples/bipbop/gear4/prog_index.m3u8 @0
V/NuPlayer( 39): scanning sources haveAudio=0, haveVideo=0
V/NuPlayer( 39): in instantiateDecoder at 693 audio = 0
V/NuPlayer( 39): in instantiateDecoder at 693 audio = 1
I/ESQueue ( 39): found AAC codec config (22050 Hz, 1 channels)
I/avc_utils( 39): found AVC codec config (192 x 144, Baseline-profile level 1.1)
V/MediaPlayer( 583): in getCurrentPosition at : 425
V/MediaPlayerService( 39): getCurrentPosition
V/MediaPlayerService( 39): [1] getCurrentPosition = 0
V/NuPlayer( 39): scanning sources haveAudio=0, haveVideo=0
V/NuPlayer( 39): in instantiateDecoder at 701 mime = video/avc
V/ACodec ( 39): Now uninitialized
V/ACodec ( 39): Now uninitialized
V/ACodec ( 39): onAllocateComponent
I/MediaPlayerService( 39): MediaPlayerService::getOMX()
V/SoftOMXPlugin( 39): makeComponentInstance 'OMX.google.h264.decoder'
V/SoftOMXPlugin( 39): makeComponentInstance at 106
V/ACodec ( 39): onAllocateComponent
I/MediaPlayerService( 39): MediaPlayerService::getOMX()
V/SoftOMXPlugin( 39): makeComponentInstance at 128
V/SoftOMXPlugin( 39): makeComponentInstance 'OMX.google.aac.decoder'
V/SoftOMXPlugin( 39): makeComponentInstance at 106
V/SoftOMXPlugin( 39): makeComponentInstance at 128
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded
V/ACodec ( 39): onConfigureComponent
V/ACodec ( 39): configureCodec at 870
V/ACodec ( 39): setupVideoDecoder at 1400
V/ACodec ( 39): setupVideoDecoder at 1402 mime = video/avc
V/ACodec ( 39): setupVideoDecoder at 1406
V/ACodec ( 39): setupVideoDecoder at 1414
V/ACodec ( 39): setupVideoDecoder at 1421
V/ACodec ( 39): setupVideoDecoder at 1429
V/ACodec ( 39): setupVideoDecoder at 1437
V/ACodec ( 39): initNativeWindow at 1962
V/ACodec ( 39): initNativeWindow at 1967
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
V/ACodec ( 39): onStart
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded->Idle
回答1:
Try to run it in real device, as I know emulators with some specific sdk's(like 3.1) crash playing m3u8 file. And if didn't resolve the issue maybe you can use some 3rd paty plugins like Vitamio http://vitamio.org/
回答2:
This is a very interesting question. From your logs, I would like to quote this portion
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
These 2 error messages are received during initNativeWindow
call of the ACodec
as part of it's transition from LOADED
to IDLE
state. From an OMX
perspective, as part of the LOADED to IDLE
transition, ACodec::LoadedState::onConfigureComponent is invoked. As part of this function, initNativeWindow is invoked.
In initNativeWindow, there are two distinct conditions. The first case is when the user has provided a nativeWindow
or rather a Surface
or SurfaceTexture
to the codec to write it's output into. The other case is when the user hasn't provided a Surface
to the MediaPlayer
engine.
V/ACodec ( 39): onStart
V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded->Idle
From these logs, it can be observed that the return code of initNativeWindow
is ok which is only possible if the control branched to the case where mNativeNativeWindow
is NULL as observed here. The return code for the false
case is not caught by the ACodec
which means that the component transitioned to IDLE
state successfully.
In a nutshell, the issue is mainly arising due to a Surface
not being provided to the MediaPlayer
.
Some Suggestions:
Since you are employing NuPlayer
, I would recommend you to check if NuPlayer::setVideoSurfaceTexture is called and whether a non-NULL
object is passed from NuPlayer
to downstream components.
From a MediaPlayer
perspective, you should set a surface as part of the setSurface
call.
In general, you need to provide a sink
for the video decoder chain.
回答3:
E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
the call to OMX_GetExtensionIndex lands into SoftOMXComponent(here) which is just a stubbed function and always returns OMX_ErrorUndefined which leads to failing of enableGraphicBuffers
来源:https://stackoverflow.com/questions/15760953/m3u8-file-not-playing-in-android-emulator