Exemplo n.º 1
0
static int UpdateWindowSize(video_format_t *p_fmt, bool b_cropped)
{
    unsigned int i_width, i_height;
    unsigned int i_sar_num = 1, i_sar_den = 1;
    video_format_t rot_fmt;

    video_format_ApplyRotation(&rot_fmt, p_fmt);

    if (rot_fmt.i_sar_num != 0 && rot_fmt.i_sar_den != 0) {
        i_sar_num = rot_fmt.i_sar_num;
        i_sar_den = rot_fmt.i_sar_den;
    }
    if (b_cropped) {
        i_width = rot_fmt.i_visible_width;
        i_height = rot_fmt.i_visible_height;
    } else {
        i_width = rot_fmt.i_width;
        i_height = rot_fmt.i_height;
    }

    jni_SetSurfaceLayout(i_width, i_height,
                         rot_fmt.i_visible_width,
                         rot_fmt.i_visible_height,
                         i_sar_num,
                         i_sar_den);
    return 0;
}
Exemplo n.º 2
0
Arquivo: surface.c Projeto: Kubink/vlc
static void UpdateLayout(vout_display_sys_t *sys)
{
    unsigned int i_sar_num = 1, i_sar_den = 1;
    unsigned int i_width, i_height;

    if (sys->fmt.i_sar_num != 0 && sys->fmt.i_sar_den != 0) {
        i_sar_num = sys->fmt.i_sar_num;
        i_sar_den = sys->fmt.i_sar_den;
    }
    if (sys->i_alloc_width != 0 && sys->i_alloc_height != 0) {
        i_width = sys->i_alloc_width;
        i_height = sys->i_alloc_height;
    } else {
        i_width = sys->fmt.i_width;
        i_height = sys->fmt.i_height;
    }

    jni_SetSurfaceLayout(i_width, i_height,
                         sys->fmt.i_visible_width,
                         sys->fmt.i_visible_height,
                         i_sar_num,
                         i_sar_den);
}