shithub: openh264

Download patch

ref: 44b048edd6e5f81d8eb14d8a4130984e6f2004b8
parent: 84c1f3a4eec95f0feaf898bd5b7dd3edee00a7e3
author: ruil2 <ruil2@cisco.com>
date: Wed Jun 11 13:05:40 EDT 2014

move trace related info to interface header

--- a/codec/api/svc/codec_api.h
+++ b/codec/api/svc/codec_api.h
@@ -191,6 +191,7 @@
 };
 #endif
 
+typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
 
 int  WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
 void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -231,6 +231,18 @@
   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;
--- a/codec/common/inc/utils.h
+++ b/codec/common/inc/utils.h
@@ -44,21 +44,6 @@
 
 
 /*
- *	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
  */
 // wels log output
--- a/codec/common/inc/welsCodecTrace.h
+++ b/codec/common/inc/welsCodecTrace.h
@@ -36,9 +36,9 @@
 #include <stdarg.h>
 #include "typedefs.h"
 #include "utils.h"
+#include "codec_app_def.h"
+#include "codec_api.h"
 
-typedef void (*CM_WELS_TRACE) (void* ctx, int level, const char* string);
-
 class welsCodecTrace {
  public:
   welsCodecTrace();
@@ -45,7 +45,7 @@
   ~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 @@
   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:
 
--- a/codec/common/src/welsCodecTrace.cpp
+++ b/codec/common/src/welsCodecTrace.cpp
@@ -87,7 +87,7 @@
     m_iTraceLevel	= iLevel;
 }
 
-void welsCodecTrace::SetTraceCallback (CM_WELS_TRACE func) {
+void welsCodecTrace::SetTraceCallback (WelsTraceCallback func) {
   m_fpTrace = func;
 }
 
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -277,7 +277,7 @@
     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;
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -874,7 +874,7 @@
   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);
     }
   }