Changeset 6123


Ignore:
Timestamp:
Dec 23, 2019 3:27:09 AM (12 months ago)
Author:
nanang
Message:

Re #2255: Fixed wrong check of fullscreen mode in window creation and added pjsua app commands for fullscreen.

Location:
pjproject/trunk
Files:
2 edited

Legend:

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

    r6117 r6123  
    702702        } 
    703703 
    704         if (!((strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) && 
    705             strm->param.window_fullscreen)) 
     704        if ((strm->param.flags & PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) && 
     705            strm->param.window_fullscreen) 
    706706        { 
    707707            flags |= SDL_WINDOW_FULLSCREEN; 
     
    12051205        return status;   
    12061206    } else if (cap == PJMEDIA_VID_DEV_CAP_OUTPUT_FULLSCREEN) { 
    1207         int flag; 
     1207        Uint32 flag; 
     1208 
     1209        flag = SDL_GetWindowFlags(strm->window); 
    12081210        if (*(pj_bool_t *)pval) 
    1209             flag = SDL_WINDOW_FULLSCREEN; 
     1211            flag |= SDL_WINDOW_FULLSCREEN; 
    12101212        else 
    1211             flag = 0; 
     1213            flag &= (~SDL_WINDOW_FULLSCREEN); 
     1214 
    12121215        SDL_SetWindowFullscreen(strm->window, flag); 
     1216 
     1217        /* Trying to restore the border after returning from fullscreen, 
     1218         * unfortunately not sure how to put back the resizable flag. 
     1219         */ 
     1220        if ((flag & SDL_WINDOW_FULLSCREEN)==0 && 
     1221            (flag & SDL_WINDOW_BORDERLESS)==0) 
     1222        { 
     1223            SDL_SetWindowBordered(strm->window, PJ_FALSE); 
     1224            SDL_SetWindowBordered(strm->window, PJ_TRUE); 
     1225        } 
     1226 
    12131227        return PJ_SUCCESS; 
    12141228    } 
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app_legacy.c

    r6028 r6123  
    297297    puts("| vid win move ID X Y       Move window ID to position X,Y                    |"); 
    298298    puts("| vid win resize ID w h     Resize window ID to the specified width, height   |"); 
     299    puts("| vid win full on|off ID    Set fullscreen on/off for window ID               |"); 
    299300    puts("| vid conf list             List all video ports in video conference bridge   |"); 
    300301    puts("| vid conf cc P Q           Connect port P to Q in the video conf bridge      |"); 
     
    500501        } else if (argc==3 && strcmp(argv[2], "arrange")==0) { 
    501502            arrange_window(PJSUA_INVALID_ID); 
     503        } else if (argc==5 && (strcmp(argv[2], "full")==0)) 
     504        { 
     505            pjsua_vid_win_id wid = atoi(argv[4]); 
     506            pj_bool_t fullscreen = (strcmp(argv[3], "on")==0); 
     507            status = pjsua_vid_win_set_fullscreen(wid, fullscreen); 
    502508        } else 
    503509            goto on_error; 
Note: See TracChangeset for help on using the changeset viewer.