Upstream commit "Fix a number of warnings in stagefright code."

Adapted from upstream commit 3d34fa7fe4df6fb66215303f721cc87ce4619cdc.
Upstream commit "Add liblog"

Adapted from upstream commit ecba7488c5cceaacef95836b1b476433451e7761.