Changeset 5862 for pjproject


Ignore:
Timestamp:
Aug 20, 2018 5:30:01 AM (6 years ago)
Author:
nanang
Message:

Close #2103: Initiate video port frame buffer with black for I420 & YV12 formats.

File:
1 edited

Legend:

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

    r5789 r5862  
    664664        vp->frm_buf = PJ_POOL_ZALLOC_T(pool, pjmedia_frame); 
    665665        vp->frm_buf_size = vafp.framebytes; 
    666         vp->frm_buf->buf = pj_pool_alloc(pool, vafp.framebytes); 
     666        vp->frm_buf->buf = pj_pool_zalloc(pool, vafp.framebytes); 
    667667        vp->frm_buf->size = vp->frm_buf_size; 
    668668        vp->frm_buf->type = PJMEDIA_FRAME_TYPE_NONE; 
     669 
     670        /* Black initial render screen for I420/YV12 format */ 
     671        if ((vp->dir & PJMEDIA_DIR_RENDER) && 
     672            (prm->vidparam.fmt.id == PJMEDIA_FORMAT_I420 || 
     673             prm->vidparam.fmt.id == PJMEDIA_FORMAT_YV12)) 
     674        { 
     675            pj_memset(vp->frm_buf->buf, 16, vafp.plane_bytes[0]); 
     676            pj_memset((pj_uint8_t*)vp->frm_buf->buf + vafp.plane_bytes[0], 
     677                      0x80, vafp.plane_bytes[1] * 2); 
     678        } 
    669679 
    670680        status = pj_mutex_create_simple(pool, vp->dev_name.ptr, 
Note: See TracChangeset for help on using the changeset viewer.