Unified · Split
| @@ -191,6 +191,7 @@ long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption); · 190 unmodified lines | ||
| 191 | 191 | }; |
| 192 | 192 | #endif |
| 193 | 193 | |
| 194 | +typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string); | |
| 194 | 195 | |
| 195 | 196 | int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder); |
| 196 | 197 | void WelsDestroySVCEncoder (ISVCEncoder* pEncoder); |
| @@ -231,6 +231,18 @@ typedef enum { · 230 unmodified lines | ||
| 231 | 231 | LEVEL_5_2 |
| 232 | 232 | } ELevelIdc; |
| 233 | 233 | |
| 234 | + | |
| 235 | +enum { | |
| 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 | + | |
| 234 | 246 | typedef struct { |
| 235 | 247 | SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE |
| 236 | 248 | SSliceArgument sSliceArgument; |
| @@ -43,21 +43,6 @@ · 42 unmodified lines | ||
| 43 | 43 | #include "typedefs.h" |
| 44 | 44 | |
| 45 | 45 | |
| 46 | −/* | |
| 47 | − * Log output routines | |
| 48 | − */ | |
| 49 | − | |
| 50 | −enum { | |
| 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 | 47 | * Function pointer declaration for various tool sets |
| 63 | 48 | */ |
| @@ -36,8 +36,8 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <stdarg.h> |
| 37 | 37 | #include "typedefs.h" |
| 38 | 38 | #include "utils.h" |
| 39 | − | |
| 40 | −typedef void (*CM_WELS_TRACE) (void* ctx, int level, const char* string); | |
| 39 | +#include "codec_app_def.h" | |
| 40 | +#include "codec_api.h" | |
| 41 | 41 | |
| 42 | 42 | class welsCodecTrace { |
| 43 | 43 | public: |
| @@ -45,7 +45,7 @@ class welsCodecTrace { · 1 unmodified line | ||
| 45 | 45 | ~welsCodecTrace(); |
| 46 | 46 | |
| 47 | 47 | void SetTraceLevel (const int32_t kiLevel); |
| 48 | − void SetTraceCallback (CM_WELS_TRACE func); | |
| 48 | + void SetTraceCallback (WelsTraceCallback func); | |
| 49 | 49 | void SetTraceCallbackContext (void* pCtx); |
| 50 | 50 | |
| 51 | 51 | private: |
| @@ -53,7 +53,7 @@ class welsCodecTrace { · 1 unmodified line | ||
| 53 | 53 | void CodecTrace (const int32_t kiLevel, const char* kpStrFormat, va_list vl); |
| 54 | 54 | |
| 55 | 55 | int32_t m_iTraceLevel; |
| 56 | − CM_WELS_TRACE m_fpTrace; | |
| 56 | + WelsTraceCallback m_fpTrace; | |
| 57 | 57 | void* m_pTraceCtx; |
| 58 | 58 | public: |
| 59 | 59 | |
| @@ -87,7 +87,7 @@ void welsCodecTrace::SetTraceLevel (const int32_t iLevel) { · 86 unmodified lines | ||
| 87 | 87 | m_iTraceLevel = iLevel; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | −void welsCodecTrace::SetTraceCallback (CM_WELS_TRACE func) { | |
| 90 | +void welsCodecTrace::SetTraceCallback (WelsTraceCallback func) { | |
| 91 | 91 | m_fpTrace = func; |
| 92 | 92 | } |
| 93 | 93 | |
| @@ -277,7 +277,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 276 unmodified lines | ||
| 277 | 277 | return cmResultSuccess; |
| 278 | 278 | } else if (eOptID == DECODER_OPTION_TRACE_CALLBACK) { |
| 279 | 279 | if (m_pWelsTrace) { |
| 280 | − CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption); | |
| 280 | + WelsTraceCallback callback = * ((WelsTraceCallback*)pOption); | |
| 281 | 281 | m_pWelsTrace->SetTraceCallback (callback); |
| 282 | 282 | } |
| 283 | 283 | return cmResultSuccess; |
| @@ -874,7 +874,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 873 unmodified lines | ||
| 874 | 874 | break; |
| 875 | 875 | case ENCODER_OPTION_TRACE_CALLBACK: { |
| 876 | 876 | if (m_pWelsTrace) { |
| 877 | − CM_WELS_TRACE callback = * ((CM_WELS_TRACE*)pOption); | |
| 877 | + WelsTraceCallback callback = * ((WelsTraceCallback*)pOption); | |
| 878 | 878 | m_pWelsTrace->SetTraceCallback (callback); |
| 879 | 879 | } |
| 880 | 880 | } |