Changeset 5149
- Timestamp:
- Aug 6, 2015 7:10:33 AM (9 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/vid_port.c
r5057 r5149 888 888 if (event->type == PJMEDIA_EVENT_FMT_CHANGED) { 889 889 const pjmedia_video_format_detail *vfd; 890 const pjmedia_video_format_detail *vfd_cur; 890 891 pjmedia_vid_dev_param vid_param; 891 892 pj_status_t status; 892 893 894 /* Retrieve the current video format detail */ 895 pjmedia_vid_dev_stream_get_param(vp->strm, &vid_param); 896 vfd_cur = pjmedia_format_get_video_format_detail( 897 &vid_param.fmt, PJ_TRUE); 898 if (!vfd_cur) 899 return PJMEDIA_EVID_BADFORMAT; 900 901 /* Retrieve the new video format detail */ 902 vfd = pjmedia_format_get_video_format_detail( 903 &event->data.fmt_changed.new_fmt, PJ_TRUE); 904 if (!vfd || !vfd->fps.num || !vfd->fps.denum) 905 return PJMEDIA_EVID_BADFORMAT; 906 907 /* Ticket #1876: if this is a passive renderer and only frame rate is 908 * changing, simply modify the clock. 909 */ 910 if (vp->dir == PJMEDIA_DIR_RENDER && 911 vp->stream_role == ROLE_PASSIVE && vp->role == ROLE_ACTIVE) 912 { 913 pj_bool_t fps_only; 914 pjmedia_video_format_detail tmp_vfd; 915 916 tmp_vfd = *vfd_cur; 917 tmp_vfd.fps = vfd->fps; 918 fps_only = pj_memcmp(vfd, &tmp_vfd, sizeof(*vfd)) == 0; 919 if (fps_only) { 920 pjmedia_clock_param clock_param; 921 clock_param.usec_interval = PJMEDIA_PTIME(&vfd->fps); 922 clock_param.clock_rate = vid_param.clock_rate; 923 pjmedia_clock_modify(vp->clock, &clock_param); 924 925 return pjmedia_event_publish(NULL, vp, event, 926 PJMEDIA_EVENT_PUBLISH_POST_EVENT); 927 } 928 } 929 893 930 /* Ticket #1827: 894 931 * Stopping video port should not be necessary here because … … 900 937 pjmedia_vid_dev_stream_stop(vp->strm); 901 938 902 /* Retrieve the video format detail */903 vfd = pjmedia_format_get_video_format_detail(904 &event->data.fmt_changed.new_fmt, PJ_TRUE);905 if (!vfd || !vfd->fps.num || !vfd->fps.denum)906 return PJMEDIA_EVID_BADFORMAT;907 908 939 /* Change the destination format to the new format */ 909 940 pjmedia_format_copy(&vp->conv.conv_param.src, … … 919 950 } 920 951 921 pjmedia_vid_dev_stream_get_param(vp->strm, &vid_param);922 952 if (vid_param.fmt.id != vp->conv.conv_param.dst.id || 923 953 (vid_param.fmt.det.vid.size.h != -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r4848 r5149 978 978 /* Adjust renderer window size to original video size */ 979 979 pjsua_call_info ci; 980 pjsua_vid_win_id wid;981 pjmedia_rect_size size;982 980 983 981 pjsua_call_get_info(call_id, &ci); … … 986 984 (ci.media[med_idx].dir & PJMEDIA_DIR_DECODING)) 987 985 { 986 pjsua_vid_win_id wid; 987 pjmedia_rect_size size; 988 pjsua_vid_win_info win_info; 989 988 990 wid = ci.media[med_idx].stream.vid.win_in; 991 pjsua_vid_win_get_info(wid, &win_info); 992 989 993 size = event->data.fmt_changed.new_fmt.det.vid.size; 990 pjsua_vid_win_set_size(wid, &size); 991 } 992 993 /* Re-arrange video windows */ 994 arrange_window(PJSUA_INVALID_ID); 994 if (size.w != win_info.size.w || size.h != win_info.size.h) { 995 pjsua_vid_win_set_size(wid, &size); 996 997 /* Re-arrange video windows */ 998 arrange_window(PJSUA_INVALID_ID); 999 } 1000 } 995 1001 } 996 1002 #else
Note: See TracChangeset
for help on using the changeset viewer.