Changeset 3995
- Timestamp:
- Mar 29, 2012 10:54:01 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/vid_codec_util.c
r3715 r3995 150 150 151 151 152 static unsigned fps_to_mpi(const pjmedia_ratio *fps) 153 { 154 unsigned mpi; 155 156 /* Original formula = (fps->denum * 30000) / (fps->num * 1001) */ 157 mpi = (fps->denum*30000 + fps->num*1001/2) / (fps->num*1001); 158 159 /* Normalize, should be in the range of 1-32 */ 160 if (mpi > 32) mpi = 32; 161 if (mpi < 1) mpi = 1; 162 163 return mpi; 164 }; 165 152 166 PJ_DEF(pj_status_t) pjmedia_vid_codec_h263_apply_fmtp( 153 167 pjmedia_vid_codec_param *param) … … 160 174 pj_status_t status; 161 175 176 vfd = pjmedia_format_get_video_format_detail(¶m->enc_fmt, 177 PJ_TRUE); 178 162 179 /* Get local param */ 163 status = pjmedia_vid_codec_parse_h263_fmtp(¶m->dec_fmtp, 164 &fmtp_loc); 165 if (status != PJ_SUCCESS) 166 return status; 180 // Local param should be fetched from "param->enc_fmt" instead of 181 // "param->dec_fmtp". 182 //status = pjmedia_vid_codec_parse_h263_fmtp(¶m->dec_fmtp, 183 // &fmtp_loc); 184 //if (status != PJ_SUCCESS) 185 // return status; 186 fmtp_loc.mpi_cnt = 1; 187 fmtp_loc.mpi[0].size = vfd->size; 188 fmtp_loc.mpi[0].val = fps_to_mpi(&vfd->fps); 167 189 168 190 /* Get remote param */ … … 178 200 size.h = 144; 179 201 mpi = 1; 180 } else if (fmtp_loc.mpi_cnt == 0) {181 /* Local MPI setting not set, just use remote preference. */182 size = fmtp_rem.mpi[0].size;183 mpi = fmtp_rem.mpi[0].val;202 //} else if (fmtp_loc.mpi_cnt == 0) { 203 // /* Local MPI setting not set, just use remote preference. */ 204 // size = fmtp_rem.mpi[0].size; 205 // mpi = fmtp_rem.mpi[0].val; 184 206 } else { 185 207 /* Both have preferences, let's try to match them */ … … 220 242 221 243 /* Apply the negotiation result */ 222 vfd = pjmedia_format_get_video_format_detail(¶m->enc_fmt,223 PJ_TRUE);224 244 vfd->size = size; 225 245 vfd->fps.num = 30000;
Note: See TracChangeset
for help on using the changeset viewer.