【问题标题】:m3u8 file not playing in Android Emulatorm3u8 文件无法在 Android 模拟器中播放
【发布时间】:2013-03-23 13:27:48
【问题描述】:

我正在尝试在 Android 模拟器中播放 m3u8 文件。 http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8

无法播放视频,但可以听到音频。
我收到以下错误E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed

我跟踪了调用,发现视频解码器未正确实例化,
我发现 OMXNodeInstance::enableGraphicBuffers 正在被调用并且调用,
OMX_ERRORTYPE err = OMX_GetExtensionIndex(...,const_cast<OMX_STRING>("OMX.google.android.index.enableAndroidNativeBuffers"),...);
然后调用OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex,
但是这个功能没有实现。
它只是返回 UndefinedError(下面的代码)

OMX_ERRORTYPE SoftOMXComponent::getExtensionIndex(const char *name, OMX_INDEXTYPE *index)
{
return OMX_ErrorUndefined;
}

谁能帮我克服这个 GetExtentionIndex 失败。 在下方记录

/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

【问题讨论】:

    标签: android android-emulator android-mediaplayer android-source


    【解决方案1】:

    尝试在真实设备中运行它,因为我知道带有一些特定 sdk(如 3.1)的模拟器在播放 m3u8 文件时会崩溃。如果没有解决问题,也许你可以使用一些 3rd paty 插件,比如 Vitamio http://vitamio.org/

    【讨论】:

      【解决方案2】:

      这是一个非常有趣的问题。从你的日志中,我想引用这部分

      E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
      V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
      

      这 2 条错误消息是在 ACodecinitNativeWindow 调用期间收到的,这是它从 LOADED 转换到 IDLE 状态的一部分。从OMX 的角度来看,作为LOADED to IDLE 转换的一部分,ACodec::LoadedState::onConfigureComponent 被调用。作为该函数的一部分,initNativeWindow 被调用。

      initNativeWindow 中,有两个不同的条件。第一种情况是用户向编解码器提供了nativeWindow 或更确切地说是SurfaceSurfaceTexture 以将其输出写入。另一种情况是用户没有向MediaPlayer 引擎提供Surface

      V/ACodec ( 39): onStart
      V/ACodec ( 39): [OMX.google.h264.decoder] Now Loaded->Idle
      

      从这些日志中,可以观察到initNativeWindow 的返回码是正常的,这只有在控制分支到mNativeNativeWindow 为NULL 的情况下才可能 观察到here . false 情况的返回码没有被ACodec 捕获,这意味着组件成功转换到IDLE 状态。

      简而言之,该问题主要是由于Surface 未提供给MediaPlayer 而引起的。

      一些建议:

      由于您使用的是NuPlayer,我建议您检查是否调用了NuPlayer::setVideoSurfaceTexture,以及是否将non-NULL 对象从NuPlayer 传递到下游组件。

      MediaPlayer 的角度来看,您应该将表面设置为setSurface 调用的一部分。

      一般情况下,您需要为视频解码器链提供sink

      【讨论】:

        【解决方案3】:
        E/OMXNodeInstance( 39): OMX_GetExtensionIndex failed
        V/OMXNodeInstance( 39): enableGraphicBuffers at 301 OMX_GetExtensionIndex returned 2147487745
        

        OMX_GetExtensionIndex 的调用进入 SoftOMXComponent(here),它只是一个存根函数,总是返回 OMX_ErrorUndefined 导致 enableGraphicBuffers 失败强>

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-10-22
          • 2015-10-03
          • 2013-02-06
          • 2013-05-13
          • 1970-01-01
          • 2023-03-17
          相关资源
          最近更新 更多