Changeset 6046
- Timestamp:
- Jul 29, 2019 2:25:34 AM (5 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/format.h
r4994 r6046 177 177 PJMEDIA_FORMAT_YV12 = PJMEDIA_FORMAT_PACK('Y', 'V', '1', '2'), 178 178 179 /** 180 * This is planar 4:2:0/12bpp YUV format, the data can be treated as 181 * two planes of color components, where the first plane contains 182 * only the Y samples, the second plane contains interleaved 183 * U (Cb) - V (Cr) samples. 184 */ 185 PJMEDIA_FORMAT_NV12 = PJMEDIA_FORMAT_PACK('N', 'V', '1', '2'), 186 179 187 /** 180 188 * This is planar 4:2:0/12bpp YUV format, the data can be treated as -
pjproject/trunk/pjmedia/src/pjmedia/ffmpeg_util.c
r5306 r6046 48 48 { PJMEDIA_FORMAT_I420JPEG, AV(PIX_FMT_YUVJ420P)}, 49 49 { PJMEDIA_FORMAT_I422JPEG, AV(PIX_FMT_YUVJ422P)}, 50 { PJMEDIA_FORMAT_NV12, AV(PIX_FMT_NV12)}, 51 { PJMEDIA_FORMAT_NV21, AV(PIX_FMT_NV21)}, 50 52 }; 51 53 -
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.