Unified · Split
| @@ -143,8 +143,6 @@ int main(int argc, char *argv[]) · 142 unmodified lines | |||
| 143 | return 1; | 143 | return 1; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | /* register codecs and formats and other lavf/lavc components*/ | ||
| 147 | av_register_all(); | ||
| 148 | avformat_network_init(); | 146 | avformat_network_init(); |
| 149 | 147 | ||
| 150 | op = argv[1]; | 148 | op = argv[1]; |
| @@ -74,9 +74,6 @@ int main(int argc, char *argv[]) · 73 unmodified lines | |||
| 74 | } | 74 | } |
| 75 | input_filename = argv[1]; | 75 | input_filename = argv[1]; |
| 76 | 76 | ||
| 77 | /* register codecs and formats and other lavf/lavc components*/ | ||
| 78 | av_register_all(); | ||
| 79 | |||
| 80 | /* slurp file content into buffer */ | 77 | /* slurp file content into buffer */ |
| 81 | ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL); | 78 | ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL); |
| 82 | if (ret < 0) | 79 | if (ret < 0) |
| @@ -94,9 +94,6 @@ int main(int argc, char **argv) · 93 unmodified lines | |||
| 94 | filename = argv[1]; | 94 | filename = argv[1]; |
| 95 | outfilename = argv[2]; | 95 | outfilename = argv[2]; |
| 96 | 96 | ||
| 97 | /* register all the codecs */ | ||
| 98 | avcodec_register_all(); | ||
| 99 | |||
| 100 | pkt = av_packet_alloc(); | 97 | pkt = av_packet_alloc(); |
| 101 | 98 | ||
| 102 | /* find the MPEG audio decoder */ | 99 | /* find the MPEG audio decoder */ |
| @@ -101,8 +101,6 @@ int main(int argc, char **argv) · 100 unmodified lines | |||
| 101 | filename = argv[1]; | 101 | filename = argv[1]; |
| 102 | outfilename = argv[2]; | 102 | outfilename = argv[2]; |
| 103 | 103 | ||
| 104 | avcodec_register_all(); | ||
| 105 | |||
| 106 | pkt = av_packet_alloc(); | 104 | pkt = av_packet_alloc(); |
| 107 | if (!pkt) | 105 | if (!pkt) |
| 108 | exit(1); | 106 | exit(1); |
| @@ -252,9 +252,6 @@ int main (int argc, char **argv) · 251 unmodified lines | |||
| 252 | video_dst_filename = argv[2]; | 252 | video_dst_filename = argv[2]; |
| 253 | audio_dst_filename = argv[3]; | 253 | audio_dst_filename = argv[3]; |
| 254 | 254 | ||
| 255 | /* register all formats and codecs */ | ||
| 256 | av_register_all(); | ||
| 257 | |||
| 258 | /* open input file, and allocate format context */ | 255 | /* open input file, and allocate format context */ |
| 259 | if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { | 256 | if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { |
| 260 | fprintf(stderr, "Could not open source file %s\n", src_filename); | 257 | fprintf(stderr, "Could not open source file %s\n", src_filename); |
| @@ -138,9 +138,6 @@ int main(int argc, char **argv) · 137 unmodified lines | |||
| 138 | } | 138 | } |
| 139 | filename = argv[1]; | 139 | filename = argv[1]; |
| 140 | 140 | ||
| 141 | /* register all the codecs */ | ||
| 142 | avcodec_register_all(); | ||
| 143 | |||
| 144 | /* find the MP2 encoder */ | 141 | /* find the MP2 encoder */ |
| 145 | codec = avcodec_find_encoder(AV_CODEC_ID_MP2); | 142 | codec = avcodec_find_encoder(AV_CODEC_ID_MP2); |
| 146 | if (!codec) { | 143 | if (!codec) { |
| @@ -84,8 +84,6 @@ int main(int argc, char **argv) · 83 unmodified lines | |||
| 84 | filename = argv[1]; | 84 | filename = argv[1]; |
| 85 | codec_name = argv[2]; | 85 | codec_name = argv[2]; |
| 86 | 86 | ||
| 87 | avcodec_register_all(); | ||
| 88 | |||
| 89 | /* find the mpeg1video encoder */ | 87 | /* find the mpeg1video encoder */ |
| 90 | codec = avcodec_find_encoder_by_name(codec_name); | 88 | codec = avcodec_find_encoder_by_name(codec_name); |
| 91 | if (!codec) { | 89 | if (!codec) { |
| @@ -129,8 +129,6 @@ int main(int argc, char **argv) · 128 unmodified lines | |||
| 129 | } | 129 | } |
| 130 | src_filename = argv[1]; | 130 | src_filename = argv[1]; |
| 131 | 131 | ||
| 132 | av_register_all(); | ||
| 133 | |||
| 134 | if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { | 132 | if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) { |
| 135 | fprintf(stderr, "Could not open source file %s\n", src_filename); | 133 | fprintf(stderr, "Could not open source file %s\n", src_filename); |
| 136 | exit(1); | 134 | exit(1); |
| @@ -228,7 +228,6 @@ int main(int argc, char **argv) · 227 unmodified lines | |||
| 228 | exit(1); | 228 | exit(1); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | av_register_all(); | ||
| 232 | avfilter_register_all(); | 231 | avfilter_register_all(); |
| 233 | 232 | ||
| 234 | if ((ret = open_input_file(argv[1])) < 0) | 233 | if ((ret = open_input_file(argv[1])) < 0) |
| @@ -222,7 +222,6 @@ int main(int argc, char **argv) · 221 unmodified lines | |||
| 222 | exit(1); | 222 | exit(1); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | av_register_all(); | ||
| 226 | avfilter_register_all(); | 225 | avfilter_register_all(); |
| 227 | 226 | ||
| 228 | if ((ret = open_input_file(argv[1])) < 0) | 227 | if ((ret = open_input_file(argv[1])) < 0) |
| @@ -114,7 +114,6 @@ int main(int argc, char **argv) · 113 unmodified lines | |||
| 114 | in_uri = argv[1]; | 114 | in_uri = argv[1]; |
| 115 | out_uri = argv[2]; | 115 | out_uri = argv[2]; |
| 116 | 116 | ||
| 117 | av_register_all(); | ||
| 118 | avformat_network_init(); | 117 | avformat_network_init(); |
| 119 | 118 | ||
| 120 | if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) { | 119 | if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) { |
| @@ -163,8 +163,6 @@ int main(int argc, char *argv[]) · 162 unmodified lines | |||
| 163 | return -1; | 163 | return -1; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | av_register_all(); | ||
| 167 | |||
| 168 | type = av_hwdevice_find_type_by_name(argv[1]); | 166 | type = av_hwdevice_find_type_by_name(argv[1]); |
| 169 | if (type == AV_HWDEVICE_TYPE_NONE) { | 167 | if (type == AV_HWDEVICE_TYPE_NONE) { |
| 170 | fprintf(stderr, "Device type %s is not supported.\n", argv[1]); | 168 | fprintf(stderr, "Device type %s is not supported.\n", argv[1]); |
| @@ -44,7 +44,6 @@ int main (int argc, char **argv) · 43 unmodified lines | |||
| 44 | return 1; | 44 | return 1; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | av_register_all(); | ||
| 48 | if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) | 47 | if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) |
| 49 | return ret; | 48 | return ret; |
| 50 | 49 | ||
| @@ -564,9 +564,6 @@ int main(int argc, char **argv) · 563 unmodified lines | |||
| 564 | AVDictionary *opt = NULL; | 564 | AVDictionary *opt = NULL; |
| 565 | int i; | 565 | int i; |
| 566 | 566 | ||
| 567 | /* Initialize libavcodec, and register all codecs and formats. */ | ||
| 568 | av_register_all(); | ||
| 569 | |||
| 570 | if (argc < 2) { | 567 | if (argc < 2) { |
| 571 | printf("usage: %s output_file\n" | 568 | printf("usage: %s output_file\n" |
| 572 | "API example program to output a media file with libavformat.\n" | 569 | "API example program to output a media file with libavformat.\n" |
| @@ -150,8 +150,6 @@ int main(int argc, char **argv) · 149 unmodified lines | |||
| 150 | 150 | ||
| 151 | int ret, i; | 151 | int ret, i; |
| 152 | 152 | ||
| 153 | av_register_all(); | ||
| 154 | |||
| 155 | if (argc < 3) { | 153 | if (argc < 3) { |
| 156 | fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]); | 154 | fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]); |
| 157 | return 1; | 155 | return 1; |
| @@ -65,8 +65,6 @@ int main(int argc, char **argv) · 64 unmodified lines | |||
| 65 | in_filename = argv[1]; | 65 | in_filename = argv[1]; |
| 66 | out_filename = argv[2]; | 66 | out_filename = argv[2]; |
| 67 | 67 | ||
| 68 | av_register_all(); | ||
| 69 | |||
| 70 | if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) { | 68 | if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) { |
| 71 | fprintf(stderr, "Could not open input file '%s'", in_filename); | 69 | fprintf(stderr, "Could not open input file '%s'", in_filename); |
| 72 | goto end; | 70 | goto end; |
| @@ -753,8 +753,6 @@ int main(int argc, char **argv) · 752 unmodified lines | |||
| 753 | exit(1); | 753 | exit(1); |
| 754 | } | 754 | } |
| 755 | 755 | ||
| 756 | /* Register all codecs and formats so that they can be used. */ | ||
| 757 | av_register_all(); | ||
| 758 | /* Open the input file for reading. */ | 756 | /* Open the input file for reading. */ |
| 759 | if (open_input_file(argv[1], &input_format_context, | 757 | if (open_input_file(argv[1], &input_format_context, |
| 760 | &input_codec_context)) | 758 | &input_codec_context)) |
| @@ -517,7 +517,6 @@ int main(int argc, char **argv) · 516 unmodified lines | |||
| 517 | return 1; | 517 | return 1; |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | av_register_all(); | ||
| 521 | avfilter_register_all(); | 520 | avfilter_register_all(); |
| 522 | 521 | ||
| 523 | if ((ret = open_input_file(argv[1])) < 0) | 522 | if ((ret = open_input_file(argv[1])) < 0) |
| @@ -125,8 +125,6 @@ int main(int argc, char *argv[]) · 124 unmodified lines | |||
| 125 | goto close; | 125 | goto close; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | avcodec_register_all(); | ||
| 129 | |||
| 130 | err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, | 128 | err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, |
| 131 | NULL, NULL, 0); | 129 | NULL, NULL, 0); |
| 132 | if (err < 0) { | 130 | if (err < 0) { |
| @@ -238,8 +238,6 @@ int main(int argc, char **argv) · 237 unmodified lines | |||
| 238 | return -1; | 238 | return -1; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | av_register_all(); | ||
| 242 | |||
| 243 | ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0); | 241 | ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, NULL, NULL, 0); |
| 244 | if (ret < 0) { | 242 | if (ret < 0) { |
| 245 | fprintf(stderr, "Failed to create a VAAPI device. Error code: %s\n", av_err2str(ret)); | 243 | fprintf(stderr, "Failed to create a VAAPI device. Error code: %s\n", av_err2str(ret)); |