History

move trace related info to interface header

ruil2 committed 12 years ago

Commit 44b048e1 parent 84c1f3a7 files · +20 −22Browse files

Unified · Split

7 files
  1. codec/api/svc/codec_api.h +1 −0
  2. codec/api/svc/codec_app_def.h +12 −0
  3. codec/common/inc/utils.h +0 −15
  4. codec/common/inc/welsCodecTrace.h +4 −4
  5. codec/common/src/welsCodecTrace.cpp +1 −1
  6. codec/decoder/plus/src/welsDecoderExt.cpp +1 −1
  7. codec/encoder/plus/src/welsEncoderExt.cpp +1 −1
codec/api/svc/codec_api.h+1−0
@@ -191,6 +191,7 @@ long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption); · 190 unmodified lines
191};191};
192#endif192#endif
193 193
194typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
194 195
195int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);196int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
196void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);197void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
codec/api/svc/codec_app_def.h+12−0
@@ -231,6 +231,18 @@ typedef enum { · 230 unmodified lines
231 LEVEL_5_2231 LEVEL_5_2
232} ELevelIdc;232} ELevelIdc;
233 233
234
235enum {
236 WELS_LOG_QUIET = 0x00, // Quiet mode
237 WELS_LOG_ERROR = 1 << 0, // Error log iLevel
238 WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
239 WELS_LOG_INFO = 1 << 2, // Information log iLevel
240 WELS_LOG_DEBUG = 1 << 3, // Debug log iLevel
241 WELS_LOG_RESV = 1 << 4, // Resversed log iLevel
242 WELS_LOG_LEVEL_COUNT = 5,
243 WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
244};
245
234typedef struct {246typedef struct {
235 SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE247 SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
236 SSliceArgument sSliceArgument;248 SSliceArgument sSliceArgument;
codec/common/inc/utils.h+0−15
@@ -43,21 +43,6 @@ · 42 unmodified lines
43#include "typedefs.h"43#include "typedefs.h"
44 44
45 45
46/*
47 * Log output routines
48 */
49
50enum {
51 WELS_LOG_QUIET = 0x00, // Quiet mode
52 WELS_LOG_ERROR = 1 << 0, // Error log iLevel
53 WELS_LOG_WARNING = 1 << 1, // Warning log iLevel
54 WELS_LOG_INFO = 1 << 2, // Information log iLevel
55 WELS_LOG_DEBUG = 1 << 3, // Debug log iLevel
56 WELS_LOG_RESV = 1 << 4, // Resversed log iLevel
57 WELS_LOG_LEVEL_COUNT = 5,
58 WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
59};
60
61/*46/*
62 * Function pointer declaration for various tool sets47 * Function pointer declaration for various tool sets
63 */48 */
codec/common/inc/welsCodecTrace.h+4−4
@@ -36,8 +36,8 @@ · 35 unmodified lines
36#include <stdarg.h>36#include <stdarg.h>
37#include "typedefs.h"37#include "typedefs.h"
38#include "utils.h"38#include "utils.h"
39 39#include "codec_app_def.h"
40typedef void (*CM_WELS_TRACE) (void* ctx, int level, const char* string);40#include "codec_api.h"
41 41
42class welsCodecTrace {42class welsCodecTrace {
43 public:43 public:
@@ -45,7 +45,7 @@ class welsCodecTrace { · 1 unmodified line
45 ~welsCodecTrace();45 ~welsCodecTrace();
46 46
47 void SetTraceLevel (const int32_t kiLevel);47 void SetTraceLevel (const int32_t kiLevel);
48 void SetTraceCallback (CM_WELS_TRACE func);48 void SetTraceCallback (WelsTraceCallback func);
49 void SetTraceCallbackContext (void* pCtx);49 void SetTraceCallbackContext (void* pCtx);
50 50
51 private:51 private:
@@ -53,7 +53,7 @@ class welsCodecTrace { · 1 unmodified line
53 void CodecTrace (const int32_t kiLevel, const char* kpStrFormat, va_list vl);53 void CodecTrace (const int32_t kiLevel, const char* kpStrFormat, va_list vl);
54 54
55 int32_t m_iTraceLevel;55 int32_t m_iTraceLevel;
56 CM_WELS_TRACE m_fpTrace;56 WelsTraceCallback m_fpTrace;
57 void* m_pTraceCtx;57 void* m_pTraceCtx;
58 public:58 public:
59 59
codec/common/src/welsCodecTrace.cpp+1−1
@@ -87,7 +87,7 @@ void welsCodecTrace::SetTraceLevel (const int32_t iLevel) { · 86 unmodified lines
87 m_iTraceLevel = iLevel;87 m_iTraceLevel = iLevel;
88}88}
89 89
90void welsCodecTrace::SetTraceCallback (CM_WELS_TRACE func) {90void welsCodecTrace::SetTraceCallback (WelsTraceCallback func) {
91 m_fpTrace = func;91 m_fpTrace = func;
92}92}
93 93
codec/decoder/plus/src/welsDecoderExt.cpp+1−1
@@ -277,7 +277,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 276 unmodified lines
277 return cmResultSuccess;277 return cmResultSuccess;
278 } else if (eOptID == DECODER_OPTION_TRACE_CALLBACK) {278 } else if (eOptID == DECODER_OPTION_TRACE_CALLBACK) {
279 if (m_pWelsTrace) {279 if (m_pWelsTrace) {
280 CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption);280 WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
281 m_pWelsTrace->SetTraceCallback (callback);281 m_pWelsTrace->SetTraceCallback (callback);
282 }282 }
283 return cmResultSuccess;283 return cmResultSuccess;
codec/encoder/plus/src/welsEncoderExt.cpp+1−1
@@ -874,7 +874,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 873 unmodified lines
874 break;874 break;
875 case ENCODER_OPTION_TRACE_CALLBACK: {875 case ENCODER_OPTION_TRACE_CALLBACK: {
876 if (m_pWelsTrace) {876 if (m_pWelsTrace) {
877 CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption);877 WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
878 m_pWelsTrace->SetTraceCallback (callback);878 m_pWelsTrace->SetTraceCallback (callback);
879 }879 }
880 }880 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t