Reduce diff against avconv, and change some doxycomments into normal comments (no point in doxifying ffmpeg internal fields).
Unified · Split
| @@ -35,6 +35,7 @@ · 34 unmodified lines | |||
| 35 | #include "libavformat/avformat.h" | 35 | #include "libavformat/avformat.h" |
| 36 | #include "libavdevice/avdevice.h" | 36 | #include "libavdevice/avdevice.h" |
| 37 | #include "libswscale/swscale.h" | 37 | #include "libswscale/swscale.h" |
| 38 | #include "libswresample/swresample.h" | ||
| 38 | #include "libavutil/opt.h" | 39 | #include "libavutil/opt.h" |
| 39 | #include "libavutil/audioconvert.h" | 40 | #include "libavutil/audioconvert.h" |
| 40 | #include "libavutil/parseutils.h" | 41 | #include "libavutil/parseutils.h" |
| @@ -51,15 +52,14 @@ · 10 unmodified lines | |||
| 51 | #include "libavutil/timestamp.h" | 52 | #include "libavutil/timestamp.h" |
| 52 | #include "libavutil/bprint.h" | 53 | #include "libavutil/bprint.h" |
| 53 | #include "libavformat/os_support.h" | 54 | #include "libavformat/os_support.h" |
| 54 | #include "libswresample/swresample.h" | ||
| 55 | 55 | ||
| 56 | #include "libavformat/ffm.h" // not public API | 56 | #include "libavformat/ffm.h" // not public API |
| 57 | 57 | ||
| 58 | # include "libavfilter/avcodec.h" | 58 | # include "libavfilter/avcodec.h" |
| 59 | # include "libavfilter/avfilter.h" | 59 | # include "libavfilter/avfilter.h" |
| 60 | # include "libavfilter/avfiltergraph.h" | 60 | # include "libavfilter/avfiltergraph.h" |
| 61 | # include "libavfilter/buffersink.h" | ||
| 62 | # include "libavfilter/buffersrc.h" | 61 | # include "libavfilter/buffersrc.h" |
| 62 | # include "libavfilter/buffersink.h" | ||
| 63 | 63 | ||
| 64 | #if HAVE_SYS_RESOURCE_H | 64 | #if HAVE_SYS_RESOURCE_H |
| 65 | #include <sys/types.h> | 65 | #include <sys/types.h> |
| @@ -97,7 +97,6 @@ · 31 unmodified lines | |||
| 97 | #define VSYNC_VFR 2 | 97 | #define VSYNC_VFR 2 |
| 98 | #define VSYNC_DROP 0xff | 98 | #define VSYNC_DROP 0xff |
| 99 | 99 | ||
| 100 | // #define SRCA | ||
| 101 | #define SINKA | 100 | #define SINKA |
| 102 | 101 | ||
| 103 | const char program_name[] = "ffmpeg"; | 102 | const char program_name[] = "ffmpeg"; |
| @@ -228,8 +227,8 @@ typedef struct InputStream { · 124 unmodified lines | |||
| 228 | /* dts of the last packet read for this stream */ | 227 | /* dts of the last packet read for this stream */ |
| 229 | int64_t dts; | 228 | int64_t dts; |
| 230 | 229 | ||
| 231 | int64_t next_pts; ///< synthetic pts for the next decode frame | 230 | int64_t next_pts; /* synthetic pts for the next decode frame */ |
| 232 | int64_t pts; ///< current pts of the decoded frame | 231 | int64_t pts; /* current pts of the decoded frame */ |
| 233 | double ts_scale; | 232 | double ts_scale; |
| 234 | int is_start; /* is 1 at the start and after a discontinuity */ | 233 | int is_start; /* is 1 at the start and after a discontinuity */ |
| 235 | int saw_first_ts; | 234 | int saw_first_ts; |
| @@ -376,8 +375,8 @@ typedef struct OptionsContext { · 140 unmodified lines | |||
| 376 | /* output options */ | 375 | /* output options */ |
| 377 | StreamMap *stream_maps; | 376 | StreamMap *stream_maps; |
| 378 | int nb_stream_maps; | 377 | int nb_stream_maps; |
| 379 | AudioChannelMap *audio_channel_maps; ///< one info entry per -map_channel | 378 | AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */ |
| 380 | int nb_audio_channel_maps; ///< number of (valid) -map_channel settings | 379 | int nb_audio_channel_maps; /* number of (valid) -map_channel settings */ |
| 381 | int metadata_global_manual; | 380 | int metadata_global_manual; |
| 382 | int metadata_streams_manual; | 381 | int metadata_streams_manual; |
| 383 | int metadata_chapters_manual; | 382 | int metadata_chapters_manual; |
| @@ -931,8 +930,10 @@ static int configure_video_filters(FilterGraph *fg, AVFilterContext **in_filter, · 547 unmodified lines | |||
| 931 | sample_aspect_ratio = ist->st->codec->sample_aspect_ratio; | 930 | sample_aspect_ratio = ist->st->codec->sample_aspect_ratio; |
| 932 | 931 | ||
| 933 | snprintf(args, 255, "%d:%d:%d:%d:%d:%d:%d:flags=%d", ist->st->codec->width, | 932 | snprintf(args, 255, "%d:%d:%d:%d:%d:%d:%d:flags=%d", ist->st->codec->width, |
| 934 | ist->st->codec->height, ist->st->codec->pix_fmt, 1, AV_TIME_BASE, | 933 | ist->st->codec->height, ist->st->codec->pix_fmt, |
| 935 | sample_aspect_ratio.num, sample_aspect_ratio.den, SWS_BILINEAR + ((ist->st->codec->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0)); | 934 | 1, AV_TIME_BASE, |
| 935 | sample_aspect_ratio.num, sample_aspect_ratio.den, | ||
| 936 | SWS_BILINEAR + ((ist->st->codec->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0)); | ||
| 936 | 937 | ||
| 937 | ret = avfilter_graph_create_filter(&fg->inputs[0]->filter, | 938 | ret = avfilter_graph_create_filter(&fg->inputs[0]->filter, |
| 938 | avfilter_get_by_name("buffer"), | 939 | avfilter_get_by_name("buffer"), |
| @@ -1482,7 +1483,7 @@ void av_noreturn exit_program(int ret) · 543 unmodified lines | |||
| 1482 | exit (255); | 1483 | exit (255); |
| 1483 | } | 1484 | } |
| 1484 | 1485 | ||
| 1485 | exit(ret); /* not all OS-es handle main() return value */ | 1486 | exit(ret); |
| 1486 | } | 1487 | } |
| 1487 | 1488 | ||
| 1488 | static void assert_avoptions(AVDictionary *m) | 1489 | static void assert_avoptions(AVDictionary *m) |
| @@ -1645,9 +1646,8 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost, · 156 unmodified lines | |||
| 1645 | if (got_packet) { | 1646 | if (got_packet) { |
| 1646 | if (pkt.pts != AV_NOPTS_VALUE) | 1647 | if (pkt.pts != AV_NOPTS_VALUE) |
| 1647 | pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); | 1648 | pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); |
| 1648 | if (pkt.dts != AV_NOPTS_VALUE) { | 1649 | if (pkt.dts != AV_NOPTS_VALUE) |
| 1649 | pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); | 1650 | pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); |
| 1650 | } | ||
| 1651 | if (pkt.duration > 0) | 1651 | if (pkt.duration > 0) |
| 1652 | pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); | 1652 | pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); |
| 1653 | 1653 | ||
| @@ -2534,7 +2534,6 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int · 880 unmodified lines | |||
| 2534 | ist->next_pts = ist->pts = decoded_frame->pts = best_effort_timestamp; | 2534 | ist->next_pts = ist->pts = decoded_frame->pts = best_effort_timestamp; |
| 2535 | 2535 | ||
| 2536 | pkt->size = 0; | 2536 | pkt->size = 0; |
| 2537 | |||
| 2538 | pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free); | 2537 | pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free); |
| 2539 | 2538 | ||
| 2540 | rate_emu_sleep(ist); | 2539 | rate_emu_sleep(ist); |
| @@ -3085,7 +3084,7 @@ static int transcode_init(void) · 544 unmodified lines | |||
| 3085 | size_t logbuffer_size; | 3084 | size_t logbuffer_size; |
| 3086 | if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) { | 3085 | if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) { |
| 3087 | av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n", | 3086 | av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n", |
| 3088 | logfilename); | 3087 | logfilename); |
| 3089 | exit_program(1); | 3088 | exit_program(1); |
| 3090 | } | 3089 | } |
| 3091 | codec->stats_in = logbuffer; | 3090 | codec->stats_in = logbuffer; |
| @@ -4978,7 +4977,7 @@ loop_end: · 1886 unmodified lines | |||
| 4978 | case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break; | 4977 | case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break; |
| 4979 | default: | 4978 | default: |
| 4980 | av_log(NULL, AV_LOG_FATAL, "Cannot map stream #%d:%d - unsupported type.\n", | 4979 | av_log(NULL, AV_LOG_FATAL, "Cannot map stream #%d:%d - unsupported type.\n", |
| 4981 | map->file_index, map->stream_index); | 4980 | map->file_index, map->stream_index); |
| 4982 | exit_program(1); | 4981 | exit_program(1); |
| 4983 | } | 4982 | } |
| 4984 | } | 4983 | } |