• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/ffmpeg/

Lines Matching refs:ist

583     const AVInputStream *ist = ost->sync_ist;
584 return (double)(ist->pts - start_time)/AV_TIME_BASE;
623 AVInputStream *ist,
632 AVCodecContext *dec= ist->st->codec;
697 double idelta= delta*ist->st->codec->sample_rate / enc->sample_rate;
698 int byte_delta= ((int)idelta)*2*ist->st->codec->channels;
702 if(ist->is_start || fabs(delta) > audio_drift_threshold*enc->sample_rate){
711 ist->is_start=0;
720 ist->is_start=0;
746 size / (ist->st->codec->channels * isize));
840 static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void **bufp)
847 dec = ist->st->codec;
884 AVInputStream *ist,
916 sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
950 AVInputStream *ist,
965 dec = ist->st->codec;
1031 if( (ost->resample_height != (ist->st->codec->height - (ost->topBand + ost->bottomBand)))
1032 || (ost->resample_width != (ist->st->codec->width - (ost->leftBand + ost->rightBand)))
1033 || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
1035 fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d, %s\n", ist->file_index, ist->index, ist->st->codec->width, ist->st->codec->height,avcodec_get_pix_fmt_name(ist->st->codec->pix_fmt));
1043 if( (ost->resample_height != (ist->st->codec->height - (ost->topBand + ost->bottomBand)))
1044 || (ost->resample_width != (ist->st->codec->width - (ost->leftBand + ost->rightBand)))
1045 || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
1048 topBand = ((int64_t)ist->st->codec->height * ost->original_topBand / ost->original_height) & ~1;
1049 bottomBand = ((int64_t)ist->st->codec->height * ost->original_bottomBand / ost->original_height) & ~1;
1050 leftBand = ((int64_t)ist->st->codec->width * ost->original_leftBand / ost->original_width) & ~1;
1051 rightBand = ((int64_t)ist->st->codec->width * ost->original_rightBand / ost->original_width) & ~1;
1064 ost->resample_height = ist->st->codec->height - (ost->topBand + ost->bottomBand);
1065 ost->resample_width = ist->st->codec->width - (ost->leftBand + ost->rightBand);
1066 ost->resample_pix_fmt= ist->st->codec->pix_fmt;
1072 ist->st->codec->width - (ost->leftBand + ost->rightBand),
1073 ist->st->codec->height - (ost->topBand + ost->bottomBand),
1074 ist->st->codec->pix_fmt,
1130 big_picture.quality = ist->st->quality;
1339 static int output_packet(AVInputStream *ist, int ist_index,
1353 int bps = av_get_bits_per_sample_format(ist->st->codec->sample_fmt)>>3;
1355 if(ist->next_pts == AV_NOPTS_VALUE)
1356 ist->next_pts= ist->pts;
1369 ist->next_pts = ist->pts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
1372 while (avpkt.size > 0 || (!pkt && ist->next_pts != ist->pts)) {
1376 ist->pts= ist->next_pts;
1379 ((!ist->showed_multi_packet_warning && verbose>0) || verbose>1)){
1381 ist->showed_multi_packet_warning=1;
1390 if (ist->decoding_needed) {
1391 switch(ist->st->codec->codec_type) {
1401 ret = avcodec_decode_audio3(ist->st->codec, samples, &decoded_data_size,
1415 ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) /
1416 (ist->st->codec->sample_rate * ist->st->codec->channels);
1419 decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
1423 ret = avcodec_decode_video2(ist->st->codec,
1425 ist->st->quality= picture.quality;
1432 if (ist->st->codec->time_base.num != 0) {
1433 int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
1434 ist->next_pts += ((int64_t)AV_TIME_BASE *
1435 ist->st->codec->time_base.num * ticks) /
1436 ist->st->codec->time_base.den;
1441 ret = avcodec_decode_subtitle2(ist->st->codec,
1455 switch(ist->st->codec->codec_type) {
1457 ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
1458 ist->st->codec->sample_rate;
1461 if (ist->st->codec->time_base.num != 0) {
1462 int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
1463 ist->next_pts += ((int64_t)AV_TIME_BASE *
1464 ist->st->codec->time_base.num * ticks) /
1465 ist->st->codec->time_base.den;
1474 if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
1475 pre_process_video_frame(ist, (AVPicture *)&picture,
1480 if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
1495 int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE);
1496 int64_t now = av_gettime() - ist->start;
1503 if (start_time == 0 || ist->pts >= start_time)
1512 //ost->sync_ipts = (double)(ist->pts + input_files_ts_offset[ist->file_index] - start_time)/ AV_TIME_BASE;
1515 assert(ist->decoding_needed);
1518 do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size);
1521 do_video_out(os, ost, ist, &picture, &frame_size);
1526 do_subtitle_out(os, ost, ist, &subtitle,
1558 opkt.pts= av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time;
1563 opkt.dts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->st->time_base);
1565 opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base);
1568 opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
1576 if(av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, data_buf, data_size, pkt->flags & AV_PKT_FLAG_KEY))
1759 AVInputStream *ist, **ist_table = NULL;
1786 ist = av_mallocz(sizeof(AVInputStream));
1787 if (!ist)
1789 ist_table[i] = ist;
1795 ist = ist_table[j++];
1796 ist->st = is->streams[k];
1797 ist->file_index = i;
1798 ist->index = k;
1799 ist->discard = 1; /* the stream is discarded by default
1803 ist->start = av_gettime();
1882 ist = ist_table[j];
1885 AVFormatContext *f= input_files[ ist->file_index ];
1891 if(f->streams[ p->stream_index[si] ] == ist->st)
1896 if (ist->discard && ist->st->discard != AVDISCARD_ALL && !skip &&
1897 ist->st->codec->codec_type == ost->st->codec->codec_type) {
1898 if(best_nb_frames < ist->st->codec_info_nb_frames){
1899 best_nb_frames= ist->st->codec_info_nb_frames;
1910 ist = ist_table[j];
1911 if ( ist->st->codec->codec_type == ost->st->codec->codec_type
1912 && ist->st->discard != AVDISCARD_ALL) {
1927 ist = ist_table[ost->source_index];
1928 ist->discard = 0;
1931 stream_maps[n].sync_stream_index] : ist;
1940 ist = ist_table[ost->source_index];
1943 icodec = ist->st->codec;
1945 while ((t = av_metadata_get(ist->st->metadata, "", t, AV_METADATA_IGNORE_SUFFIX))) {
1949 ost->st->disposition = ist->st->disposition;
1968 if(av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/1000){
1972 codec->time_base = ist->st->time_base;
2011 ist->decoding_needed = 1;
2076 ist->decoding_needed = 1;
2080 ist->decoding_needed = 1;
2153 ist = ist_table[i];
2154 if (ist->decoding_needed) {
2157 codec = avcodec_find_decoder(ist->st->codec->codec_id);
2160 ist->st->codec->codec_id, ist->file_index, ist->index);
2164 if (avcodec_open(ist->st->codec, codec) < 0) {
2166 ist->file_index, ist->index);
2170 //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
2171 // ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD;
2178 ist = ist_table[i];
2179 st= ist->st;
2180 ist->pts = st->avg_frame_rate.num ? - st->codec->has_b_frames*AV_TIME_BASE / av_q2d(st->avg_frame_rate) : 0;
2181 ist->next_pts = AV_NOPTS_VALUE;
2182 ist->is_start = 1;
2308 ist = ist_table[ost->source_index];
2309 if(ist->is_past_recording_time || no_packet[ist->file_index])
2312 ipts = (double)ist->pts;
2313 if (!file_table[ist->file_index].eof_reached){
2316 if(input_sync ) file_index = ist->file_index;
2320 if(!input_sync) file_index = ist->file_index;
2370 ist = ist_table[ist_index];
2371 if (ist->discard)
2375 pkt.dts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base);
2377 pkt.pts += av_rescale_q(input_files_ts_offset[ist->file_index], AV_TIME_BASE_Q, ist->st->time_base);
2386 // fprintf(stderr, "next:%"PRId64" dts:%"PRId64" off:%"PRId64" %d\n", ist->next_pts, pkt.dts, input_files_ts_offset[ist->file_index], ist->st->codec->codec_type);
2387 if (pkt.dts != AV_NOPTS_VALUE && ist->next_pts != AV_NOPTS_VALUE
2389 int64_t pkt_dts= av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
2390 int64_t delta= pkt_dts - ist->next_pts;
2391 if((FFABS(delta) > 1LL*dts_delta_threshold*AV_TIME_BASE || pkt_dts+1<ist->pts)&& !copy_ts){
2392 input_files_ts_offset[ist->file_index]-= delta;
2394 fprintf(stderr, "timestamp discontinuity %"PRId64", new offset= %"PRId64"\n", delta, input_files_ts_offset[ist->file_index]);
2395 pkt.dts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
2397 pkt.pts-= av_rescale_q(delta, AV_TIME_BASE_Q, ist->st->time_base);
2403 av_compare_ts(pkt.pts, ist->st->time_base, recording_time + start_time, (AVRational){1, 1000000}) >= 0) {
2404 ist->is_past_recording_time = 1;
2408 //fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->index, pkt.size);
2409 if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) {
2413 ist->file_index, ist->index);
2429 ist = ist_table[i];
2430 if (ist->decoding_needed) {
2431 output_packet(ist, i, ost_table, nb_ostreams, NULL);
2457 ist = ist_table[i];
2458 if (ist->decoding_needed) {
2459 avcodec_close(ist->st->codec);
2472 ist = ist_table[i];
2473 av_free(ist);