Changeset 246:92c065266a1d in mediastreamer2


Ignore:
Timestamp:
Feb 9, 2009 2:28:37 PM (4 years ago)
Author:
smorlat <smorlat@…>
Branch:
default
Message:

sends more I frames at the beginning of the call.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@249 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

File:
1 edited

Legend:

Unmodified
Added
Removed
  • linphone/mediastreamer2/src/videoenc.c

    r205 r246  
    6060        int maxbr; 
    6161        int qmin; 
     62        uint32_t framenum; 
    6263        bool_t req_vfu; 
    6364}EncState; 
     
    163164        s->qmin=2; 
    164165        s->req_vfu=FALSE; 
     166        s->framenum=0; 
    165167        s->av_context.codec=NULL; 
    166168} 
     
    459461        mblk_t *comp_buf=s->comp_buf; 
    460462        int comp_buf_sz=comp_buf->b_datap->db_lim-comp_buf->b_datap->db_base; 
    461          
     463 
    462464        /* convert image if necessary */ 
    463465        avcodec_get_frame_defaults(&pict); 
     
    466468        /* timestamp used by ffmpeg, unset here */ 
    467469        pict.pts=AV_NOPTS_VALUE; 
     470                 
     471        if (s->framenum==(int)s->fps*2 || s->framenum==(int)s->fps*4){ 
     472                /*sends an I frame at 2 seconds and 4 seconds after the beginning of the call*/ 
     473                s->req_vfu=TRUE; 
     474        } 
    468475        if (s->req_vfu){ 
    469476                pict.pict_type=FF_I_TYPE; 
     
    481488        if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error); 
    482489        else{ 
     490                s->framenum++; 
    483491                if (c->coded_frame->pict_type==FF_I_TYPE){ 
    484492                        ms_message("Emitting I-frame"); 
Note: See TracChangeset for help on using the changeset viewer.