Bug 784329 - Part 1: Add some OmxPlugin error logging. r=doublec

This commit is contained in:
Chris Peterson 2012-08-22 18:29:58 -07:00
parent 60b08f3f09
commit 39238f1ffb

View File

@ -17,6 +17,7 @@
#include "android/log.h"
#undef LOG
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "OmxPlugin" , ## args)
using namespace MPAPI;
@ -248,6 +249,7 @@ bool OmxDecoder::Init() {
ssize_t audioTrackIndex = -1;
ssize_t videoTrackIndex = -1;
const char *audioMime = NULL;
const char *videoMime = NULL;
for (size_t i = 0; i < extractor->countTracks(); ++i) {
sp<MetaData> meta = extractor->getTrackMetaData(i);
@ -263,6 +265,7 @@ bool OmxDecoder::Init() {
if (videoTrackIndex == -1 && !strncasecmp(mime, "video/", 6)) {
videoTrackIndex = i;
videoMime = mime;
} else if (audioTrackIndex == -1 && !strncasecmp(mime, "audio/", 6)) {
audioTrackIndex = i;
audioMime = mime;
@ -302,10 +305,13 @@ bool OmxDecoder::Init() {
NULL,
flags);
if (videoSource == NULL) {
LOG("OMXCodec failed to initialize video decoder for \"%s\"", videoMime);
return false;
}
if (videoSource->start() != OK) {
status_t status = videoSource->start();
if (status != OK) {
LOG("videoSource->start() failed with status %#x", status);
return false;
}
@ -328,10 +334,15 @@ bool OmxDecoder::Init() {
false, // decoder
audioTrack);
}
if (audioSource == NULL) {
LOG("OMXCodec failed to initialize audio decoder for \"%s\"", audioMime);
return false;
}
if (audioSource->start() != OK) {
status_t status = audioSource->start();
if (status != OK) {
LOG("audioSource->start() failed with status %#x", status);
return false;
}
@ -499,7 +510,7 @@ bool OmxDecoder::ToVideoFrame(VideoFrame *aFrame, int64_t aTimeUs, void *aData,
SemiPlanarYVU420Packed32m4ka(aFrame, aTimeUs, aData, aSize, aKeyFrame);
break;
default:
LOG("Unknown video color format: %x", mVideoColorFormat);
LOG("Unknown video color format: %#x", mVideoColorFormat);
return false;
}
return true;