Changeset 4027


Ignore:
Timestamp:
Apr 5, 2012 8:38:49 AM (12 years ago)
Author:
nanang
Message:

Misc (Re #1446): Add pjsua app video command for modifying video codec size/resolution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r4025 r4027  
    35953595    puts("| vid codec fps ID NUM DEN  Set codec ID framerate to (NUM/DEN) fps           |"); 
    35963596    puts("| vid codec bw ID AVG MAX   Set codec ID bitrate to AVG & MAX kbps            |"); 
     3597    puts("| vid codec size ID W H     Set codec ID size/resolution to W x H             |"); 
    35973598    puts("| vid win list              List all active video windows                     |"); 
    35983599    puts("| vid win arrange           Auto arrange windows                              |"); 
     
    42624263                unsigned i; 
    42634264                PJ_LOG(3,(THIS_FILE, "Found %d video codecs:", count)); 
    4264                 PJ_LOG(3,(THIS_FILE, "codec id      prio  fps   br(kbps)")); 
    4265                 PJ_LOG(3,(THIS_FILE, "----------------------------------")); 
     4265                PJ_LOG(3,(THIS_FILE, "codec id      prio  fps    bw(kbps)   size")); 
     4266                PJ_LOG(3,(THIS_FILE, "------------------------------------------")); 
    42664267                for (i=0; i<count; ++i) { 
    42674268                    pjmedia_vid_codec_param cp; 
     
    42744275                    vfd = pjmedia_format_get_video_format_detail(&cp.enc_fmt, 
    42754276                                                                 PJ_TRUE); 
    4276                     PJ_LOG(3,(THIS_FILE, "%.*s%.*s %3d %7.2f %d/%d",  
     4277                    PJ_LOG(3,(THIS_FILE, "%.*s%.*s %3d %7.2f  %4d/%4d  %dx%d",  
    42774278                              (int)ci[i].codec_id.slen, ci[i].codec_id.ptr, 
    42784279                              13-(int)ci[i].codec_id.slen, "                ", 
    42794280                              ci[i].priority, 
    42804281                              (vfd->fps.num*1.0/vfd->fps.denum), 
    4281                               vfd->avg_bps/1000, vfd->max_bps/1000)); 
     4282                              vfd->avg_bps/1000, vfd->max_bps/1000, 
     4283                              vfd->size.w, vfd->size.h)); 
    42824284                } 
    42834285            } 
     
    43164318                cp.enc_fmt.det.vid.avg_bps = M * 1000; 
    43174319                cp.enc_fmt.det.vid.max_bps = N * 1000; 
     4320                status = pjsua_vid_codec_set_param(&cid, &cp); 
     4321            } 
     4322            if (status != PJ_SUCCESS) 
     4323                PJ_PERROR(1,(THIS_FILE, status, "Set codec bitrate error")); 
     4324        } else if (argc==6 && strcmp(argv[2], "size")==0) { 
     4325            pjmedia_vid_codec_param cp; 
     4326            pj_str_t cid; 
     4327            int M, N; 
     4328            cid = pj_str(argv[3]); 
     4329            M = atoi(argv[4]); 
     4330            N = atoi(argv[5]); 
     4331            status = pjsua_vid_codec_get_param(&cid, &cp); 
     4332            if (status == PJ_SUCCESS) { 
     4333                cp.enc_fmt.det.vid.size.w = M; 
     4334                cp.enc_fmt.det.vid.size.h = N; 
    43184335                status = pjsua_vid_codec_set_param(&cid, &cp); 
    43194336            } 
Note: See TracChangeset for help on using the changeset viewer.