[mpp]: use __FUNCTION__ to replace __FILE__, add mpp_debug initial and move mpp_debug to osal

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@485 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-11-25 14:53:47 +00:00
parent d6c8a8af56
commit 0c69cc591f
7 changed files with 21 additions and 20 deletions

View File

@@ -25,22 +25,22 @@
#define MODULE_TAG "h265_test"
#include <string.h>
#include "mpp_env.h"
#include "mpp_err.h"
#include "mpp_log.h"
#include "mpp_mem.h"
#include "mpp_common.h"
#include "mpp_dec.h"
#include "mpp_frame.h"
#include "h265d_api.h"
#include "hal_h265d_api.h"
#include "mpp_env.h"
#include "utils.h"
#include "mpp_log.h"
#include <string.h>
#include <stdlib.h>
#include "mpp_err.h"
#include "mpp_mem.h"
#include "mpp_frame.h"
#include "openHevcWrapper.h"
#include "mpp_buf_slot.h"
#include "rk_type.h"
#include "mpp_common.h"
#include "mpp_dec.h"
#include "h265d_api.h"
#include "hal_h265d_api.h"
@@ -299,7 +299,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
}
curtask = mpp_calloc(HalDecTask, 1);
pretask = mpp_calloc(HalDecTask, 1);
pretask = mpp_calloc(HalDecTask, 1);
mpp_codex_ctx = mpp_calloc_size(void, api_h265d_parser.ctx_size);
mpp_err("api_h265d_parser.ctx_size = %d", api_h265d_parser.ctx_size);
@@ -597,6 +597,7 @@ int main(int argc, char **argv)
}
//mpp_env_set_u32("buf_slot_debug", 0x10000010, 0);
mpp_env_get_u32("mpp_debug", &mpp_debug, 0);
cmd = &demoCmdCtx;
memset((void*)cmd, 0, sizeof(ParserDemoCmdContext_t));

View File

@@ -44,7 +44,7 @@ static RK_U32 buf_slot_debug = 0;
if (!(cond)) { \
dump_slots(impl); \
mpp_err("Assertion %s failed at %s:%d\n", \
MPP_STRINGS(cond), __FILE__, __LINE__); \
MPP_STRINGS(cond), __FUNCTION__, __LINE__); \
abort(); \
} \
} while (0)

View File

@@ -155,7 +155,7 @@ MPP_RET mpp_hal_hw_wait(MppHal ctx, HalTaskInfo *task)
MPP_RET ret = p->api->wait(p->ctx, task);
task->time_end = mpp_time();
mpp_dbg(MPP_HAL_TIMING, "hal timing: %lld\n", task->time_end - task->time_start);
mpp_dbg(MPP_TIMING, "hal timing: %lld\n", task->time_end - task->time_start);
return ret;
}

View File

@@ -26,5 +26,6 @@ RK_U32 mpi_debug = 0;
void get_mpi_debug()
{
mpp_env_get_u32("mpi_debug", &mpi_debug, 0);
mpp_env_get_u32("mpp_debug", &mpp_debug, 0);
}

View File

@@ -32,8 +32,6 @@
#define MPP_TEST_FRAME_SIZE SZ_1M
#define MPP_TEST_PACKET_SIZE SZ_512K
RK_U32 mpp_debug = 0;
Mpp::Mpp(MppCtxType type, MppCodingType coding)
: mPackets(NULL),
mFrames(NULL),

View File

@@ -53,9 +53,7 @@
#define mpp_dbg_f(flag, fmt, ...) _mpp_dbg_f(mpp_debug, flag, fmt, ## __VA_ARGS__)
#define MPP_HAL_TIMING (0x00000001)
extern RK_U32 mpp_debug;
#define MPP_TIMING (0x00000001)
/*
* mpp_dbg usage:
@@ -101,7 +99,7 @@ extern RK_U32 mpp_debug;
#define mpp_assert(cond) do { \
if (!(cond)) { \
mpp_err("Assertion %s failed at %s:%d\n", \
MPP_STRINGS(cond), __FILE__, __LINE__); \
MPP_STRINGS(cond), __FUNCTION__, __LINE__); \
mpp_abort(); \
} \
} while (0)
@@ -111,6 +109,8 @@ extern RK_U32 mpp_debug;
extern "C" {
#endif
extern RK_U32 mpp_debug;
void mpp_log_set_flag(RK_U32 flag);
RK_U32 mpp_log_get_flag();

View File

@@ -35,6 +35,7 @@ typedef void (*mpp_log_callback)(const char*, const char*, va_list);
extern "C" {
#endif
RK_U32 mpp_debug = 0;
static RK_U32 mpp_log_flag = 0;
// TODO: add log timing information and switch flag