Changeset 3725


Ignore:
Timestamp:
Aug 26, 2011 4:19:04 AM (13 years ago)
Author:
nanang
Message:

Fixed #1352:

  • Updated maximum video tee ports in pjsua video preview to (PJSUA_MAX_CALLS+1).
  • Removed video tee maximum ports compile-time setting, MAX_DST_PORT_COUNT.
Location:
pjproject/trunk
Files:
2 edited

Legend:

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

    r3667 r3725  
    3030#define TEE_PORT_NAME   "vid_tee" 
    3131#define TEE_PORT_SIGN   PJMEDIA_SIG_PORT_VID_TEE 
    32 #define MAX_DST_PORT_COUNT 20 
    3332 
    3433 
     
    5251    unsigned             dst_port_cnt; 
    5352    vid_tee_dst_port    *dst_ports; 
     53    pj_uint8_t          *put_frm_flag; 
    5454     
    5555    struct vid_tee_conv_t { 
     
    8080    PJ_ASSERT_RETURN(pool && fmt && p_vid_tee, PJ_EINVAL); 
    8181    PJ_ASSERT_RETURN(fmt->type == PJMEDIA_TYPE_VIDEO, PJ_EINVAL); 
    82     PJ_ASSERT_RETURN(max_dst_cnt <= MAX_DST_PORT_COUNT, PJ_ETOOMANY); 
    8382 
    8483    /* Allocate video tee structure */ 
     
    9594                    pj_pool_calloc(pool, max_dst_cnt, 
    9695                                   sizeof(struct vid_tee_conv_t)); 
     96    tee->put_frm_flag = (pj_uint8_t*) 
     97                        pj_pool_calloc(pool, max_dst_cnt, 
     98                                       sizeof(tee->put_frm_flag[0])); 
    9799 
    98100    /* Initialize video tee buffer, its size is one frame */ 
     
    296298    vid_tee_port *tee = (vid_tee_port*)port; 
    297299    unsigned i, j; 
    298     pj_bool_t done[MAX_DST_PORT_COUNT]; 
    299      
    300     pj_bzero(done, sizeof(done)); 
     300    const pj_uint8_t PUT_FRM_DONE = 1; 
     301 
     302    pj_bzero(tee->put_frm_flag, tee->dst_port_cnt * 
     303                                sizeof(tee->put_frm_flag[0])); 
    301304 
    302305    for (i = 0; i < tee->dst_port_cnt; ++i) { 
    303306        pjmedia_frame frame_ = *frame; 
    304307 
    305         if (done[i]) 
     308        if (tee->put_frm_flag[i]) 
    306309            continue; 
    307310         
     
    328331            pjmedia_frame framep; 
    329332             
    330             if (done[j] || 
     333            if (tee->put_frm_flag[j] || 
    331334                (tee->dst_ports[j].dst->info.fmt.id !=  
    332335                 tee->dst_ports[i].dst->info.fmt.id) || 
     
    353356            /* Deliver the data */ 
    354357            pjmedia_port_put_frame(tee->dst_ports[j].dst, &framep); 
    355             done[j] = PJ_TRUE; 
     358            tee->put_frm_flag[j] = PUT_FRM_DONE; 
    356359             
    357360            if (!tee->tee_conv[i].conv) 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c

    r3724 r3725  
    2424#if PJSUA_HAS_VIDEO 
    2525 
     26#define VID_TEE_MAX_PORT    (PJSUA_MAX_CALLS + 1) 
     27 
    2628static void free_vid_win(pjsua_vid_win_id wid); 
    2729 
     
    406408 
    407409        /* Create video tee */ 
    408         status = pjmedia_vid_tee_create(w->pool, fmt, 2, &w->tee); 
     410        status = pjmedia_vid_tee_create(w->pool, fmt, VID_TEE_MAX_PORT, 
     411                                        &w->tee); 
    409412        if (status != PJ_SUCCESS) 
    410413            goto on_error; 
Note: See TracChangeset for help on using the changeset viewer.