Ignore:
Timestamp:
Feb 24, 2011 7:47:55 AM (10 years ago)
Author:
nanang
Message:

Re #1182:

  • Added video stream interface in vid_stream.h, the video stream will be able to handle different video formats in encoding and decoding direction.
  • Renamed video device stream class identifiers from 'pjmedia_vid_stream*' to 'pjmedia_vid_dev_stream*' as 'pjmedia_vid_stream' is used by video stream interface.
  • Added ffmpeg video capability to be able to parse SDP format param for H263 and also decide video format for encoding direction based on remote preference and local format-capability setting.
  • Added some new APIs in jitter buffer for handling video stream: pjmedia_jbuf_put_frame3(), pjmedia_jbuf_get_frame3(), pjmedia_jbuf_peek_frame(), and pjmedia_jbuf_remove_frame().
  • Moved pjmedia_stream_info_from_sdp() from session to stream
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/videoport.c

    r3402 r3420  
    3838    pjmedia_dir          dir; 
    3939    pjmedia_rect_size    cap_size; 
    40     pjmedia_vid_stream  *strm; 
     40    pjmedia_vid_dev_stream      *strm; 
    4141    pjmedia_vid_cb       strm_cb; 
    4242    void                *strm_cb_data; 
     
    7575}; 
    7676 
    77 static pj_status_t vidstream_cap_cb(pjmedia_vid_stream *stream, 
     77static pj_status_t vidstream_cap_cb(pjmedia_vid_dev_stream *stream, 
    7878                                    void *user_data, 
    7979                                    pjmedia_frame *frame); 
    80 static pj_status_t vidstream_render_cb(pjmedia_vid_stream *stream, 
     80static pj_status_t vidstream_render_cb(pjmedia_vid_dev_stream *stream, 
    8181                                       void *user_data, 
    8282                                       pjmedia_frame *frame); 
    83 static pj_status_t vidstream_event_cb(pjmedia_vid_stream *stream, 
     83static pj_status_t vidstream_event_cb(pjmedia_vid_dev_stream *stream, 
    8484                                      void *user_data, 
    8585                                      pjmedia_vid_event *event); 
     
    171171    vid_cb.on_event_cb = &vidstream_event_cb; 
    172172 
    173     status = pjmedia_vid_stream_create(&prm->vidparam, &vid_cb, vp, 
    174                                        &vp->strm); 
     173    status = pjmedia_vid_dev_stream_create(&prm->vidparam, &vid_cb, vp, 
     174                                           &vp->strm); 
    175175    if (status != PJ_SUCCESS) 
    176176        goto on_error; 
     
    278278} 
    279279 
    280 PJ_DEF(pjmedia_vid_stream*) 
     280PJ_DEF(pjmedia_vid_dev_stream*) 
    281281pjmedia_vid_port_get_stream(pjmedia_vid_port *vp) 
    282282{ 
     
    357357    PJ_ASSERT_RETURN(vp, PJ_EINVAL); 
    358358 
    359     status = pjmedia_vid_stream_start(vp->strm); 
     359    status = pjmedia_vid_dev_stream_start(vp->strm); 
    360360    if (status != PJ_SUCCESS) 
    361361        goto on_error; 
     
    386386    PJ_ASSERT_RETURN(vp, PJ_EINVAL); 
    387387 
    388     status = pjmedia_vid_stream_stop(vp->strm); 
     388    status = pjmedia_vid_dev_stream_stop(vp->strm); 
    389389 
    390390    if (vp->enc_clock) { 
     
    414414    } 
    415415    if (vp->strm) { 
    416         pjmedia_vid_stream_destroy(vp->strm); 
     416        pjmedia_vid_dev_stream_destroy(vp->strm); 
    417417        vp->strm = NULL; 
    418418    } 
     
    478478        return; 
    479479 
    480     status = pjmedia_vid_stream_get_frame(vp->strm, vp->enc_frm_buf); 
     480    status = pjmedia_vid_dev_stream_get_frame(vp->strm, vp->enc_frm_buf); 
    481481    if (status != PJ_SUCCESS) 
    482482        return; 
     
    581581                } else 
    582582                    vp->rend_sync_clocksrc.nsync_progress += ndrop; 
     583 
    583584                for (i = 0; i < ndrop; i++) { 
    584585                    status = pjmedia_port_get_frame(vp->client_port, 
     
    603604    pjmedia_clock_src_update(&vp->rend_clocksrc, NULL); 
    604605 
    605     status = pjmedia_vid_stream_put_frame(vp->strm, vp->dec_frm_buf); 
     606    status = pjmedia_vid_dev_stream_put_frame(vp->strm, vp->dec_frm_buf); 
    606607} 
    607608 
     
    615616} 
    616617 
    617 static pj_status_t vidstream_cap_cb(pjmedia_vid_stream *stream, 
     618static pj_status_t vidstream_cap_cb(pjmedia_vid_dev_stream *stream, 
    618619                                    void *user_data, 
    619620                                    pjmedia_frame *frame) 
     
    634635} 
    635636 
    636 static pj_status_t vidstream_render_cb(pjmedia_vid_stream *stream, 
     637static pj_status_t vidstream_render_cb(pjmedia_vid_dev_stream *stream, 
    637638                                       void *user_data, 
    638639                                       pjmedia_frame *frame) 
     
    653654} 
    654655 
    655 static pj_status_t vidstream_event_cb(pjmedia_vid_stream *stream, 
     656static pj_status_t vidstream_event_cb(pjmedia_vid_dev_stream *stream, 
    656657                                      void *user_data, 
    657658                                      pjmedia_vid_event *event) 
     
    671672 
    672673    if (vp->stream_role==ROLE_PASSIVE) { 
    673         return pjmedia_vid_stream_put_frame(vp->strm, frame); 
     674        return pjmedia_vid_dev_stream_put_frame(vp->strm, frame); 
    674675    } else { 
    675676        pj_mutex_lock(vp->dec_frm_mutex); 
     
    688689 
    689690    if (vp->stream_role==ROLE_PASSIVE) { 
    690         return pjmedia_vid_stream_get_frame(vp->strm, frame); 
     691        return pjmedia_vid_dev_stream_get_frame(vp->strm, frame); 
    691692    } else { 
    692693        pj_mutex_lock(vp->enc_frm_mutex); 
Note: See TracChangeset for help on using the changeset viewer.