Ignore:
Timestamp:
Jul 15, 2009 5:55:16 PM (15 years ago)
Author:
nanang
Message:

Ticket #919:

  • Added default ilbc mode into codec passthrough setting.
  • Added iLBC mode 'negotiation' in iLBC codec_open().
  • Updated stream_create() to prioritize codec_open(), that may update the codec params, over stream initializations involving codec params.
File:
1 edited

Legend:

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

    r2761 r2834  
    16741674    stream->port.info.channel_count = info->fmt.channel_cnt; 
    16751675    stream->port.port_data.pdata = stream; 
    1676     if (info->param==NULL || info->param->info.fmt_id == PJMEDIA_FORMAT_L16) { 
    1677         stream->port.info.format.id = PJMEDIA_FORMAT_L16; 
    1678  
    1679         stream->port.put_frame = &put_frame; 
    1680         stream->port.get_frame = &get_frame; 
    1681     } else { 
    1682         stream->port.info.format.id = info->param->info.fmt_id; 
    1683         stream->port.info.format.bitrate = info->param->info.avg_bps; 
    1684         stream->port.info.format.vad = (info->param->setting.vad != 0); 
    1685  
    1686         stream->port.put_frame = &put_frame; 
    1687         stream->port.get_frame = &get_frame_ext; 
    1688     } 
    1689  
    16901676 
    16911677    /* Init stream: */ 
     
    17461732        stream->codec_param.setting.frm_per_pkt = 1; 
    17471733 
    1748     /* Set additional info. */ 
     1734    /* Open the codec. */ 
     1735    status = stream->codec->op->open(stream->codec, &stream->codec_param); 
     1736    if (status != PJ_SUCCESS) 
     1737        goto err_cleanup; 
     1738 
     1739    /* Set additional info and callbacks. */ 
    17491740    stream->port.info.bits_per_sample = 16; 
    17501741    stream->port.info.samples_per_frame = info->fmt.clock_rate *  
     
    17631754    } 
    17641755 
    1765     /* Open the codec: */ 
    1766  
    1767     status = stream->codec->op->open(stream->codec, &stream->codec_param); 
    1768     if (status != PJ_SUCCESS) 
    1769         goto err_cleanup; 
     1756    stream->port.info.format.id = stream->codec_param.info.fmt_id; 
     1757    if (stream->codec_param.info.fmt_id == PJMEDIA_FORMAT_L16) { 
     1758        stream->port.put_frame = &put_frame; 
     1759        stream->port.get_frame = &get_frame; 
     1760    } else { 
     1761        stream->port.info.format.bitrate = stream->codec_param.info.avg_bps; 
     1762        stream->port.info.format.vad = (stream->codec_param.setting.vad != 0); 
     1763        stream->port.put_frame = &put_frame; 
     1764        stream->port.get_frame = &get_frame_ext; 
     1765    } 
    17701766 
    17711767    /* If encoder and decoder's ptime are asymmetric, then we need to 
Note: See TracChangeset for help on using the changeset viewer.