亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? utils.c

?? arm平臺下的H264編碼和解碼源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
    /* check filename in case of an image number is expected */    if (fmt->flags & AVFMT_NEEDNUMBER) {        if (filename_number_test(filename) < 0) {             err = AVERROR_NUMEXPECTED;            goto fail;        }    }    err = av_open_input_stream(ic_ptr, pb, filename, fmt, ap);    if (err)        goto fail;    return 0; fail:    if (file_opened)        url_fclose(pb);    *ic_ptr = NULL;    return err;    }/*******************************************************//** * Read a transport packet from a media file. This function is * absolete and should never be used. Use av_read_frame() instead. *  * @param s media file handle * @param pkt is filled  * @return 0 if OK. AVERROR_xxx if error.   */int av_read_packet(AVFormatContext *s, AVPacket *pkt){    return s->iformat->read_packet(s, pkt);}/**********************************************************//* convert the packet time stamp units and handle wrapping. The   wrapping is handled by considering the next PTS/DTS as a delta to   the previous value. We handle the delta as a fraction to avoid any   rounding errors. */static inline int64_t convert_timestamp_units(AVFormatContext *s,                                        int64_t *plast_pkt_pts,                                        int *plast_pkt_pts_frac,                                        int64_t *plast_pkt_stream_pts,                                        int64_t pts){    int64_t stream_pts;    int64_t delta_pts;    int shift, pts_frac;    if (pts != AV_NOPTS_VALUE) {        stream_pts = pts;        if (*plast_pkt_stream_pts != AV_NOPTS_VALUE) {            shift = 64 - s->pts_wrap_bits;            delta_pts = ((stream_pts - *plast_pkt_stream_pts) << shift) >> shift;            /* XXX: overflow possible but very unlikely as it is a delta */            delta_pts = delta_pts * AV_TIME_BASE * s->pts_num;            pts = *plast_pkt_pts + (delta_pts / s->pts_den);            pts_frac = *plast_pkt_pts_frac + (delta_pts % s->pts_den);            if (pts_frac >= s->pts_den) {                pts_frac -= s->pts_den;                pts++;            }        } else {            /* no previous pts, so no wrapping possible */            pts = (int64_t)(((double)stream_pts * AV_TIME_BASE * s->pts_num) /                             (double)s->pts_den);            pts_frac = 0;        }        *plast_pkt_stream_pts = stream_pts;        *plast_pkt_pts = pts;        *plast_pkt_pts_frac = pts_frac;    }    return pts;}/* get the number of samples of an audio frame. Return (-1) if error */static int get_audio_frame_size(AVCodecContext *enc, int size){    int frame_size;    if (enc->frame_size <= 1) {        /* specific hack for pcm codecs because no frame size is           provided */        switch(enc->codec_id) {        case CODEC_ID_PCM_S16LE:        case CODEC_ID_PCM_S16BE:        case CODEC_ID_PCM_U16LE:        case CODEC_ID_PCM_U16BE:            if (enc->channels == 0)                return -1;            frame_size = size / (2 * enc->channels);            break;        case CODEC_ID_PCM_S8:        case CODEC_ID_PCM_U8:        case CODEC_ID_PCM_MULAW:        case CODEC_ID_PCM_ALAW:            if (enc->channels == 0)                return -1;            frame_size = size / (enc->channels);            break;        default:            /* used for example by ADPCM codecs */            if (enc->bit_rate == 0)                return -1;            frame_size = (size * 8 * enc->sample_rate) / enc->bit_rate;            break;        }    } else {        frame_size = enc->frame_size;    }    return frame_size;}/* return the frame duration in seconds, return 0 if not available */static void compute_frame_duration(int *pnum, int *pden,                                   AVFormatContext *s, AVStream *st,                                    AVCodecParserContext *pc, AVPacket *pkt){    int frame_size;    *pnum = 0;    *pden = 0;    switch(st->codec.codec_type) {    case CODEC_TYPE_VIDEO:        *pnum = st->codec.frame_rate_base;        *pden = st->codec.frame_rate;        if (pc && pc->repeat_pict) {            *pden *= 2;            *pnum = (*pnum) * (2 + pc->repeat_pict);        }        break;    case CODEC_TYPE_AUDIO:        frame_size = get_audio_frame_size(&st->codec, pkt->size);        if (frame_size < 0)            break;        *pnum = frame_size;        *pden = st->codec.sample_rate;        break;    default:        break;    }}static void compute_pkt_fields(AVFormatContext *s, AVStream *st,                                AVCodecParserContext *pc, AVPacket *pkt){    int num, den, presentation_delayed;    if (pkt->duration == 0) {        compute_frame_duration(&num, &den, s, st, pc, pkt);        if (den && num) {            pkt->duration = (num * (int64_t)AV_TIME_BASE) / den;        }    }    /* do we have a video B frame ? */    presentation_delayed = 0;    if (st->codec.codec_type == CODEC_TYPE_VIDEO) {        /* XXX: need has_b_frame, but cannot get it if the codec is           not initialized */        if ((st->codec.codec_id == CODEC_ID_MPEG1VIDEO ||             st->codec.codec_id == CODEC_ID_MPEG2VIDEO ||             st->codec.codec_id == CODEC_ID_MPEG4 ||             st->codec.codec_id == CODEC_ID_H264) &&             pc && pc->pict_type != FF_B_TYPE)            presentation_delayed = 1;    }    /* interpolate PTS and DTS if they are not present */    if (presentation_delayed) {        /* DTS = decompression time stamp */        /* PTS = presentation time stamp */        if (pkt->dts == AV_NOPTS_VALUE) {            pkt->dts = st->cur_dts;        } else {            st->cur_dts = pkt->dts;        }        /* this is tricky: the dts must be incremented by the duration           of the frame we are displaying, i.e. the last I or P frame */        if (st->last_IP_duration == 0)            st->cur_dts += pkt->duration;        else            st->cur_dts += st->last_IP_duration;        st->last_IP_duration  = pkt->duration;        /* cannot compute PTS if not present (we can compute it only           by knowing the futur */    } else {        /* presentation is not delayed : PTS and DTS are the same */        if (pkt->pts == AV_NOPTS_VALUE) {            if (pkt->dts == AV_NOPTS_VALUE) {                pkt->pts = st->cur_dts;                pkt->dts = st->cur_dts;            }            else {                st->cur_dts = pkt->dts;                pkt->pts = pkt->dts;            }        } else {            st->cur_dts = pkt->pts;            pkt->dts = pkt->pts;        }        st->cur_dts += pkt->duration;    }        /* update flags */    if (pc) {        pkt->flags = 0;        /* key frame computation */        switch(st->codec.codec_type) {        case CODEC_TYPE_VIDEO:            if (pc->pict_type == FF_I_TYPE)                pkt->flags |= PKT_FLAG_KEY;            break;        case CODEC_TYPE_AUDIO:            pkt->flags |= PKT_FLAG_KEY;            break;        default:            break;        }    }}static void av_destruct_packet_nofree(AVPacket *pkt){    pkt->data = NULL; pkt->size = 0;}static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt){    AVStream *st;    int len, ret, i;    for(;;) {        /* select current input stream component */        st = s->cur_st;        if (st) {            if (!st->parser) {                /* no parsing needed: we just output the packet as is */                /* raw data support */                *pkt = s->cur_pkt;                compute_pkt_fields(s, st, NULL, pkt);                s->cur_st = NULL;                return 0;            } else if (s->cur_len > 0) {                len = av_parser_parse(st->parser, &st->codec, &pkt->data, &pkt->size,                                       s->cur_ptr, s->cur_len,                                      s->cur_pkt.pts, s->cur_pkt.dts);                s->cur_pkt.pts = AV_NOPTS_VALUE;                s->cur_pkt.dts = AV_NOPTS_VALUE;                /* increment read pointer */                s->cur_ptr += len;                s->cur_len -= len;                                /* return packet if any */                if (pkt->size) {                got_packet:                    pkt->duration = 0;                    pkt->stream_index = st->index;                    pkt->pts = st->parser->pts;                    pkt->dts = st->parser->dts;                    pkt->destruct = av_destruct_packet_nofree;                    compute_pkt_fields(s, st, st->parser, pkt);                    return 0;                }            } else {                /* free packet */                av_free_packet(&s->cur_pkt);                 s->cur_st = NULL;            }        } else {            /* read next packet */            ret = av_read_packet(s, &s->cur_pkt);            if (ret < 0) {                if (ret == -EAGAIN)                    return ret;                /* return the last frames, if any */                for(i = 0; i < s->nb_streams; i++) {                    st = s->streams[i];                    if (st->parser) {                        av_parser_parse(st->parser, &st->codec,                                         &pkt->data, &pkt->size,                                         NULL, 0,                                         AV_NOPTS_VALUE, AV_NOPTS_VALUE);                        if (pkt->size)                            goto got_packet;                    }                }                /* no more packets: really terminates parsing */                return ret;            }            /* convert the packet time stamp units and handle wrapping */            s->cur_pkt.pts = convert_timestamp_units(s,                                                &s->last_pkt_pts, &s->last_pkt_pts_frac,                                               &s->last_pkt_stream_pts,                                               s->cur_pkt.pts);            s->cur_pkt.dts = convert_timestamp_units(s,                                                &s->last_pkt_dts,  &s->last_pkt_dts_frac,                                               &s->last_pkt_stream_dts,                                               s->cur_pkt.dts);#if 0            if (s->cur_pkt.stream_index == 0) {                if (s->cur_pkt.pts != AV_NOPTS_VALUE)                     printf("PACKET pts=%0.3f\n",                            (double)s->cur_pkt.pts / AV_TIME_BASE);                if (s->cur_pkt.dts != AV_NOPTS_VALUE)                     printf("PACKET dts=%0.3f\n",                            (double)s->cur_pkt.dts / AV_TIME_BASE);            }#endif                        /* duration field */            if (s->cur_pkt.duration != 0) {                s->cur_pkt.duration = ((int64_t)s->cur_pkt.duration * AV_TIME_BASE * s->pts_num) /                     s->pts_den;            }            st = s->streams[s->cur_pkt.stream_index];            s->cur_st = st;            s->cur_ptr = s->cur_pkt.data;            s->cur_len = s->cur_pkt.size;            if (st->need_parsing && !st->parser) {                st->parser = av_parser_init(st->codec.codec_id);                if (!st->parser) {                    /* no parser available : just output the raw packets */                    st->need_parsing = 0;                }            }        }    }}/** * Return the next frame of a stream. The returned packet is valid * until the next av_read_frame() or until av_close_input_file() and * must be freed with av_free_packet. For video, the packet contains * exactly one frame. For audio, it contains an integer number of * frames if each frame has a known fixed size (e.g. PCM or ADPCM * data). If the audio frames have a variable size (e.g. MPEG audio), * then it contains one frame. *  * pkt->pts, pkt->dts and pkt->duration are always set to correct * values in AV_TIME_BASE unit (and guessed if the format cannot * provided them). pkt->pts can be AV_NOPTS_VALUE if the video format * has B frames, so it is better to rely on pkt->dts if you do not * decompress the payload. *  * Return 0 if OK, < 0 if error or end of file.   */int av_read_frame(AVFormatContext *s, AVPacket *pkt){    AVPacketList *pktl;    pktl = s->packet_buffer;    if (pktl) {        /* read packet from packet buffer, if there is data */        *pkt = pktl->pkt;        s->packet_buffer = pktl->next;        av_free(pktl);        return 0;    } else {        return av_read_frame_internal(s, pkt);    }}/* XXX: suppress the packet queue */static void flush_packet_queue(AVFormatContext *s){    AVPacketList *pktl;    for(;;) {        pktl = s->packet_buffer;        if (!pktl)             break;        s->packet_buffer = pktl->next;        av_free_packet(&pktl->pkt);        av_free(pktl);    }}/*******************************************************//* seek support */int av_find_default_stream_index(AVFormatContext *s){    int i;    AVStream *st;    if (s->nb_streams <= 0)        return -1;    for(i = 0; i < s->nb_streams; i++) {        st = s->streams[i];        if (st->codec.codec_type == CODEC_TYPE_VIDEO) {            return i;        }    }    return 0;}/* flush the frame reader */static void av_read_frame_flush(AVFormatContext *s){    AVStream *st;    int i;    flush_packet_queue(s);    /* free previous packet */    if (s->cur_st) {        if (s->cur_st->parser)            av_free_packet(&s->cur_pkt);        s->cur_st = NULL;    }    /* fail safe */    s->cur_ptr = NULL;    s->cur_len = 0;        /* for each stream, reset read state */    for(i = 0; i < s->nb_streams; i++) {        st = s->streams[i];                if (st->parser) {            av_parser_close(st->parser);            st->parser = NULL;        }        st->cur_dts = 0; /* we set the current DTS to an unspecified origin */    }}/* add a index entry into a sorted list updateing if it is already there */int av_add_index_entry(AVStream *st,                            int64_t pos, int64_t timestamp, int distance, int flags){    AVIndexEntry *entries, *ie;    int index;        entries = av_fast_realloc(st->index_entries,                              &st->index_entries_allocated_size,                              (st->nb_index_entries + 1) *                               sizeof(AVIndexEntry));    st->index_entries= entries;    if(st->nb_index_entries){        index= av_index_search_timestamp(st, timestamp);        ie= &entries[index];        if(ie->timestamp != timestamp){            if(ie->timestamp < timestamp){                index++; //index points to next instead of previous entry, maybe nonexistant                ie= &st->index_entries[index];            }else                assert(index==0);                

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本在线不卡视频| 欧美一区二区三区四区久久| 欧美日韩黄色影视| 欧美国产综合色视频| 日韩成人av影视| 色丁香久综合在线久综合在线观看| 日韩免费高清电影| 亚洲午夜电影在线观看| proumb性欧美在线观看| 久久先锋资源网| 麻豆成人av在线| 欧美日韩国产乱码电影| 一区二区三区中文字幕精品精品| 丁香另类激情小说| 国产午夜精品久久久久久免费视| 精品一区二区免费看| 在线观看91av| 日产国产欧美视频一区精品 | 成人av网站大全| 欧美成人video| 免费观看在线综合色| 欧美精品久久久久久久多人混战| 亚洲精品亚洲人成人网在线播放| 99久久国产免费看| 亚洲人成7777| 日本高清不卡视频| 亚洲精品日产精品乱码不卡| 91麻豆.com| 亚洲高清久久久| 欧美日韩国产影片| 免费观看日韩电影| 日韩美女在线视频 | 91网站最新网址| 最新国产精品久久精品| 91丨porny丨户外露出| 亚洲三级电影网站| 在线视频你懂得一区二区三区| 一区二区在线免费观看| 欧美日韩一卡二卡三卡| 美女脱光内衣内裤视频久久影院| 日韩视频免费观看高清在线视频| 久久国产精品一区二区| 国产校园另类小说区| 成人av电影免费在线播放| 亚洲欧美激情小说另类| 欧美日韩精品一区二区三区| 美女视频网站久久| 中文字幕电影一区| 91福利国产精品| 毛片av一区二区| 久久精品亚洲精品国产欧美kt∨ | 日韩精品一区二区三区中文不卡 | 欧美久久久影院| 精品一区中文字幕| 国产精品对白交换视频 | 91久久免费观看| 日韩中文字幕一区二区三区| 久久久一区二区三区捆绑**| 91在线视频在线| 免费观看一级特黄欧美大片| 中文av一区二区| 欧美色爱综合网| 国产成人午夜视频| 舔着乳尖日韩一区| 日本一区二区三级电影在线观看| 日本大香伊一区二区三区| 精彩视频一区二区三区| 玉米视频成人免费看| 久久视频一区二区| 欧美日韩中文字幕一区| 国产精品亚洲专一区二区三区 | 亚洲一区二区三区在线| 欧美精品一区二区三区蜜桃| 一本大道av伊人久久综合| 日本不卡中文字幕| 亚洲欧洲av另类| 日韩一区二区免费视频| 在线看不卡av| 福利电影一区二区| 美国十次综合导航| 亚洲精品五月天| 日本一区二区免费在线观看视频| 欧美人体做爰大胆视频| 91日韩在线专区| 国产综合色精品一区二区三区| 午夜日韩在线观看| 亚洲精选视频在线| 国产精品午夜在线观看| 精品国产乱码久久久久久牛牛 | 在线播放亚洲一区| 色网站国产精品| 成人avav在线| 国产成人在线观看免费网站| 免费av成人在线| 日韩在线一区二区| 亚洲mv大片欧洲mv大片精品| 亚洲精品精品亚洲| **网站欧美大片在线观看| 亚洲国产精品二十页| 国产欧美1区2区3区| 久久一区二区三区国产精品| 精品久久久久久最新网址| 91精品国产一区二区| 欧洲精品一区二区三区在线观看| 99久久777色| 91麻豆国产香蕉久久精品| 色香蕉久久蜜桃| 日本久久电影网| 在线观看亚洲一区| 欧美日韩一区二区三区四区| 欧美日韩一区二区三区在线 | 老司机精品视频导航| 奇米色一区二区三区四区| 三级欧美在线一区| 婷婷综合另类小说色区| 视频一区视频二区中文字幕| 五月激情综合婷婷| 日韩电影在线免费看| 日本成人在线看| 黑人巨大精品欧美黑白配亚洲| 精品一区二区三区久久久| 国产一区二区在线观看视频| 国产成人免费视频| 99久久久久免费精品国产| 色久综合一二码| 欧美日韩精品久久久| 欧美一区二区三区四区在线观看| 精品久久一区二区| 国产精品女主播在线观看| 亚洲裸体xxx| 首页亚洲欧美制服丝腿| 国产麻豆91精品| 99精品视频免费在线观看| 欧美日精品一区视频| 欧美白人最猛性xxxxx69交| 久久精品男人天堂av| 亚洲精品乱码久久久久久久久| 婷婷中文字幕一区三区| 国产精品一区二区久激情瑜伽| 91亚洲精品久久久蜜桃| 欧美一区二区三区电影| 国产欧美日韩一区二区三区在线观看| 自拍偷自拍亚洲精品播放| 午夜精品久久久久久久| 国产成人在线网站| 欧美色综合天天久久综合精品| 日韩三级精品电影久久久| 国产精品天美传媒沈樵| 亚洲电影在线免费观看| 国产盗摄视频一区二区三区| 欧美日韩一区二区三区四区五区| 久久一夜天堂av一区二区三区 | 欧美一区二区三区喷汁尤物| 国产精品丝袜黑色高跟| 日韩精品亚洲一区二区三区免费| 国产成人福利片| 3d动漫精品啪啪一区二区竹菊| 久久精品人人爽人人爽| 日韩高清不卡一区二区三区| 不卡一区二区三区四区| 欧美一级理论片| 一区二区三区丝袜| 国产高清精品久久久久| 欧美日本视频在线| 亚洲六月丁香色婷婷综合久久| 国产一区二区女| 日韩亚洲欧美在线| 一区二区三区中文字幕电影| 懂色一区二区三区免费观看 | 国产99久久久国产精品潘金| 欧美三级资源在线| 亚洲男人的天堂av| 成人18精品视频| 久久久精品综合| 美女久久久精品| 欧美丰满少妇xxxxx高潮对白| 亚洲视频综合在线| 成人免费看片app下载| 精品国产制服丝袜高跟| 日本美女视频一区二区| 欧美性淫爽ww久久久久无| 亚洲同性同志一二三专区| 国产成人免费网站| 久久久精品国产免费观看同学| 另类人妖一区二区av| 555www色欧美视频| 亚洲18色成人| 欧美伦理电影网| 天堂午夜影视日韩欧美一区二区| 一本色道a无线码一区v| 亚洲欧洲综合另类| 在线免费观看不卡av| 一区二区三区国产| 欧美日韩国产综合久久| 亚洲国产精品久久人人爱蜜臀| 色噜噜狠狠一区二区三区果冻| 亚洲欧美日韩久久精品| 在线观看国产精品网站| 一区二区三区日韩| 欧美妇女性影城|