Changeset 5960


Ignore:
Timestamp:
Mar 27, 2019 1:53:57 AM (5 years ago)
Author:
ming
Message:

Fixed #2186: Enable video stream keep alive mechanism

  • Also add video stream port to video conf when call is on local hold in order for video stream to keep sending keep-alive.
Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c

    r5939 r5960  
    7474 */ 
    7575#define MIN_CHUNKS_PER_FRM      30 
    76  
    77 /* Video stream keep-alive feature is currently disabled. */ 
    78 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA != 0 
    79 #   undef PJMEDIA_STREAM_ENABLE_KA 
    80 #   define PJMEDIA_STREAM_ENABLE_KA 0 
    81 #endif 
    8276 
    8377 
     
    908902        dtx_duration = pj_timestamp_diff32(&stream->last_frm_ts_sent,  
    909903                                           &frame->timestamp); 
    910         /* Video stream keep-alive feature is currently disabled. */ 
    911         /* 
     904 
    912905        if (dtx_duration > 
    913             PJMEDIA_STREAM_KA_INTERVAL * 
    914             PJMEDIA_PIA_SRATE(&channel->port.info)) 
     906            PJMEDIA_STREAM_KA_INTERVAL * stream->info.codec_info.clock_rate) 
    915907        { 
    916908            send_keep_alive_packet(stream); 
    917909            stream->last_frm_ts_sent = frame->timestamp; 
    918910        } 
    919         */ 
    920911    } 
    921912#endif 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c

    r5945 r5960  
    11581158            call_med->strm.v.cap_win_id = wid; 
    11591159            pj_log_pop_indent(); 
     1160 
     1161        } else if (si->dir & PJMEDIA_DIR_ENCODING && call->local_hold) { 
     1162            /* This is similar as above, but we are on local hold. So 
     1163             * we just get the stream encoding port and add it to the 
     1164             * video conference, in order for the stream to be able to 
     1165             * keep sending keep-alive. 
     1166             */ 
     1167            PJ_LOG(4,(THIS_FILE, "Setting up TX..")); 
     1168 
     1169            status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, 
     1170                                                 PJMEDIA_DIR_ENCODING, 
     1171                                                 &media_port); 
     1172            if (status != PJ_SUCCESS) 
     1173                goto on_error; 
     1174 
     1175            status = pjsua_vid_conf_add_port(tmp_pool, media_port, NULL, 
     1176                                             &call_med->strm.v.strm_enc_slot); 
     1177            if (status != PJ_SUCCESS) 
     1178                goto on_error; 
    11601179        } 
    11611180 
Note: See TracChangeset for help on using the changeset viewer.