avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack). Signed-off-by: Josh de Kock <josh@itanimul.li>tags/n4.0
| @@ -289,8 +289,6 @@ int main(int argc, char *argv[]) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| avfilter_register_all(); | |||||
| /* Allocate the frame we will be using to store the data. */ | /* Allocate the frame we will be using to store the data. */ | ||||
| frame = av_frame_alloc(); | frame = av_frame_alloc(); | ||||
| if (!frame) { | if (!frame) { | ||||
| @@ -228,8 +228,6 @@ int main(int argc, char **argv) | |||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| avfilter_register_all(); | |||||
| if ((ret = open_input_file(argv[1])) < 0) | if ((ret = open_input_file(argv[1])) < 0) | ||||
| goto end; | goto end; | ||||
| if ((ret = init_filters(filter_descr)) < 0) | if ((ret = init_filters(filter_descr)) < 0) | ||||
| @@ -222,8 +222,6 @@ int main(int argc, char **argv) | |||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| avfilter_register_all(); | |||||
| if ((ret = open_input_file(argv[1])) < 0) | if ((ret = open_input_file(argv[1])) < 0) | ||||
| goto end; | goto end; | ||||
| if ((ret = init_filters(filter_descr)) < 0) | if ((ret = init_filters(filter_descr)) < 0) | ||||
| @@ -517,8 +517,6 @@ int main(int argc, char **argv) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| avfilter_register_all(); | |||||
| if ((ret = open_input_file(argv[1])) < 0) | if ((ret = open_input_file(argv[1])) < 0) | ||||
| goto end; | goto end; | ||||
| if ((ret = open_output_file(argv[2])) < 0) | if ((ret = open_output_file(argv[2])) < 0) | ||||
| @@ -4776,12 +4776,9 @@ int main(int argc, char **argv) | |||||
| argv++; | argv++; | ||||
| } | } | ||||
| avcodec_register_all(); | |||||
| #if CONFIG_AVDEVICE | #if CONFIG_AVDEVICE | ||||
| avdevice_register_all(); | avdevice_register_all(); | ||||
| #endif | #endif | ||||
| avfilter_register_all(); | |||||
| av_register_all(); | |||||
| avformat_network_init(); | avformat_network_init(); | ||||
| show_banner(argc, argv, options); | show_banner(argc, argv, options); | ||||
| @@ -3655,10 +3655,6 @@ int main(int argc, char **argv) | |||||
| #if CONFIG_AVDEVICE | #if CONFIG_AVDEVICE | ||||
| avdevice_register_all(); | avdevice_register_all(); | ||||
| #endif | #endif | ||||
| #if CONFIG_AVFILTER | |||||
| avfilter_register_all(); | |||||
| #endif | |||||
| av_register_all(); | |||||
| avformat_network_init(); | avformat_network_init(); | ||||
| init_opts(); | init_opts(); | ||||
| @@ -3567,7 +3567,6 @@ int main(int argc, char **argv) | |||||
| options = real_options; | options = real_options; | ||||
| parse_loglevel(argc, argv, options); | parse_loglevel(argc, argv, options); | ||||
| av_register_all(); | |||||
| avformat_network_init(); | avformat_network_init(); | ||||
| init_opts(); | init_opts(); | ||||
| #if CONFIG_AVDEVICE | #if CONFIG_AVDEVICE | ||||
| @@ -21,7 +21,6 @@ | |||||
| int main(void){ | int main(void){ | ||||
| AVCodec *codec = NULL; | AVCodec *codec = NULL; | ||||
| int ret = 0; | int ret = 0; | ||||
| avcodec_register_all(); | |||||
| while (codec = av_codec_next(codec)) { | while (codec = av_codec_next(codec)) { | ||||
| if (av_codec_is_encoder(codec)) { | if (av_codec_is_encoder(codec)) { | ||||
| @@ -130,8 +130,6 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) | |||||
| if (!pix_fmts) | if (!pix_fmts) | ||||
| FAIL(AVERROR(ENOMEM)); | FAIL(AVERROR(ENOMEM)); | ||||
| avfilter_register_all(); | |||||
| buffersink = avfilter_get_by_name("buffersink"); | buffersink = avfilter_get_by_name("buffersink"); | ||||
| abuffersink = avfilter_get_by_name("abuffersink"); | abuffersink = avfilter_get_by_name("abuffersink"); | ||||
| @@ -37,8 +37,6 @@ int ff_load_image(uint8_t *data[4], int linesize[4], | |||||
| av_init_packet(&pkt); | av_init_packet(&pkt); | ||||
| av_register_all(); | |||||
| iformat = av_find_input_format("image2pipe"); | iformat = av_find_input_format("image2pipe"); | ||||
| if ((ret = avformat_open_input(&format_ctx, filename, iformat, NULL)) < 0) { | if ((ret = avformat_open_input(&format_ctx, filename, iformat, NULL)) < 0) { | ||||
| av_log(log_ctx, AV_LOG_ERROR, | av_log(log_ctx, AV_LOG_ERROR, | ||||
| @@ -239,8 +239,6 @@ static av_cold int movie_common_init(AVFilterContext *ctx) | |||||
| return AVERROR_PATCHWELCOME; | return AVERROR_PATCHWELCOME; | ||||
| } | } | ||||
| av_register_all(); | |||||
| // Try to find the movie format (container) | // Try to find the movie format (container) | ||||
| iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL; | iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL; | ||||
| @@ -97,8 +97,6 @@ int main(int argc, char **argv) | |||||
| if (!graph_ctx) | if (!graph_ctx) | ||||
| return 1; | return 1; | ||||
| avfilter_register_all(); | |||||
| /* get a corresponding filter and open it */ | /* get a corresponding filter and open it */ | ||||
| if (!(filter = avfilter_get_by_name(filter_name))) { | if (!(filter = avfilter_get_by_name(filter_name))) { | ||||
| fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name); | fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name); | ||||
| @@ -379,8 +379,6 @@ int main(int argc, char **argv) | |||||
| } | } | ||||
| } | } | ||||
| av_register_all(); | |||||
| md5 = av_md5_alloc(); | md5 = av_md5_alloc(); | ||||
| if (!md5) | if (!md5) | ||||
| return 1; | return 1; | ||||
| @@ -91,9 +91,6 @@ int main(int argc, char **argv) | |||||
| av_dict_set(&format_opts, "channels", "1", 0); | av_dict_set(&format_opts, "channels", "1", 0); | ||||
| av_dict_set(&format_opts, "sample_rate", "22050", 0); | av_dict_set(&format_opts, "sample_rate", "22050", 0); | ||||
| /* initialize libavcodec, and register all codecs and formats */ | |||||
| av_register_all(); | |||||
| if (argc < 2) { | if (argc < 2) { | ||||
| printf("usage: %s input_file\n" | printf("usage: %s input_file\n" | ||||
| "\n", argv[0]); | "\n", argv[0]); | ||||
| @@ -214,8 +214,6 @@ int main(int argc, char **argv) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| av_register_all(); | |||||
| if (video_decode(argv[1]) != 0) | if (video_decode(argv[1]) != 0) | ||||
| return 1; | return 1; | ||||
| @@ -231,8 +231,6 @@ int main(int argc, char* argv[]) | |||||
| AVFormatContext *fmt_ctx = NULL; | AVFormatContext *fmt_ctx = NULL; | ||||
| AVFormatContext *fmt_ctx_no_decode = NULL; | AVFormatContext *fmt_ctx_no_decode = NULL; | ||||
| av_register_all(); | |||||
| if (argc < 2) { | if (argc < 2) { | ||||
| av_log(NULL, AV_LOG_ERROR, "Usage: %s <input>\n", argv[0]); | av_log(NULL, AV_LOG_ERROR, "Usage: %s <input>\n", argv[0]); | ||||
| return -1; | return -1; | ||||
| @@ -245,8 +245,6 @@ int main(void) | |||||
| int sample_rates[] = {8000, 44100, 48000, 192000}; | int sample_rates[] = {8000, 44100, 48000, 192000}; | ||||
| int cl, sr; | int cl, sr; | ||||
| avcodec_register_all(); | |||||
| enc = avcodec_find_encoder(AV_CODEC_ID_FLAC); | enc = avcodec_find_encoder(AV_CODEC_ID_FLAC); | ||||
| if (!enc) { | if (!enc) { | ||||
| av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n"); | av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n"); | ||||
| @@ -158,8 +158,6 @@ int main(int argc, char **argv) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| av_register_all(); | |||||
| if (video_decode_example(argv[1]) != 0) | if (video_decode_example(argv[1]) != 0) | ||||
| return 1; | return 1; | ||||
| @@ -279,8 +279,6 @@ int main(int argc, char **argv) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| av_register_all(); | |||||
| if (seek_test(argv[1], argv[2], argv[3]) != 0) | if (seek_test(argv[1], argv[2], argv[3]) != 0) | ||||
| return 1; | return 1; | ||||
| @@ -42,7 +42,6 @@ int main(int argc, char **argv) | |||||
| AVDictionary *in_opts = NULL; | AVDictionary *in_opts = NULL; | ||||
| AVDictionary *out_opts = NULL; | AVDictionary *out_opts = NULL; | ||||
| av_register_all(); | |||||
| avformat_network_init(); | avformat_network_init(); | ||||
| for (i = 1; i < argc; i++) { | for (i = 1; i < argc; i++) { | ||||
| @@ -130,8 +130,6 @@ int main(int argc, char **argv) | |||||
| if (argc < 2) | if (argc < 2) | ||||
| print_usage(); | print_usage(); | ||||
| av_register_all(); | |||||
| if (!strcmp(argv[1], "format")) | if (!strcmp(argv[1], "format")) | ||||
| show_format_opts(); | show_format_opts(); | ||||
| else if (!strcmp(argv[1], "codec")) | else if (!strcmp(argv[1], "codec")) | ||||
| @@ -189,8 +189,6 @@ int main(int argc, char **argv) | |||||
| *p = '\0'; | *p = '\0'; | ||||
| } | } | ||||
| avfilter_register_all(); | |||||
| if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) { | if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) { | ||||
| fprintf(stderr, "Failed to parse the graph description\n"); | fprintf(stderr, "Failed to parse the graph description\n"); | ||||
| return 1; | return 1; | ||||
| @@ -791,8 +791,6 @@ int main(int argc, char **argv) | |||||
| int split = 0, ismf = 0, i; | int split = 0, ismf = 0, i; | ||||
| struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 }; | struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 }; | ||||
| av_register_all(); | |||||
| for (i = 1; i < argc; i++) { | for (i = 1; i < argc; i++) { | ||||
| if (!strcmp(argv[i], "-n")) { | if (!strcmp(argv[i], "-n")) { | ||||
| basename = argv[i + 1]; | basename = argv[i + 1]; | ||||
| @@ -89,9 +89,6 @@ int main(int argc, char **argv) | |||||
| strcat(fntemplate, PKTFILESUFF); | strcat(fntemplate, PKTFILESUFF); | ||||
| printf("FNTEMPLATE: '%s'\n", fntemplate); | printf("FNTEMPLATE: '%s'\n", fntemplate); | ||||
| // register all file formats | |||||
| av_register_all(); | |||||
| err = avformat_open_input(&fctx, argv[1], NULL, NULL); | err = avformat_open_input(&fctx, argv[1], NULL, NULL); | ||||
| if (err < 0) { | if (err < 0) { | ||||
| fprintf(stderr, "cannot open input: error %d\n", err); | fprintf(stderr, "cannot open input: error %d\n", err); | ||||
| @@ -124,9 +124,6 @@ int main(int argc, char **argv) | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| avcodec_register_all(); | |||||
| av_register_all(); | |||||
| av_lfg_init(&state, 0xdeadbeef); | av_lfg_init(&state, 0xdeadbeef); | ||||
| pd.buf = NULL; | pd.buf = NULL; | ||||
| @@ -65,7 +65,6 @@ int main(int argc, char **argv) | |||||
| argv++; | argv++; | ||||
| argc--; | argc--; | ||||
| av_register_all(); | |||||
| if ((ret = avformat_open_input(&avf, filename, NULL, NULL)) < 0) { | if ((ret = avformat_open_input(&avf, filename, NULL, NULL)) < 0) { | ||||
| fprintf(stderr, "%s: %s\n", filename, av_err2str(ret)); | fprintf(stderr, "%s: %s\n", filename, av_err2str(ret)); | ||||
| return 1; | return 1; | ||||
| @@ -363,8 +363,6 @@ int main(int argc, char **argv) | |||||
| struct Tracks tracks = { 0 }; | struct Tracks tracks = { 0 }; | ||||
| int i; | int i; | ||||
| av_register_all(); | |||||
| for (i = 1; i < argc; i++) { | for (i = 1; i < argc; i++) { | ||||
| if (!strcmp(argv[i], "-out")) { | if (!strcmp(argv[i], "-out")) { | ||||
| out = argv[i + 1]; | out = argv[i + 1]; | ||||
| @@ -62,9 +62,7 @@ int main(int argc, char **argv) | |||||
| out_dev_name = argv + 2; | out_dev_name = argv + 2; | ||||
| nb_out_dev = argc - 2; | nb_out_dev = argc - 2; | ||||
| av_register_all(); | |||||
| avdevice_register_all(); | avdevice_register_all(); | ||||
| avfilter_register_all(); | |||||
| /* Create input graph */ | /* Create input graph */ | ||||
| if (!(in_graph = avfilter_graph_alloc())) { | if (!(in_graph = avfilter_graph_alloc())) { | ||||