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

{

    AVStream *st;

    int id;



    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR_NOMEM;

    if (ap) {

        id = s->iformat->value;

        if (id == CODEC_ID_RAWVIDEO) {

            st->codec->codec_type = CODEC_TYPE_VIDEO;

        } else {

            st->codec->codec_type = CODEC_TYPE_AUDIO;

        }

        st->codec->codec_id = id;



        switch(st->codec->codec_type) {

        case CODEC_TYPE_AUDIO:

            st->codec->sample_rate = ap->sample_rate;

            st->codec->channels = ap->channels;

            av_set_pts_info(st, 64, 1, st->codec->sample_rate);

            break;

        case CODEC_TYPE_VIDEO:

            av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);

            st->codec->width = ap->width;

            st->codec->height = ap->height;

            st->codec->pix_fmt = ap->pix_fmt;

            if(st->codec->pix_fmt == PIX_FMT_NONE)

                st->codec->pix_fmt= PIX_FMT_YUV420P;

            break;

        default:

            return -1;

        }

    } else {

        return -1;

    }

    return 0;

}

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

{

    AVStream *st;

    int id;



    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR_NOMEM;

    if (ap) {

        id = s->iformat->value;

        if (id == CODEC_ID_RAWVIDEO) {

            st->codec->codec_type = CODEC_TYPE_VIDEO;

        } else {

            st->codec->codec_type = CODEC_TYPE_AUDIO;

        }

        st->codec->codec_id = id;



        switch(st->codec->codec_type) {

        case CODEC_TYPE_AUDIO:

            st->codec->sample_rate = ap->sample_rate;

            st->codec->channels = ap->channels;

            av_set_pts_info(st, 64, 1, st->codec->sample_rate);

            break;

        case CODEC_TYPE_VIDEO:

            av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);

            st->codec->width = ap->width;

            st->codec->height = ap->height;

            st->codec->pix_fmt = ap->pix_fmt;

            if(st->codec->pix_fmt == PIX_FMT_NONE)

                st->codec->pix_fmt= PIX_FMT_YUV420P;

            break;

        default:

            return -1;

        }

    } else {

        return -1;

    }

    return 0;

}

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

{

    AVStream *st;

    int VAR_2;



    st = av_new_stream(VAR_0, 0);

    if (!st)

        return AVERROR_NOMEM;

    if (VAR_1) {

        VAR_2 = VAR_0->iformat->value;

        if (VAR_2 == CODEC_ID_RAWVIDEO) {

            st->codec->codec_type = CODEC_TYPE_VIDEO;

        } else {

            st->codec->codec_type = CODEC_TYPE_AUDIO;

        }

        st->codec->codec_id = VAR_2;



        switch(st->codec->codec_type) {

        case CODEC_TYPE_AUDIO:

            st->codec->sample_rate = VAR_1->sample_rate;

            st->codec->channels = VAR_1->channels;

            av_set_pts_info(st, 64, 1, st->codec->sample_rate);

            break;

        case CODEC_TYPE_VIDEO:

            av_set_pts_info(st, 64, VAR_1->time_base.num, VAR_1->time_base.den);

            st->codec->width = VAR_1->width;

            st->codec->height = VAR_1->height;

            st->codec->pix_fmt = VAR_1->pix_fmt;

            if(st->codec->pix_fmt == PIX_FMT_NONE)

                st->codec->pix_fmt= PIX_FMT_YUV420P;

            break;

        default:

            return -1;

        }

    } else {

        return -1;

    }

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)
{ AVStream *st; int VAR_2; st = av_new_stream(VAR_0, 0); if (!st)
return AVERROR_NOMEM; if (VAR_1) { VAR_2 = VAR_0->iformat->value; if (VAR_2 == CODEC_ID_RAWVIDEO) { st->codec->codec_type = CODEC_TYPE_VIDEO; } else { st->codec->codec_type = CODEC_TYPE_AUDIO; } st->codec->codec_id = VAR_2; switch(st->codec->codec_type) { case CODEC_TYPE_AUDIO:
st->codec->sample_rate = VAR_1->sample_rate; st->codec->channels = VAR_1->channels; av_set_pts_info(st, 64, 1, st->codec->sample_rate); break; case CODEC_TYPE_VIDEO:
av_set_pts_info(st, 64, VAR_1->time_base.num, VAR_1->time_base.den); st->codec->width = VAR_1->width; st->codec->height = VAR_1->height; st->codec->pix_fmt = VAR_1->pix_fmt; if(st->codec->pix_fmt == PIX_FMT_NONE)
st->codec->pix_fmt= PIX_FMT_YUV420P; break; default:
return -1; } } else { return -1; } return 0; }