Changeset 4035 for pjproject/trunk


Ignore:
Timestamp:
Apr 10, 2012 12:23:35 PM (13 years ago)
Author:
ming
Message:

Re #1446 (misc): Modify SDL dev to:

  • Resize renderer (instead of recreating it) if format does not change.
  • Create window in the requested position if PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION is specified.
File:
1 edited

Legend:

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

    r3997 r4035  
    735735                               strm->param.window.info.window); 
    736736        } else { 
     737            int x, y; 
     738 
     739            x = y = SDL_WINDOWPOS_CENTERED; 
     740            if (strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION) { 
     741                x = strm->param.window_pos.x; 
     742                y = strm->param.window_pos.y; 
     743            } 
     744 
    737745            /* Create the window where we will draw. */ 
    738746            strm->window = SDL_CreateWindow("pjmedia-SDL video", 
     
    831839    pj_status_t status; 
    832840 
     841    if (new_fmt->id == strm->param.fmt.id) { 
     842        SDL_SetWindowSize(strm->window, new_fmt->det.vid.size.w, 
     843                          new_fmt->det.vid.size.h); 
     844        return resize_disp(strm, &new_fmt->det.vid.size); 
     845    } 
     846 
    833847    /* Recreate SDL renderer */ 
    834848    status = sdl_create_rend(strm, (new_fmt? new_fmt : 
     
    934948    pj_list_insert_after(&strm->sf->streams, &strm->list_entry); 
    935949    pj_mutex_unlock(strm->sf->mutex); 
    936  
    937     /* Apply the remaining settings */ 
    938     if (param->flags & PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION) { 
    939         sdl_stream_set_cap(&strm->base, 
    940                            PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION, 
    941                            &param->window_pos); 
    942     } 
    943950 
    944951    /* Done */ 
Note: See TracChangeset for help on using the changeset viewer.