Changeset 4854
- Timestamp:
- Jun 4, 2014 3:48:28 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/vid_codec_util.c
r4815 r4854 601 601 const pjmedia_ratio *fps, 602 602 const pjmedia_ratio *ratio, 603 pjmedia_rect_size *size) 603 pjmedia_rect_size *size, 604 pj_bool_t is_decoding) 604 605 { 605 606 pjmedia_ratio def_ratio = { DEFAULT_H264_RATIO_NUM, … … 647 648 size->w = asp_ratio.num * scale * 16; 648 649 size->h = asp_ratio.denum * scale * 16; 650 651 /* #1769: for decoding, size is usually used for allocating buffer, 652 * so we need to make sure that frame size is not less than max_fs. 653 */ 654 if (is_decoding && ((size->w * size->h) >> 8) < max_fs) { 655 /* Size is less than max_fs, recalculate using ratio 1:1 and 656 * round up the scale. 657 */ 658 scale = pj_isqrt(max_fs) + 1; 659 size->w = size->h = scale * 16; 660 } 649 661 650 662 return PJ_SUCCESS; … … 687 699 r.num = vfd->size.w; 688 700 r.denum = vfd->size.h; 689 find_highest_res(&fmtp, &vfd->fps, &r, &vfd->size );701 find_highest_res(&fmtp, &vfd->fps, &r, &vfd->size, PJ_FALSE); 690 702 } 691 703 } else { … … 694 706 r.num = vfd->size.w; 695 707 r.denum = vfd->size.h; 696 find_highest_res(&fmtp, &vfd->fps, &r, &vfd->size );708 find_highest_res(&fmtp, &vfd->fps, &r, &vfd->size, PJ_FALSE); 697 709 } 698 710 … … 733 745 r.num = vfd->size.w; 734 746 r.denum = vfd->size.h; 735 find_highest_res(&fmtp, &vfd->fps, &r, &highest_size );747 find_highest_res(&fmtp, &vfd->fps, &r, &highest_size, PJ_TRUE); 736 748 if (vfd->size.w * vfd->size.h < highest_size.w * highest_size.h) 737 749 vfd->size = highest_size;
Note: See TracChangeset
for help on using the changeset viewer.