Merge pull request #958 from ruil2/trace_update

move trace related info to interface header
This commit is contained in:
dongzha 2014-06-12 09:15:29 +08:00
commit c38126b094
7 changed files with 20 additions and 22 deletions

View File

@ -191,6 +191,7 @@ long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
};
#endif
typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);

View File

@ -231,6 +231,18 @@ typedef enum {
LEVEL_5_2
} ELevelIdc;
enum {
WELS_LOG_QUIET = 0x00, // Quiet mode
WELS_LOG_ERROR = 1 << 0, // Error log iLevel
WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
WELS_LOG_INFO = 1 << 2, // Information log iLevel
WELS_LOG_DEBUG = 1 << 3, // Debug log iLevel
WELS_LOG_RESV = 1 << 4, // Resversed log iLevel
WELS_LOG_LEVEL_COUNT = 5,
WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
};
typedef struct {
SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
SSliceArgument sSliceArgument;

View File

@ -43,21 +43,6 @@
#include "typedefs.h"
/*
* Log output routines
*/
enum {
WELS_LOG_QUIET = 0x00, // Quiet mode
WELS_LOG_ERROR = 1 << 0, // Error log iLevel
WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
WELS_LOG_INFO = 1 << 2, // Information log iLevel
WELS_LOG_DEBUG = 1 << 3, // Debug log iLevel
WELS_LOG_RESV = 1 << 4, // Resversed log iLevel
WELS_LOG_LEVEL_COUNT = 5,
WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
};
/*
* Function pointer declaration for various tool sets
*/

View File

@ -36,8 +36,8 @@
#include <stdarg.h>
#include "typedefs.h"
#include "utils.h"
typedef void (*CM_WELS_TRACE) (void* ctx, int level, const char* string);
#include "codec_app_def.h"
#include "codec_api.h"
class welsCodecTrace {
public:
@ -45,7 +45,7 @@ class welsCodecTrace {
~welsCodecTrace();
void SetTraceLevel (const int32_t kiLevel);
void SetTraceCallback (CM_WELS_TRACE func);
void SetTraceCallback (WelsTraceCallback func);
void SetTraceCallbackContext (void* pCtx);
private:
@ -53,7 +53,7 @@ class welsCodecTrace {
void CodecTrace (const int32_t kiLevel, const char* kpStrFormat, va_list vl);
int32_t m_iTraceLevel;
CM_WELS_TRACE m_fpTrace;
WelsTraceCallback m_fpTrace;
void* m_pTraceCtx;
public:

View File

@ -87,7 +87,7 @@ void welsCodecTrace::SetTraceLevel (const int32_t iLevel) {
m_iTraceLevel = iLevel;
}
void welsCodecTrace::SetTraceCallback (CM_WELS_TRACE func) {
void welsCodecTrace::SetTraceCallback (WelsTraceCallback func) {
m_fpTrace = func;
}

View File

@ -277,7 +277,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) {
return cmResultSuccess;
} else if (eOptID == DECODER_OPTION_TRACE_CALLBACK) {
if (m_pWelsTrace) {
CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption);
WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
m_pWelsTrace->SetTraceCallback (callback);
}
return cmResultSuccess;

View File

@ -874,7 +874,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
break;
case ENCODER_OPTION_TRACE_CALLBACK: {
if (m_pWelsTrace) {
CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption);
WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
m_pWelsTrace->SetTraceCallback (callback);
}
}