[CM7] Video Drivers : Play YouTube HQ Videos smoothly on CM7
How does it work ?
When you start your phone, stagefright (the piece of software that handles media playback/recording in Android), scans for files it knows. Here is a list for what it looks for:
".mp3", ".mp4", ".m4a", ".3gp", ".3gpp", ".3g2", ".3gpp2",
".mpeg", ".ogg", ".mid", ".smf", ".imy", ".wma", ".aac",
".wav", ".amr", ".midi", ".xmf", ".rtttl", ".rtx", ".ota",
".mkv", ".mka", ".webm", ".ts", ".flac"
If a file you want to play doesn't have one of these extensions, you'll need a third party player, like MX Video or QQPlayer.
When you open a file, lib stagefriht "sniffs" the file to know if it knows how to extract frames from it. For example, it doesn't know how to extract frames from .avi files, but does for .mp4
When it got a frame, it looks for a matching decoder, and goes for hardware ones if available. For example, it will find a decoder for mpeg4, but won't know what to do with xvid or divx.
For h264, MPEG4 and H263 it will use these libs to decode. Stagefright sends it the encoded frame, the lib copies it to the MFC input buffer, ask MFC to decode it, crop it if necessary, while copying the decoded frame to the output buffer.
Then stagefright displays it.
Now, about h264. There are several 'profiles', depending on the target device. Baseline for mobile devices, Main for computers, High for Blurays and HD-DVD.
Our phones can
decode Baseline, not
High. Many .mkv files out there use h264 with either Main or High profiles and thus won't be decoded.
Main and High use and different compression algorithm and add features the MFC don't know about and its initialization will fail.
To sum it up:
- .AVI, .FLV, .WMV and any other extension not
listed above can't
be opened without a third party software.
- All h264 encoded files can't be played, due to hardware limitations.
- The libs just decode the frame, it is not
responsible for which frame is sent to it, for skipping frames, for aspect ratio, for A/V sync, for low content quality.
- It doesn't make kitten videos any funnier.