summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/foundation
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-09-21 13:13:15 -0700
committerAndreas Huber <andih@google.com>2010-09-21 15:12:19 -0700
commit6e3fa444c5b3970666707bb2b6d25e2615dafe80 (patch)
tree57a080a9aec58d0b92b2d6835483a0600694caf3 /media/libstagefright/foundation
parent8217eac0a0b6d394139eefa85d5f467240427e98 (diff)
downloadframeworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.zip
frameworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.tar.gz
frameworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.tar.bz2
Remove stagefright foundation's incompatible logging interface and update callsites.
Change-Id: I45fba7d60530ea0f233ac3695a97306b6dc1795c
Diffstat (limited to 'media/libstagefright/foundation')
-rw-r--r--media/libstagefright/foundation/ADebug.cpp76
-rw-r--r--media/libstagefright/foundation/ALooperRoster.cpp13
-rw-r--r--media/libstagefright/foundation/Android.mk1
-rw-r--r--media/libstagefright/foundation/hexdump.cpp6
4 files changed, 11 insertions, 85 deletions
diff --git a/media/libstagefright/foundation/ADebug.cpp b/media/libstagefright/foundation/ADebug.cpp
deleted file mode 100644
index 16f8b22..0000000
--- a/media/libstagefright/foundation/ADebug.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ADebug.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef ANDROID
-#include <cutils/log.h>
-#endif
-
-namespace android {
-
-Logger::Logger(LogType type)
- : mLogType(type) {
- switch (mLogType) {
- case VERBOSE:
- mMessage = "V ";
- break;
- case INFO:
- mMessage = "I ";
- break;
- case WARNING:
- mMessage = "W ";
- break;
- case ERROR:
- mMessage = "E ";
- break;
- case FATAL:
- mMessage = "F ";
- break;
-
- default:
- break;
- }
-}
-
-Logger::~Logger() {
- if (mLogType == VERBOSE) {
- return;
- }
-
- mMessage.append("\n");
-
-#if defined(ANDROID) && 1
- LOG_PRI(ANDROID_LOG_INFO, "ADebug", "%s", mMessage.c_str());
-#else
- fprintf(stderr, mMessage.c_str());
- fflush(stderr);
-#endif
-
- if (mLogType == FATAL) {
- abort();
- }
-}
-
-const char *LeafName(const char *s) {
- const char *lastSlash = strrchr(s, '/');
- return lastSlash != NULL ? lastSlash + 1 : s;
-}
-
-} // namespace android
diff --git a/media/libstagefright/foundation/ALooperRoster.cpp b/media/libstagefright/foundation/ALooperRoster.cpp
index 65f7593..7683113 100644
--- a/media/libstagefright/foundation/ALooperRoster.cpp
+++ b/media/libstagefright/foundation/ALooperRoster.cpp
@@ -74,7 +74,7 @@ void ALooperRoster::postMessage(
ssize_t index = mHandlers.indexOfKey(msg->target());
if (index < 0) {
- LOG(WARNING) << "failed to post message. Target handler not registered.";
+ LOGW("failed to post message. Target handler not registered.");
return;
}
@@ -83,8 +83,8 @@ void ALooperRoster::postMessage(
sp<ALooper> looper = info.mLooper.promote();
if (looper == NULL) {
- LOG(WARNING) << "failed to post message. "
- "Target handler still registered, but object gone.";
+ LOGW("failed to post message. "
+ "Target handler still registered, but object gone.");
mHandlers.removeItemsAt(index);
return;
@@ -102,8 +102,7 @@ void ALooperRoster::deliverMessage(const sp<AMessage> &msg) {
ssize_t index = mHandlers.indexOfKey(msg->target());
if (index < 0) {
- LOG(WARNING) << "failed to deliver message. "
- << "Target handler not registered.";
+ LOGW("failed to deliver message. Target handler not registered.");
return;
}
@@ -111,8 +110,8 @@ void ALooperRoster::deliverMessage(const sp<AMessage> &msg) {
handler = info.mHandler.promote();
if (handler == NULL) {
- LOG(WARNING) << "failed to deliver message. "
- "Target handler registered, but object gone.";
+ LOGW("failed to deliver message. "
+ "Target handler registered, but object gone.");
mHandlers.removeItemsAt(index);
return;
diff --git a/media/libstagefright/foundation/Android.mk b/media/libstagefright/foundation/Android.mk
index f6a8a52..ffa7db0 100644
--- a/media/libstagefright/foundation/Android.mk
+++ b/media/libstagefright/foundation/Android.mk
@@ -5,7 +5,6 @@ LOCAL_SRC_FILES:= \
AAtomizer.cpp \
ABitReader.cpp \
ABuffer.cpp \
- ADebug.cpp \
AHandler.cpp \
ALooper.cpp \
ALooperRoster.cpp \
diff --git a/media/libstagefright/foundation/hexdump.cpp b/media/libstagefright/foundation/hexdump.cpp
index 093b587..9f6bf9e 100644
--- a/media/libstagefright/foundation/hexdump.cpp
+++ b/media/libstagefright/foundation/hexdump.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+//#define LOG_NDEBUG 0
+#define LOG_TAG "hexdump"
+#include <utils/Log.h>
+
#include "hexdump.h"
#include "ADebug.h"
@@ -63,7 +67,7 @@ void hexdump(const void *_data, size_t size) {
}
}
- LOG(INFO) << line;
+ LOGI("%s", line.c_str());
offset += 16;
}