Ignore:
Timestamp:
Apr 22, 2014 5:04:43 AM (8 years ago)
Author:
ming
Message:

Closed #1757: iOS OpenGL renderer

  • Optimize rendering speed and CPU usage by avoiding buffer copy from frame's buffer
  • Add various video dev capabilities
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/opengl_dev.c

    r4812 r4821  
    337337    struct opengl_factory *qf = (struct opengl_factory*)f; 
    338338    struct opengl_dev_info *qdi; 
    339     unsigned i, l; 
     339    unsigned l; 
    340340     
    341341    /* Initialize input and output devices here */ 
     
    350350    qdi->info.dir = PJMEDIA_DIR_RENDER; 
    351351    qdi->info.has_callback = PJ_FALSE; 
    352     qdi->info.caps = PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW; 
    353  
    354     for (i = 0; i < qf->dev_count; i++) { 
    355         qdi = &qf->dev_info[i]; 
    356         qdi->info.fmt_cnt = PJ_ARRAY_SIZE(opengl_fmts); 
    357         qdi->info.caps |= PJMEDIA_VID_DEV_CAP_FORMAT; 
     352    qdi->info.caps = PJMEDIA_VID_DEV_CAP_FORMAT; 
     353    qdi->info.fmt_cnt = PJ_ARRAY_SIZE(opengl_fmts); 
     354    qdi->info.caps |= pjmedia_vid_dev_opengl_imp_get_cap(); 
    358355         
    359         for (l = 0; l < PJ_ARRAY_SIZE(opengl_fmts); l++) { 
    360             pjmedia_format *fmt = &qdi->info.fmt[l]; 
    361             pjmedia_format_init_video(fmt, 
    362                                       opengl_fmts[l], 
    363                                       DEFAULT_WIDTH, 
    364                                       DEFAULT_HEIGHT, 
    365                                       DEFAULT_FPS, 1); 
    366         } 
    367     } 
    368      
    369     PJ_LOG(4, (THIS_FILE, "OpenGL initialized with %d devices", 
    370                qf->dev_count)); 
     356    for (l = 0; l < PJ_ARRAY_SIZE(opengl_fmts); l++) { 
     357        pjmedia_format *fmt = &qdi->info.fmt[l]; 
     358        pjmedia_format_init_video(fmt, opengl_fmts[l], DEFAULT_WIDTH, 
     359                                  DEFAULT_HEIGHT, DEFAULT_FPS, 1); 
     360    } 
     361     
     362    PJ_LOG(4, (THIS_FILE, "OpenGL device initialized")); 
    371363     
    372364    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.