VLC_CODEC_MP3 seems to work fine with multiple OMX mp3 decoders,
so keep it mapped.
VLC_CODEC_MPGA does work with some OMX mp3 decoders (OMX.SEC.mp3.dec
seems to handle it) but not with all (OMX.google.mp3.decoder doesn't
seem to handle it).
Vorbis does not work with OMX decoders in the current form. The only
such decoder I've seen is OMX.google.vorbis.decoder, and using it
requires us to modify the packets sent a little. Even if this can be
done pretty easily, the packet format feels more like an android
internal hack than an official spec of any sort, so disable this
mapping since there isn't much value in using it currently.
WMA does not work with OMX in the current form (tested with
OMX.SEC.wma.dec). I've got work in progress code that makes certain
WMA files work with it, but not all, so disable it until at least
most of them work properly.
Mario Speiß [Sun, 3 Feb 2013 17:25:35 +0000 (19:25 +0200)]
too long timeouts in win32 vlc_poll
When vlc_poll is called with timeout of i.e. 5000ms it may happen that the
waiting time might be as long as 2500s ! Probably poll should be called with
the 50ms timeout as many times until the original provided timeout has been
reached.
Martin Storsjö [Sat, 2 Feb 2013 13:22:32 +0000 (15:22 +0200)]
omxil: Use the role names video_decoder.wmv1/2
The role name without a suffix, "video_decoder.wmv", is only for
vc1/wmv3/9 (on Samsung Galaxy S III at least). Since certain roles
are substrings of others, require the full string to match when looking
for suitable codecs instead of using strncmp.
Martin Storsjö [Sat, 2 Feb 2013 14:33:13 +0000 (16:33 +0200)]
omxil: Factorize samsung decoder quirk identification to a separate function
Previously, we tried to see if the samsung decoder name followed
a certain pattern (ending .Decoder, for good decoders, assuming
we should ignore the padding specified by all other samsung
decoders). This simple pattern didn't turn out to apply for some
other deocders, so instead explicitly list the components that
we know we should ignore the specified padding values.
Also refactor the same check from both the omxil and mediacodec
files into one utility function.
Martin Storsjö [Fri, 1 Feb 2013 10:53:22 +0000 (12:53 +0200)]
omxil: Make sure i_channels is nonzero before dividing by it
At startup of the decoder, i_channels might be set to 0 if the decoder
hasn't processed the sent CODECCONFIG data yet. (In these cases, the
returned buffers are 0 bytes long so we don't miss anything either.)
A port reconfigure event is sent in these cases, so i_channels gets
initialized to the right value before we handle any later buffers with
actual content.
Martin Storsjö [Wed, 11 Apr 2012 16:25:36 +0000 (19:25 +0300)]
omxil: Don't require SetAudioParameters on the decoder output port to succeed
It's mostly enough to call it on the input port, while we later get
back what the decoder itself set on the output port (based on the
input port and codec config data), so if this fails, just ignore it.
This is required for using google SW audio codecs via OMX, which is
useful mostly for testing. (Using them still requires a few more
hacks though.)
Martin Storsjö [Wed, 30 Jan 2013 19:23:45 +0000 (21:23 +0200)]
omxil: Set OMX_AUDIO_AACStreamFormatMP4FF for AAC
This does work with the Samsung AAC decoder (which seems to support
both), while the google SW AAC decoder doesn't support the previous
value (but works fine with this one).
As far as I can read the specs, the two formats are identical (one
is defined as "AAC inside MPEG-4/ISO File Format" while the other
one is defined as "AAC Raw Format (access units)").
The Android media stack seems to be using this one internally
(with a bunch of references to this one, and no references to the
RAW one), which is a good indication that at least most android
AAC decoders should be able to handle it.
Martin Storsjö [Tue, 29 Jan 2013 15:55:09 +0000 (17:55 +0200)]
omxil: Wait for the right event when deinitializing
Previously, we checked that the event queue had an OMX_EventCmdComplete
item, but we didn't make sure that it was for the previously issued
OMX_CommandStateSet. In many cases, it was from a OMX_CommandFlush,
which made the code proceed with other deinitialization. If the decoder
hadn't actually transitioned to idle state yet, the buffers weren't
actually ever freed (in the state == OMX_StateIdle block), which lead
to crashes when the handle was freed at the end.
This fixes crashes when finishing playback of wmv3 videos on Galaxy S3.
Martin Storsjö [Tue, 29 Jan 2013 15:55:07 +0000 (17:55 +0200)]
omxil: Pass extradata for WMV3 according to OMX specs
Some OMX decoders that can handle WMV3 (such as the broadcom one
in raspberry pi) can handle the WMV3 extradata both in the original
form as in ASF, and in this format, while the one in Samsung Galaxy
S3 requires it to be in this format (as the OMX IL 1.2 specs specify).
This makes HW-accelerated WMV3 decoding work on Galaxy S3.
The code can be split out to a reusable function if/when the same
needs to be done elsewhere.