Changeset 5939 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
- Timestamp:
- Mar 5, 2019 6:23:02 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c
r5834 r5939 297 297 puts("| vid win move ID X Y Move window ID to position X,Y |"); 298 298 puts("| vid win resize ID w h Resize window ID to the specified width, height |"); 299 puts("| vid conf list List all video ports in video conference bridge |"); 300 puts("| vid conf cc P Q Connect port P to Q in the video conf bridge |"); 301 puts("| vid conf cd P Q Disconnect port P to Q in the video conf bridge |"); 299 302 puts("+=============================================================================+"); 300 303 printf("| Video will be %s in the next offer/answer %s |\n", … … 592 595 } else 593 596 goto on_error; 597 } else if (strcmp(argv[1], "conf")==0) { 598 pj_status_t status; 599 600 if (argc==3 && strcmp(argv[2], "list")==0) { 601 pjsua_conf_port_id id[100]; 602 unsigned count = PJ_ARRAY_SIZE(id); 603 604 status = pjsua_vid_conf_enum_ports(id, &count); 605 if (status != PJ_SUCCESS) { 606 PJ_PERROR(1,(THIS_FILE, status, 607 "Failed enumerating video conf bridge ports")); 608 } else { 609 unsigned i; 610 printf(" Video conference has %d ports:\n", count); 611 printf(" id name format rx tx \n"); 612 printf(" ------------------------------------------------------------------\n"); 613 for (i=0; i<count; ++i) { 614 char li_list[PJSUA_MAX_CALLS*4]; 615 char tr_list[PJSUA_MAX_CALLS*4]; 616 char s[32]; 617 unsigned j; 618 pjsua_vid_conf_port_info info; 619 pjmedia_rect_size *size; 620 pjmedia_ratio *fps; 621 622 pjsua_vid_conf_get_port_info(id[i], &info); 623 size = &info.format.det.vid.size; 624 fps = &info.format.det.vid.fps; 625 626 li_list[0] = '\0'; 627 for (j=0; j<info.listener_cnt; ++j) { 628 char s[10]; 629 pj_ansi_snprintf(s, sizeof(s), "%d%s", 630 info.listeners[j], 631 (j==info.listener_cnt-1)?"":","); 632 pj_ansi_strcat(li_list, s); 633 } 634 tr_list[0] = '\0'; 635 for (j=0; j<info.transmitter_cnt; ++j) { 636 char s[10]; 637 pj_ansi_snprintf(s, sizeof(s), "%d%s", 638 info.transmitters[j], 639 (j==info.transmitter_cnt-1)?"":","); 640 pj_ansi_strcat(tr_list, s); 641 } 642 pjmedia_fourcc_name(info.format.id, s); 643 s[4] = ' '; 644 pj_ansi_snprintf(s+5, sizeof(s)-5, "%dx%d@%.1f", 645 size->w, size->h, 646 (float)(fps->num*1.0/fps->denum)); 647 printf("%3d %.*s%.*s %s%.*s %s%.*s %s\n", 648 id[i], 649 (int)info.name.slen, info.name.ptr, 650 22-(int)info.name.slen, " ", 651 s, 652 20-pj_ansi_strlen(s), " ", 653 tr_list, 654 12-pj_ansi_strlen(tr_list), " ", 655 li_list); 656 } 657 } 658 } else if (argc==5 && strcmp(argv[2], "cc")==0) { 659 int P, Q; 660 P = atoi(argv[3]); 661 Q = atoi(argv[4]); 662 pjsua_vid_conf_connect(P, Q, NULL); 663 } else if (argc==5 && strcmp(argv[2], "cd")==0) { 664 int P, Q; 665 P = atoi(argv[3]); 666 Q = atoi(argv[4]); 667 pjsua_vid_conf_disconnect(P, Q); 668 } else { 669 goto on_error; 670 } 594 671 } else 595 672 goto on_error;
Note: See TracChangeset
for help on using the changeset viewer.