- Timestamp:
- Mar 1, 2011 3:55:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/test/vid_dev_test.c
r3425 r3431 144 144 145 145 /* Sleep while the webcam is being displayed... */ 146 for (i = 0; i < 50 && (!is_quitting); i++) { 146 for (i = 0; i < 15 && (!is_quitting); i++) { 147 #if VID_DEV_TEST_MAC_OS 148 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); 149 #endif 150 pj_thread_sleep(100); 151 } 152 153 /** 154 * Test the renderer's format capability if the device 155 * supports it. 156 */ 157 if (pjmedia_vid_dev_stream_get_cap(pjmedia_vid_port_get_stream(renderer), 158 PJMEDIA_VID_DEV_CAP_FORMAT, 159 ¶m.vidparam.fmt) == PJ_SUCCESS) 160 { 161 status = pjmedia_vid_port_stop(capture); 162 if (status != PJ_SUCCESS) { 163 rc = 170; goto on_return; 164 } 165 status = pjmedia_vid_port_disconnect(capture); 166 if (status != PJ_SUCCESS) { 167 rc = 180; goto on_return; 168 } 169 pjmedia_vid_port_destroy(capture); 170 171 param.vidparam.dir = PJMEDIA_DIR_CAPTURE; 172 param.active = PJ_TRUE; 173 pjmedia_format_init_video(¶m.vidparam.fmt, param.vidparam.fmt.id, 174 640, 480, 175 vfd->fps.num, vfd->fps.denum); 176 vfd = pjmedia_format_get_video_format_detail(¶m.vidparam.fmt, 177 PJ_TRUE); 178 if (vfd == NULL) { 179 rc = 185; goto on_return; 180 } 181 182 status = pjmedia_vid_port_create(pool, ¶m, &capture); 183 if (status != PJ_SUCCESS) { 184 rc = 190; goto on_return; 185 } 186 187 status = pjmedia_vid_port_connect( 188 capture, 189 pjmedia_vid_port_get_passive_port(renderer), 190 PJ_FALSE); 191 if (status != PJ_SUCCESS) { 192 rc = 200; goto on_return; 193 } 194 195 status = pjmedia_vid_dev_stream_set_cap( 196 pjmedia_vid_port_get_stream(renderer), 197 PJMEDIA_VID_DEV_CAP_FORMAT, 198 ¶m.vidparam.fmt); 199 if (status != PJ_SUCCESS) { 200 rc = 205; goto on_return; 201 } 202 203 status = pjmedia_vid_port_start(capture); 204 if (status != PJ_SUCCESS) { 205 rc = 210; goto on_return; 206 } 207 } 208 209 for (i = 0; i < 35 && (!is_quitting); i++) { 147 210 #if VID_DEV_TEST_MAC_OS 148 211 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
Note: See TracChangeset
for help on using the changeset viewer.