Changeset 6101


Ignore:
Timestamp:
Nov 6, 2019 8:10:42 AM (12 days ago)
Author:
riza
Message:

Close #2250: Enable OpenH264 native log.

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia-codec/config.h

    r5791 r6101  
    572572 
    573573/** 
     574 * Determine the log level of the native openH264 log which will be forwarded 
     575 * to the library's log. 
     576 * Set to WELS_LOG_QUIET to disable logging, or WELS_LOG_DETAIL for debugging. 
     577 * 
     578 * Default: WELS_LOG_ERROR. 
     579 */ 
     580#ifndef PJMEDIA_CODEC_OPENH264_LOG_LEVEL 
     581#   define PJMEDIA_CODEC_OPENH264_LOG_LEVEL  WELS_LOG_ERROR 
     582#endif 
     583/** 
    574584 * @} 
    575585 */ 
  • pjproject/trunk/pjmedia/src/pjmedia-codec/openh264.cpp

    r5925 r6101  
    168168}; 
    169169 
     170static void log_print(void* ctx, int level, const char* string) { 
     171    PJ_LOG(4,("[OPENH264_LOG]", "[L%d] %s", level, string)); 
     172} 
     173 
    170174PJ_DEF(pj_status_t) pjmedia_codec_openh264_vid_init(pjmedia_vid_codec_mgr *mgr, 
    171175                                                    pj_pool_factory *pf) 
     
    329333    oh264_codec_data *oh264_data; 
    330334    int rc; 
     335    WelsTraceCallback log_cb = &log_print; 
     336    int log_level = PJMEDIA_CODEC_OPENH264_LOG_LEVEL; 
    331337 
    332338    PJ_ASSERT_RETURN(factory == &oh264_factory.base && info && p_codec, 
     
    360366    if (rc != 0) 
    361367        goto on_error; 
     368 
     369    oh264_data->enc->SetOption(ENCODER_OPTION_TRACE_LEVEL, &log_level); 
     370    oh264_data->enc->SetOption(ENCODER_OPTION_TRACE_CALLBACK, &log_cb); 
     371    oh264_data->dec->SetOption(DECODER_OPTION_TRACE_LEVEL, &log_level); 
     372    oh264_data->dec->SetOption(DECODER_OPTION_TRACE_CALLBACK, &log_cb); 
    362373 
    363374    *p_codec = codec; 
Note: See TracChangeset for help on using the changeset viewer.