Hi Martin,
I have an issue with a device where JB (4.2.1) has been ported to (project details at:
http://groups.google.com/group/renesas-emev-osp/topics) for the playback of m3u8 URLs:
V/MediaPlayerJNI( 1064): setDataSource: path http://rai-i.akamaihd.net/i/20140610/tg1notte-100620141.00.00_REPLAY_,400,600,800,.mp4.csmil/master.m3u8
V/MediaPlayer( 1064): setDataSource(http://rai-i.akamaihd.net/i/20140610/tg1notte-100620141.00.00_REPLAY_,400,600,800,.mp4.csmil/master.m3u8)
V/MediaPlayer( 1064): setVideoSurfaceTexture
V/MediaPlayerJNI( 1064): setAudioStreamType: 3
...
D/MediaPlayer( 1064): getMetadata
E/MediaPlayerService( 74): getMetadata failed -38
V/MediaPlayerJNI( 1064): start
V/MediaPlayer( 1064): start
...
V/MediaPlayer( 1064): start
I/avc_utils( 74): found AVC codec config (700 x 394, Main-profile level 3.1)
V/ACodec ( 74): Now uninitialized
V/ACodec ( 74): onAllocateComponent
I/ESQueue ( 74): found AAC codec config (44100 Hz, 2 channels)
I/EV2OMXPlugin( 74): ***run OMFPlugin ------- makeComponentInstance !!!!!!!!
V/ACodec ( 74): [OMX.RENESAS.VIDEO.DECODER.H264] Now Loaded
V/ACodec ( 74): onConfigureComponent - msg: AMessage(what = 'setu', target = 14) = {
V/ACodec ( 74): string mime = "video/avc"
V/ACodec ( 74): int32_t width = 700
V/ACodec ( 74): int32_t height = 394
V/ACodec ( 74): ABuffer *csd-0 = 0x2a06af40
V/ACodec ( 74): ABuffer *csd-1 = 0x2a0722b0
V/ACodec ( 74): RefBase *native-window = 0x2a026e88
V/ACodec ( 74): }
V/ACodec ( 74): initNativeWindow
E/OMXNodeInstance( 74): OMX_GetExtensionIndex (index:'7fffffff') failed
F/ACodec ( 74): frameworks/av/media/libstagefright/ACodec.cpp:3107 CHECK_EQ( (status_t)OK,mCodec->initNativeWindow()) failed: 0 vs. -2147483648
F/libc ( 74): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 1490 (NuPlayerDecoder)
...
The OMX_GetExtensionIndex call fails, as the vendor OMX implementation doesn't include the NativeBuffer-related APIs.
In the OMXCodec (used by the AwesomePlayer to succesfully play mp4 files) initNativeWindow() isn't invoked at all (as per debug logs I've captured).
Our JB porting included this additional patch for the componentName, in the OMXCodec creation:
OMXCodec::OMXCodec(
const sp<IOMX> &omx, IOMX::node_id node,
uint32_t quirks, uint32_t flags,
bool isEncoder,
const char *mime,
const char *componentName,
const sp<MediaSource> &source,
const sp<ANativeWindow> &nativeWindow)
: mOMX(omx),
...
mNativeWindow(
(!strncmp(componentName, "OMX.google.", 11)
|| !strncmp(componentName, "OMX.RENESAS.", 12)
|| !strcmp(componentName, "OMX.Nvidia.mpeg2v.decode"))
? NULL : nativeWindow) {
...
So, looks like
mNativeWindow is nullified in our case (OMX.RENESAS.) and that makes a bunch of logic being skipped, including
initNativeWindow of course. That makes OMXCodec (AwesomePlayer) work as expected, on mp4 playback.
Adding this same check, not to call the InitNativeWindow logic, in ACodec::onConfgureComponent:
if (msg->findObject("native-window", &obj)
&& strncmp("OMX.google.", mCodec->mComponentName.c_str(), 11)