Ignore:
Timestamp:
Apr 12, 2011 6:24:19 PM (9 years ago)
Author:
nanang
Message:

Re #1219:

  • Implemented validation of H.264 level in codec param.
  • Update H.264 packetization setting to always send single NAL unit, for better compatibility.
  • Update H.264 SDP custom negotiation to be permissive.
File:
1 edited

Legend:

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

    r3522 r3526  
    261261              {{"QCIF",4},  {"1",1}}, } }, 
    262262    }, 
    263 /* 
    264263    { 
    265264        {PJMEDIA_FORMAT_H263, PJMEDIA_RTP_PT_H263, {"H263",4}}, 
     
    269268              {{"QCIF",4},  {"1",1}}, } }, 
    270269    }, 
    271 */ 
    272270    { 
    273271        {PJMEDIA_FORMAT_H263,   PJMEDIA_RTP_PT_H263,    {"H263",4}}, 
     
    313311    /* Create packetizer */ 
    314312    pktz_cfg.mtu = ff->param.enc_mtu; 
     313#if 0 
    315314    if (data->fmtp.packetization_mode == 0) 
    316315        pktz_cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL; 
     
    319318    else 
    320319        return PJ_ENOTSUP; 
     320#else 
     321    if (data->fmtp.packetization_mode!= 
     322                                PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL && 
     323        data->fmtp.packetization_mode!= 
     324                                PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED) 
     325    { 
     326        return PJ_ENOTSUP; 
     327    } 
     328    /* Better always send in single NAL mode for better compatibility */ 
     329    pktz_cfg.mode = PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL; 
     330#endif 
    321331 
    322332    status = pjmedia_h264_packetizer_create(ff->pool, &pktz_cfg, &data->pktz); 
     333    if (status != PJ_SUCCESS) 
     334        return status; 
     335 
     336    /* Apply SDP fmtp to format in codec param */ 
     337    status = pjmedia_vid_codec_h264_apply_fmtp(&ff->param); 
    323338    if (status != PJ_SUCCESS) 
    324339        return status; 
     
    354369 
    355370        /* Apply profile level. */ 
    356         PJ_TODO(apply_h264_profile_level_in_pjmedia_vid_codec_param); 
    357371        ctx->level    = data->fmtp.level; 
    358372 
     
    12461260    int out_buf_len = output_buf_len; 
    12471261    int err; 
    1248     AVRational src_timebase; 
     1262    //AVRational src_timebase; 
    12491263    /* For some reasons (e.g: SSE/MMX usage), the avcodec_encode_video() must 
    12501264     * have stack aligned to 16 bytes. Let's try to be safe by preparing the 
Note: See TracChangeset for help on using the changeset viewer.