Changeset 6046 for pjproject/trunk/pjmedia/src/pjmedia/format.c
- Timestamp:
- Jul 29, 2019 2:25:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/format.c
r5642 r6046 64 64 pjmedia_video_apply_fmt_param *aparam); 65 65 66 static pj_status_t apply_biplanar_420(const pjmedia_video_format_info *fi, 67 pjmedia_video_apply_fmt_param *aparam); 68 66 69 struct pjmedia_video_format_mgr 67 70 { … … 88 91 {PJMEDIA_FORMAT_I420JPEG, "I420JPG", PJMEDIA_COLOR_MODEL_YUV, 12, 3, &apply_planar_420}, 89 92 {PJMEDIA_FORMAT_I422JPEG, "I422JPG", PJMEDIA_COLOR_MODEL_YUV, 16, 3, &apply_planar_422}, 93 {PJMEDIA_FORMAT_NV12, "NV12", PJMEDIA_COLOR_MODEL_YUV, 12, 2, &apply_biplanar_420}, 94 {PJMEDIA_FORMAT_NV21, "NV21", PJMEDIA_COLOR_MODEL_YUV, 12, 2, &apply_biplanar_420}, 90 95 }; 91 96 … … 261 266 return PJ_SUCCESS; 262 267 } 268 269 static pj_status_t apply_biplanar_420(const pjmedia_video_format_info *fi, 270 pjmedia_video_apply_fmt_param *aparam) 271 { 272 unsigned i; 273 pj_size_t Y_bytes; 274 275 PJ_UNUSED_ARG(fi); 276 277 /* Calculate memsize */ 278 Y_bytes = (pj_size_t)(aparam->size.w * aparam->size.h); 279 aparam->framebytes = Y_bytes + (Y_bytes>>1); 280 281 /* Planar formats use 2 plane */ 282 aparam->strides[0] = aparam->size.w; 283 aparam->strides[1] = aparam->size.w; 284 285 aparam->planes[0] = aparam->buffer; 286 aparam->planes[1] = aparam->planes[0] + Y_bytes; 287 288 aparam->plane_bytes[0] = Y_bytes; 289 aparam->plane_bytes[1] = (Y_bytes>>1); 290 291 /* Zero unused planes */ 292 for (i=2; i<PJMEDIA_MAX_VIDEO_PLANES; ++i) { 293 aparam->strides[i] = 0; 294 aparam->planes[i] = NULL; 295 aparam->plane_bytes[i] = 0; 296 } 297 298 return PJ_SUCCESS; 299 } 300 263 301 264 302 PJ_DEF(pj_status_t)
Note: See TracChangeset
for help on using the changeset viewer.