MediaCodec vs libstagefright
#1
Can someone give me a brief overview of the difference between MediaCodec and libstagefright?

Thanks,
rdg
Reply
#2
MediaCodec uses the public MediaCodec API.
Reply
#3
davilla,

Thanks. I see (from: http://bigflake.com/mediacodec/) that MediaCodec was made available for Android starting with version 4.1.

-rdg
Reply
#4
And libstagefright is a hack using private api's.
Generally speaking, it's only needed on Android 4.0 ICS.
Reply
#5
Koying,

Thanks for that insight. It sounds like I would be better off using MediaCodec.

Is MediaCodec called from the native C/C++ code? I have started reading up about it and watched the Google I/O 2012 presentation about MediaCodec. Google says that it is a Java API.

Have you ever noticed the audio getting out of sync when using MediaCodec?

Thanks,
rdg
Reply
#6
see https://github.com/xbmc/xbmc/blob/master...aCodec.cpp
Reply
#7
davilla,

Thanks for pointing that out. I appreciate it.

It seems to me that xbmc is failing to find the hardware H264 codec that is supposed to be available on the Galaxy Tab 3. It looks like it then goes to software decoding using FFMPEG. Can someone tell me if I am interpreting the logcat output correctly? What is the best way to determine if the hardware decoder is being used?

Here is some output from logcat when trying to play back a 720P stream (full log: http://pastebin.com/xCaNnL2F ):


12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 INFO: MediaCodec Video Decoder...
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Video: mediacodec - Opening
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Video: amc-h264 - Failed
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Video: - Opening
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: SECTION:LoadDLL(libpostproc-52-arm.so)
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: Loading: /data/data/org.xbmc.xbmc/lib/libpostproc-52-arm.so
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: SECTION:LoadDLL(libswresample-0-arm.so)
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: Loading: /data/data/org.xbmc.xbmc/lib/libswresample-0-arm.so
12-23 08:52:47.539: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: SECTION:LoadDLL(libavfilter-3-arm.so)
12-23 08:52:47.546: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: Loading: /data/data/org.xbmc.xbmc/lib/libavfilter-3-arm.so
12-23 08:52:47.546: V/XBMC(10104): 08:52:47 T:1714434112 NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Video: ff-h264 - Opened
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 NOTICE: Creating video thread
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 NOTICE: Opening audio stream: 1 source: 256
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 NOTICE: Finding audio codec for: 86019
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Audio: passthrough - Opening
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Audio: passthrough - Failed
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Audio: FFmpeg - Opening
12-23 08:52:47.554: V/XBMC(10104): 08:52:47 T:1714434112 DEBUG: FactoryCodec - Audio: FFmpeg - Opene

Here is a snippet from the /etc/media_codecs.xml from the device (full xml http://pastebin.com/gQ8WQzxD ):

<MediaCodec name="OMX.MARVELL.VIDEO.H264DECODER" type="video/avc" />
<MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
Reply
#8
I've had to turn off MediaCodec on my Tabs as I only get a green screen and sound, this is on all Gotham builds. Libstagefright works on them all.
Reply
#9
Put enccbs_tst1.ts where I can get it for testing.
Reply

Logout Mark Read Team Forum Stats Members Help
MediaCodec vs libstagefright0
This forum uses Lukasz Tkacz MyBB addons.