コード例 #1
0
ファイル: vf_vo.c プロジェクト: maletor/mpv
static int config(struct vf_instance *vf,
                  int width, int height, int d_width, int d_height,
                  unsigned int flags, unsigned int outfmt)
{

    if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0)) {
        mp_msg(MSGT_CPLAYER, MSGL_ERR, "VO: invalid dimensions!\n");
        return 0;
    }

    const vo_info_t *info = video_out->driver->info;
    mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s %s%s\n",
           info->short_name,
           width, height,
           d_width, d_height,
           vo_format_name(outfmt),
           (flags & VOFLAG_FULLSCREEN) ? " [fs]" : "",
           (flags & VOFLAG_FLIPPING) ? " [flip]" : "");
    mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Description: %s\n", info->name);
    mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Author: %s\n", info->author);
    if (info->comment && strlen(info->comment) > 0)
        mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Comment: %s\n", info->comment);

    if (vo_config(video_out, width, height, d_width, d_height, flags, outfmt))
        return 0;

    return 1;
}
コード例 #2
0
ファイル: vf_vo.c プロジェクト: divVerent/mplayer2
static int config(struct vf_instance *vf,
                  int width, int height, int d_width, int d_height,
                  unsigned int flags, unsigned int outfmt)
{

    if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0)) {
        mp_msg(MSGT_CPLAYER, MSGL_ERR, "VO: invalid dimensions!\n");
        return 0;
    }

    const vo_info_t *info = video_out->driver->info;
    mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s %s%s%s%s\n",
           info->short_name,
           width, height,
           d_width, d_height,
           vo_format_name(outfmt),
           (flags & VOFLAG_FULLSCREEN) ? " [fs]" : "",
           (flags & VOFLAG_MODESWITCHING) ? " [vm]" : "",
           (flags & VOFLAG_SWSCALE) ? " [zoom]" : "",
           (flags & VOFLAG_FLIPPING) ? " [flip]" : "");
    mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Description: %s\n", info->name);
    mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Author: %s\n", info->author);
    if (info->comment && strlen(info->comment) > 0)
        mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Comment: %s\n", info->comment);

    // save vo's stride capability for the wanted colorspace:
    vf->default_caps = query_format(vf, outfmt);
    vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice;

    if (vo_config(video_out, width, height, d_width, d_height, flags, outfmt))
        return 0;

    vf->priv->scale_ratio = (double) d_width / d_height * height / width;

    return 1;
}