diff options
Diffstat (limited to 'libplatformconfig')
-rw-r--r-- | libplatformconfig/ConfigParser.cpp | 15 | ||||
-rw-r--r-- | libplatformconfig/ConfigParser.h | 4 | ||||
-rw-r--r-- | libplatformconfig/PlatformConfig.cpp | 7 |
3 files changed, 14 insertions, 12 deletions
diff --git a/libplatformconfig/ConfigParser.cpp b/libplatformconfig/ConfigParser.cpp index ef07d7c5..785c9533 100644 --- a/libplatformconfig/ConfigParser.cpp +++ b/libplatformconfig/ConfigParser.cpp @@ -32,7 +32,6 @@ #include <errno.h> #include <utils/Log.h> #include <sys/mman.h> -#include "vidc_debug.h" #include "PlatformConfig.h" #include "ConfigParser.h" @@ -42,14 +41,14 @@ namespace Platform { void ConfigParser::processProperty(const XML_Char **attr, ConfigMap &configMap) { if (strcmp(attr[0], "name") != 0) { - DEBUG_PRINT_HIGH("%s: Element 'name' not found!", __func__); + VIDC_PLAT_LOGH("%s: Element 'name' not found!", __func__); return; } std::string propName(attr[1]); if (strcmp(attr[2], "value") != 0) { - DEBUG_PRINT_HIGH("%s: Element 'value' not found for %s!", __func__, propName.c_str()); + VIDC_PLAT_LOGH("%s: Element 'value' not found for %s!", __func__, propName.c_str()); return; } @@ -78,7 +77,7 @@ int ConfigParser::initAndParse(std::string configFile, ConfigMap &configMap) { FILE *file; file = fopen(configFile.c_str(), "r"); if (!file) { - DEBUG_PRINT_HIGH("%s: Error: %d (%s). Using defaults!", + VIDC_PLAT_LOGH("%s: Error: %d (%s). Using defaults!", __func__, errno, strerror(errno)); return err; } @@ -86,7 +85,7 @@ int ConfigParser::initAndParse(std::string configFile, ConfigMap &configMap) { // Create Parser parser = XML_ParserCreate(NULL); if (!parser) { - DEBUG_PRINT_HIGH("%s: Failed to create XML parser!", __func__); + VIDC_PLAT_LOGH("%s: Failed to create XML parser!", __func__); err = -ENODEV; goto fileError; } @@ -101,21 +100,21 @@ int ConfigParser::initAndParse(std::string configFile, ConfigMap &configMap) { while (1) { buf = XML_GetBuffer(parser, BUF_SIZE); if (buf == NULL) { - DEBUG_PRINT_HIGH("%s: XML_GetBuffer failed", __func__); + VIDC_PLAT_LOGH("%s: XML_GetBuffer failed", __func__); err = -ENOMEM; goto parserError; } bytesRead = fread(buf, 1, BUF_SIZE, file); if (bytesRead < 0) { - DEBUG_PRINT_HIGH("%s: fread failed, bytes read = %d", __func__, bytesRead); + VIDC_PLAT_LOGH("%s: fread failed, bytes read = %d", __func__, bytesRead); err = bytesRead; goto parserError; } if (XML_ParseBuffer(parser, bytesRead, bytesRead == 0) == XML_STATUS_ERROR) { - DEBUG_PRINT_HIGH("%s: XML_ParseBuffer failed, for %s", + VIDC_PLAT_LOGH("%s: XML_ParseBuffer failed, for %s", __func__, configFile.c_str()); err = -EINVAL; goto parserError; diff --git a/libplatformconfig/ConfigParser.h b/libplatformconfig/ConfigParser.h index 1170b7ec..7aadc8f2 100644 --- a/libplatformconfig/ConfigParser.h +++ b/libplatformconfig/ConfigParser.h @@ -46,6 +46,10 @@ extern "C" { #endif +#define VIDC_PLAT_LOGH(fmt, args...) ({ \ + ALOGD(fmt,##args); \ + }) + namespace Platform { class ConfigParser { diff --git a/libplatformconfig/PlatformConfig.cpp b/libplatformconfig/PlatformConfig.cpp index df52fef6..35237e8f 100644 --- a/libplatformconfig/PlatformConfig.cpp +++ b/libplatformconfig/PlatformConfig.cpp @@ -32,7 +32,6 @@ #include <errno.h> #include <utils/Log.h> #include <sys/mman.h> -#include "vidc_debug.h" #include "PlatformConfig.h" #include "ConfigParser.h" @@ -47,7 +46,7 @@ Config::Config() { } Config* Config::getInstance() { - DEBUG_PRINT_LOW("%s: Enter", __func__); + VIDC_PLAT_LOGH("%s: Enter", __func__); if (!mInstance) { mInstance = new Config(); } @@ -62,12 +61,12 @@ ConfigError_t Config::getInt32(Config_t config, int32_t *value, return FAIL; } if (conf->mConfigMap.find(configStrMap[config].name) == conf->mConfigMap.end()) { - DEBUG_PRINT_HIGH("%s: Returning default", __func__); + VIDC_PLAT_LOGH("%s: Returning default", __func__); *value = defaultValue; return FAIL; } *value = (int32_t) atoi(conf->mConfigMap[configStrMap[config].name].c_str()); - DEBUG_PRINT_LOW("%s Config name: %s value: %d", + VIDC_PLAT_LOGH("%s Config name: %s value: %d", __func__, configStrMap[config].name, *value); return OK; } |