avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack).
Unified · Split
| @@ -289,8 +289,6 @@ int main(int argc, char *argv[]) · 288 unmodified lines | |||
| 289 | return 1; | 289 | return 1; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | avfilter_register_all(); | ||
| 293 | |||
| 294 | /* Allocate the frame we will be using to store the data. */ | 292 | /* Allocate the frame we will be using to store the data. */ |
| 295 | frame = av_frame_alloc(); | 293 | frame = av_frame_alloc(); |
| 296 | if (!frame) { | 294 | if (!frame) { |
| @@ -228,8 +228,6 @@ int main(int argc, char **argv) · 227 unmodified lines | |||
| 228 | exit(1); | 228 | exit(1); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | avfilter_register_all(); | ||
| 232 | |||
| 233 | if ((ret = open_input_file(argv[1])) < 0) | 231 | if ((ret = open_input_file(argv[1])) < 0) |
| 234 | goto end; | 232 | goto end; |
| 235 | if ((ret = init_filters(filter_descr)) < 0) | 233 | if ((ret = init_filters(filter_descr)) < 0) |
| @@ -222,8 +222,6 @@ int main(int argc, char **argv) · 221 unmodified lines | |||
| 222 | exit(1); | 222 | exit(1); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | avfilter_register_all(); | ||
| 226 | |||
| 227 | if ((ret = open_input_file(argv[1])) < 0) | 225 | if ((ret = open_input_file(argv[1])) < 0) |
| 228 | goto end; | 226 | goto end; |
| 229 | if ((ret = init_filters(filter_descr)) < 0) | 227 | if ((ret = init_filters(filter_descr)) < 0) |
| @@ -517,8 +517,6 @@ int main(int argc, char **argv) · 516 unmodified lines | |||
| 517 | return 1; | 517 | return 1; |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | avfilter_register_all(); | ||
| 521 | |||
| 522 | if ((ret = open_input_file(argv[1])) < 0) | 520 | if ((ret = open_input_file(argv[1])) < 0) |
| 523 | goto end; | 521 | goto end; |
| 524 | if ((ret = open_output_file(argv[2])) < 0) | 522 | if ((ret = open_output_file(argv[2])) < 0) |
| @@ -4776,12 +4776,9 @@ int main(int argc, char **argv) · 4775 unmodified lines | |||
| 4776 | argv++; | 4776 | argv++; |
| 4777 | } | 4777 | } |
| 4778 | 4778 | ||
| 4779 | avcodec_register_all(); | ||
| 4780 | #if CONFIG_AVDEVICE | 4779 | #if CONFIG_AVDEVICE |
| 4781 | avdevice_register_all(); | 4780 | avdevice_register_all(); |
| 4782 | #endif | 4781 | #endif |
| 4783 | avfilter_register_all(); | ||
| 4784 | av_register_all(); | ||
| 4785 | avformat_network_init(); | 4782 | avformat_network_init(); |
| 4786 | 4783 | ||
| 4787 | show_banner(argc, argv, options); | 4784 | show_banner(argc, argv, options); |
| @@ -3655,10 +3655,6 @@ int main(int argc, char **argv) · 3654 unmodified lines | |||
| 3655 | #if CONFIG_AVDEVICE | 3655 | #if CONFIG_AVDEVICE |
| 3656 | avdevice_register_all(); | 3656 | avdevice_register_all(); |
| 3657 | #endif | 3657 | #endif |
| 3658 | #if CONFIG_AVFILTER | ||
| 3659 | avfilter_register_all(); | ||
| 3660 | #endif | ||
| 3661 | av_register_all(); | ||
| 3662 | avformat_network_init(); | 3658 | avformat_network_init(); |
| 3663 | 3659 | ||
| 3664 | init_opts(); | 3660 | init_opts(); |
| @@ -3567,7 +3567,6 @@ int main(int argc, char **argv) · 3566 unmodified lines | |||
| 3567 | 3567 | ||
| 3568 | options = real_options; | 3568 | options = real_options; |
| 3569 | parse_loglevel(argc, argv, options); | 3569 | parse_loglevel(argc, argv, options); |
| 3570 | av_register_all(); | ||
| 3571 | avformat_network_init(); | 3570 | avformat_network_init(); |
| 3572 | init_opts(); | 3571 | init_opts(); |
| 3573 | #if CONFIG_AVDEVICE | 3572 | #if CONFIG_AVDEVICE |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | |||
| 21 | int main(void){ | 21 | int main(void){ |
| 22 | AVCodec *codec = NULL; | 22 | AVCodec *codec = NULL; |
| 23 | int ret = 0; | 23 | int ret = 0; |
| 24 | avcodec_register_all(); | ||
| 25 | 24 | ||
| 26 | while (codec = av_codec_next(codec)) { | 25 | while (codec = av_codec_next(codec)) { |
| 27 | if (av_codec_is_encoder(codec)) { | 26 | if (av_codec_is_encoder(codec)) { |
| @@ -130,8 +130,6 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) · 129 unmodified lines | |||
| 130 | if (!pix_fmts) | 130 | if (!pix_fmts) |
| 131 | FAIL(AVERROR(ENOMEM)); | 131 | FAIL(AVERROR(ENOMEM)); |
| 132 | 132 | ||
| 133 | avfilter_register_all(); | ||
| 134 | |||
| 135 | buffersink = avfilter_get_by_name("buffersink"); | 133 | buffersink = avfilter_get_by_name("buffersink"); |
| 136 | abuffersink = avfilter_get_by_name("abuffersink"); | 134 | abuffersink = avfilter_get_by_name("abuffersink"); |
| 137 | 135 | ||
| @@ -37,8 +37,6 @@ int ff_load_image(uint8_t *data[4], int linesize[4], · 36 unmodified lines | |||
| 37 | 37 | ||
| 38 | av_init_packet(&pkt); | 38 | av_init_packet(&pkt); |
| 39 | 39 | ||
| 40 | av_register_all(); | ||
| 41 | |||
| 42 | iformat = av_find_input_format("image2pipe"); | 40 | iformat = av_find_input_format("image2pipe"); |
| 43 | if ((ret = avformat_open_input(&format_ctx, filename, iformat, NULL)) < 0) { | 41 | if ((ret = avformat_open_input(&format_ctx, filename, iformat, NULL)) < 0) { |
| 44 | av_log(log_ctx, AV_LOG_ERROR, | 42 | av_log(log_ctx, AV_LOG_ERROR, |
| @@ -239,8 +239,6 @@ static av_cold int movie_common_init(AVFilterContext *ctx) · 238 unmodified lines | |||
| 239 | return AVERROR_PATCHWELCOME; | 239 | return AVERROR_PATCHWELCOME; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | av_register_all(); | ||
| 243 | |||
| 244 | // Try to find the movie format (container) | 242 | // Try to find the movie format (container) |
| 245 | iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL; | 243 | iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL; |
| 246 | 244 | ||
| @@ -97,8 +97,6 @@ int main(int argc, char **argv) · 96 unmodified lines | |||
| 97 | if (!graph_ctx) | 97 | if (!graph_ctx) |
| 98 | return 1; | 98 | return 1; |
| 99 | 99 | ||
| 100 | avfilter_register_all(); | ||
| 101 | |||
| 102 | /* get a corresponding filter and open it */ | 100 | /* get a corresponding filter and open it */ |
| 103 | if (!(filter = avfilter_get_by_name(filter_name))) { | 101 | if (!(filter = avfilter_get_by_name(filter_name))) { |
| 104 | fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name); | 102 | fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name); |
| @@ -379,8 +379,6 @@ int main(int argc, char **argv) · 378 unmodified lines | |||
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | av_register_all(); | ||
| 383 | |||
| 384 | md5 = av_md5_alloc(); | 382 | md5 = av_md5_alloc(); |
| 385 | if (!md5) | 383 | if (!md5) |
| 386 | return 1; | 384 | return 1; |
| @@ -91,9 +91,6 @@ int main(int argc, char **argv) · 90 unmodified lines | |||
| 91 | av_dict_set(&format_opts, "channels", "1", 0); | 91 | av_dict_set(&format_opts, "channels", "1", 0); |
| 92 | av_dict_set(&format_opts, "sample_rate", "22050", 0); | 92 | av_dict_set(&format_opts, "sample_rate", "22050", 0); |
| 93 | 93 | ||
| 94 | /* initialize libavcodec, and register all codecs and formats */ | ||
| 95 | av_register_all(); | ||
| 96 | |||
| 97 | if (argc < 2) { | 94 | if (argc < 2) { |
| 98 | printf("usage: %s input_file\n" | 95 | printf("usage: %s input_file\n" |
| 99 | "\n", argv[0]); | 96 | "\n", argv[0]); |
| @@ -214,8 +214,6 @@ int main(int argc, char **argv) · 213 unmodified lines | |||
| 214 | return 1; | 214 | return 1; |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | av_register_all(); | ||
| 218 | |||
| 219 | if (video_decode(argv[1]) != 0) | 217 | if (video_decode(argv[1]) != 0) |
| 220 | return 1; | 218 | return 1; |
| 221 | 219 | ||
| @@ -231,8 +231,6 @@ int main(int argc, char* argv[]) · 230 unmodified lines | |||
| 231 | AVFormatContext *fmt_ctx = NULL; | 231 | AVFormatContext *fmt_ctx = NULL; |
| 232 | AVFormatContext *fmt_ctx_no_decode = NULL; | 232 | AVFormatContext *fmt_ctx_no_decode = NULL; |
| 233 | 233 | ||
| 234 | av_register_all(); | ||
| 235 | |||
| 236 | if (argc < 2) { | 234 | if (argc < 2) { |
| 237 | av_log(NULL, AV_LOG_ERROR, "Usage: %s <input>\n", argv[0]); | 235 | av_log(NULL, AV_LOG_ERROR, "Usage: %s <input>\n", argv[0]); |
| 238 | return -1; | 236 | return -1; |
| @@ -245,8 +245,6 @@ int main(void) · 244 unmodified lines | |||
| 245 | int sample_rates[] = {8000, 44100, 48000, 192000}; | 245 | int sample_rates[] = {8000, 44100, 48000, 192000}; |
| 246 | int cl, sr; | 246 | int cl, sr; |
| 247 | 247 | ||
| 248 | avcodec_register_all(); | ||
| 249 | |||
| 250 | enc = avcodec_find_encoder(AV_CODEC_ID_FLAC); | 248 | enc = avcodec_find_encoder(AV_CODEC_ID_FLAC); |
| 251 | if (!enc) { | 249 | if (!enc) { |
| 252 | av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n"); | 250 | av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n"); |
| @@ -158,8 +158,6 @@ int main(int argc, char **argv) · 157 unmodified lines | |||
| 158 | return 1; | 158 | return 1; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | av_register_all(); | ||
| 162 | |||
| 163 | if (video_decode_example(argv[1]) != 0) | 161 | if (video_decode_example(argv[1]) != 0) |
| 164 | return 1; | 162 | return 1; |
| 165 | 163 | ||
| @@ -279,8 +279,6 @@ int main(int argc, char **argv) · 278 unmodified lines | |||
| 279 | return 1; | 279 | return 1; |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | av_register_all(); | ||
| 283 | |||
| 284 | if (seek_test(argv[1], argv[2], argv[3]) != 0) | 282 | if (seek_test(argv[1], argv[2], argv[3]) != 0) |
| 285 | return 1; | 283 | return 1; |
| 286 | 284 | ||
| @@ -42,7 +42,6 @@ int main(int argc, char **argv) · 41 unmodified lines | |||
| 42 | AVDictionary *in_opts = NULL; | 42 | AVDictionary *in_opts = NULL; |
| 43 | AVDictionary *out_opts = NULL; | 43 | AVDictionary *out_opts = NULL; |
| 44 | 44 | ||
| 45 | av_register_all(); | ||
| 46 | avformat_network_init(); | 45 | avformat_network_init(); |
| 47 | 46 | ||
| 48 | for (i = 1; i < argc; i++) { | 47 | for (i = 1; i < argc; i++) { |
| @@ -130,8 +130,6 @@ int main(int argc, char **argv) · 129 unmodified lines | |||
| 130 | if (argc < 2) | 130 | if (argc < 2) |
| 131 | print_usage(); | 131 | print_usage(); |
| 132 | 132 | ||
| 133 | av_register_all(); | ||
| 134 | |||
| 135 | if (!strcmp(argv[1], "format")) | 133 | if (!strcmp(argv[1], "format")) |
| 136 | show_format_opts(); | 134 | show_format_opts(); |
| 137 | else if (!strcmp(argv[1], "codec")) | 135 | else if (!strcmp(argv[1], "codec")) |
| @@ -189,8 +189,6 @@ int main(int argc, char **argv) · 188 unmodified lines | |||
| 189 | *p = '\0'; | 189 | *p = '\0'; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | avfilter_register_all(); | ||
| 193 | |||
| 194 | if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) { | 192 | if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) { |
| 195 | fprintf(stderr, "Failed to parse the graph description\n"); | 193 | fprintf(stderr, "Failed to parse the graph description\n"); |
| 196 | return 1; | 194 | return 1; |
| @@ -791,8 +791,6 @@ int main(int argc, char **argv) · 790 unmodified lines | |||
| 791 | int split = 0, ismf = 0, i; | 791 | int split = 0, ismf = 0, i; |
| 792 | struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 }; | 792 | struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 }; |
| 793 | 793 | ||
| 794 | av_register_all(); | ||
| 795 | |||
| 796 | for (i = 1; i < argc; i++) { | 794 | for (i = 1; i < argc; i++) { |
| 797 | if (!strcmp(argv[i], "-n")) { | 795 | if (!strcmp(argv[i], "-n")) { |
| 798 | basename = argv[i + 1]; | 796 | basename = argv[i + 1]; |
| @@ -89,9 +89,6 @@ int main(int argc, char **argv) · 88 unmodified lines | |||
| 89 | strcat(fntemplate, PKTFILESUFF); | 89 | strcat(fntemplate, PKTFILESUFF); |
| 90 | printf("FNTEMPLATE: '%s'\n", fntemplate); | 90 | printf("FNTEMPLATE: '%s'\n", fntemplate); |
| 91 | 91 | ||
| 92 | // register all file formats | ||
| 93 | av_register_all(); | ||
| 94 | |||
| 95 | err = avformat_open_input(&fctx, argv[1], NULL, NULL); | 92 | err = avformat_open_input(&fctx, argv[1], NULL, NULL); |
| 96 | if (err < 0) { | 93 | if (err < 0) { |
| 97 | fprintf(stderr, "cannot open input: error %d\n", err); | 94 | fprintf(stderr, "cannot open input: error %d\n", err); |
| @@ -124,9 +124,6 @@ int main(int argc, char **argv) · 123 unmodified lines | |||
| 124 | return 1; | 124 | return 1; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | avcodec_register_all(); | ||
| 128 | av_register_all(); | ||
| 129 | |||
| 130 | av_lfg_init(&state, 0xdeadbeef); | 127 | av_lfg_init(&state, 0xdeadbeef); |
| 131 | 128 | ||
| 132 | pd.buf = NULL; | 129 | pd.buf = NULL; |
| @@ -65,7 +65,6 @@ int main(int argc, char **argv) · 64 unmodified lines | |||
| 65 | argv++; | 65 | argv++; |
| 66 | argc--; | 66 | argc--; |
| 67 | 67 | ||
| 68 | av_register_all(); | ||
| 69 | if ((ret = avformat_open_input(&avf, filename, NULL, NULL)) < 0) { | 68 | if ((ret = avformat_open_input(&avf, filename, NULL, NULL)) < 0) { |
| 70 | fprintf(stderr, "%s: %s\n", filename, av_err2str(ret)); | 69 | fprintf(stderr, "%s: %s\n", filename, av_err2str(ret)); |
| 71 | return 1; | 70 | return 1; |
| @@ -363,8 +363,6 @@ int main(int argc, char **argv) · 362 unmodified lines | |||
| 363 | struct Tracks tracks = { 0 }; | 363 | struct Tracks tracks = { 0 }; |
| 364 | int i; | 364 | int i; |
| 365 | 365 | ||
| 366 | av_register_all(); | ||
| 367 | |||
| 368 | for (i = 1; i < argc; i++) { | 366 | for (i = 1; i < argc; i++) { |
| 369 | if (!strcmp(argv[i], "-out")) { | 367 | if (!strcmp(argv[i], "-out")) { |
| 370 | out = argv[i + 1]; | 368 | out = argv[i + 1]; |
| @@ -62,9 +62,7 @@ int main(int argc, char **argv) · 61 unmodified lines | |||
| 62 | out_dev_name = argv + 2; | 62 | out_dev_name = argv + 2; |
| 63 | nb_out_dev = argc - 2; | 63 | nb_out_dev = argc - 2; |
| 64 | 64 | ||
| 65 | av_register_all(); | ||
| 66 | avdevice_register_all(); | 65 | avdevice_register_all(); |
| 67 | avfilter_register_all(); | ||
| 68 | 66 | ||
| 69 | /* Create input graph */ | 67 | /* Create input graph */ |
| 70 | if (!(in_graph = avfilter_graph_alloc())) { | 68 | if (!(in_graph = avfilter_graph_alloc())) { |