static int img_set_parameters(AVFormatContext *s, AVFormatParameters *ap)

{

    VideoData *img = s->priv_data;

    AVStream *st;

    AVImageFormat *img_fmt;

    int i;



    /* find output image format */

    if (ap && ap->image_format) {

        img_fmt = ap->image_format;

    } else {

        img_fmt = guess_image_format(s->filename);

    }

    if (!img_fmt)

        return -1;



    if (s->nb_streams != 1)

        return -1;



    st = s->streams[0];

    /* we select the first matching format */

    for(i=0;i<PIX_FMT_NB;i++) {

        if (img_fmt->supported_pixel_formats & (1 << i))

            break;

    }

    if (i >= PIX_FMT_NB)

        return -1;

    img->img_fmt = img_fmt;

    img->pix_fmt = i;

    st->codec->pix_fmt = img->pix_fmt;

    return 0;

}

static int img_set_parameters(AVFormatContext *s, AVFormatParameters *ap)

{

    VideoData *img = s->priv_data;

    AVStream *st;

    AVImageFormat *img_fmt;

    int i;



    

    if (ap && ap->image_format) {

        img_fmt = ap->image_format;

    } else {

        img_fmt = guess_image_format(s->filename);

    }

    if (!img_fmt)

        return -1;



    if (s->nb_streams != 1)

        return -1;



    st = s->streams[0];

    

    for(i=0;i<PIX_FMT_NB;i++) {

        if (img_fmt->supported_pixel_formats & (1 << i))

            break;

    }

    if (i >= PIX_FMT_NB)

        return -1;

    img->img_fmt = img_fmt;

    img->pix_fmt = i;

    st->codec->pix_fmt = img->pix_fmt;

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)

{

    VideoData *img = VAR_0->priv_data;

    AVStream *st;

    AVImageFormat *img_fmt;

    int VAR_2;



    

    if (VAR_1 && VAR_1->image_format) {

        img_fmt = VAR_1->image_format;

    } else {

        img_fmt = guess_image_format(VAR_0->filename);

    }

    if (!img_fmt)

        return -1;



    if (VAR_0->nb_streams != 1)

        return -1;



    st = VAR_0->streams[0];

    

    for(VAR_2=0;VAR_2<PIX_FMT_NB;VAR_2++) {

        if (img_fmt->supported_pixel_formats & (1 << VAR_2))

            break;

    }

    if (VAR_2 >= PIX_FMT_NB)

        return -1;

    img->img_fmt = img_fmt;

    img->pix_fmt = VAR_2;

    st->codec->pix_fmt = img->pix_fmt;

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)
{ VideoData *img = VAR_0->priv_data; AVStream *st; AVImageFormat *img_fmt; int VAR_2; if (VAR_1 && VAR_1->image_format) { img_fmt = VAR_1->image_format; } else { img_fmt = guess_image_format(VAR_0->filename); } if (!img_fmt)
return -1; if (VAR_0->nb_streams != 1)
return -1; st = VAR_0->streams[0]; for(VAR_2=0;VAR_2<PIX_FMT_NB;VAR_2++) { if (img_fmt->supported_pixel_formats & (1 << VAR_2))
break; } if (VAR_2 >= PIX_FMT_NB)
return -1; img->img_fmt = img_fmt; img->pix_fmt = VAR_2; st->codec->pix_fmt = img->pix_fmt; return 0; }