Changeset 1894


Ignore:
Timestamp:
06/02/12 23:54:46 (12 months ago)
Author:
reyalp
Message:

liveview - a540 correct playback mode checks for viewport function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reyalp-ptp-live/platform/a540/sub/100b/lib.c

    r1870 r1894  
    5454 
    5555int vid_get_viewport_width_proper() { 
     56    int m = mode_get(); 
     57    if((m&MODE_MASK) == MODE_PLAY) { 
     58        return 704; 
     59    } 
    5660    // fake 1:1 mode 
    57     if((mode_get()&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
     61    if((m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
    5862        return 528; 
    5963    } 
    60     return ((mode_get()&MODE_MASK) == MODE_PLAY)?704:*(int*)0x32C68; 
     64    return *(int*)0x32C68; 
    6165} 
    6266int vid_get_viewport_width() { 
     
    6569 
    6670int vid_get_viewport_height_proper() { 
     71    int m = mode_get(); 
     72    // TODO not correct if TV out connected 
     73    if((m&MODE_MASK) == MODE_PLAY) { 
     74        return 240; 
     75    } 
    6776    // fake 16:9 mode 
    68     if((mode_get()&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
     77    if((m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
    6978        return 180;  
    7079    } 
    71     return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x32C68+4); 
     80    return *(int*)(0x32C68+4); 
    7281} 
    7382 
     
    162171 
    163172int vid_get_viewport_display_xoffset() { 
    164     int val=0; 
    165     int m = mode_get(); 
    166     if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) { 
     173    int m = mode_get(); 
     174    if((m&MODE_MASK) == MODE_PLAY) { 
     175        return 0; 
     176    } else if((m&MODE_SHOOTING_MASK) == MODE_STITCH) { 
    167177        short dir=0; 
    168178        short seq=0; 
     
    172182        // live part is 1/2, so margin is either 1/8th or 3/8th 
    173183        if(dir==0) { 
    174             val = seq?132:44; 
     184            return seq?132:44; 
    175185        } else { 
    176             val = seq?44:132; 
     186            return seq?44:132; 
    177187        } 
    178188    } else if((m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
    179         val = 44; 
    180     } 
    181     return val; 
     189        return 44; 
     190    } 
     191    return 0; 
    182192} 
    183193 
    184194int vid_get_viewport_xoffset() { 
    185     if((mode_get()&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
     195    int m = mode_get(); 
     196    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_PORTRAIT) { 
    186197       return 44; 
    187198    } 
     
    191202int vid_get_viewport_display_yoffset() { 
    192203    int m = mode_get(); 
     204    if((m&MODE_MASK) == MODE_PLAY) { 
     205        return 0; 
     206    } 
    193207    if((m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
    194208       return 30; 
    195209    } 
    196     return ((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0; // window is 120, centered in 240 screen 
     210    return ((m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0; // window is 120, centered in 240 screen 
    197211} 
    198212 
    199213int vid_get_viewport_yoffset() { 
    200     if((mode_get()&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
     214    int m = mode_get(); 
     215    if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_LANDSCAPE) { 
    201216       return 30; 
    202217    } 
Note: See TracChangeset for help on using the changeset viewer.