| 67 | } |
| 68 | |
| 69 | int main(int argc, char **argv) |
| 70 | { |
| 71 | DecodeContext dc; |
| 72 | |
| 73 | unsigned int stream_idx, max_frames; |
| 74 | const char *filename, *thread_type = NULL, *nb_threads = NULL; |
| 75 | int ret = 0; |
| 76 | |
| 77 | if (argc <= 3) { |
| 78 | fprintf(stderr, "Usage: %s <input file> <stream index> <max frame count> [<thread count> <thread type>]\n", argv[0]); |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | filename = argv[1]; |
| 83 | stream_idx = strtol(argv[2], NULL, 0); |
| 84 | max_frames = strtol(argv[3], NULL, 0); |
| 85 | if (argc > 5) { |
| 86 | nb_threads = argv[4]; |
| 87 | thread_type = argv[5]; |
| 88 | } |
| 89 | |
| 90 | ret = ds_open(&dc, filename, stream_idx); |
| 91 | if (ret < 0) |
| 92 | goto finish; |
| 93 | |
| 94 | dc.process_frame = process_frame; |
| 95 | dc.max_frames = max_frames; |
| 96 | |
| 97 | ret = av_dict_set(&dc.decoder_opts, "threads", nb_threads, 0); |
| 98 | ret |= av_dict_set(&dc.decoder_opts, "thread_type", thread_type, 0); |
| 99 | ret |= av_dict_set(&dc.decoder_opts, "export_side_data", "venc_params", 0); |
| 100 | |
| 101 | if (ret < 0) |
| 102 | goto finish; |
| 103 | |
| 104 | ret = ds_run(&dc); |
| 105 | |
| 106 | finish: |
| 107 | ds_free(&dc); |
| 108 | return ret; |
| 109 | } |
nothing calls this directly
no test coverage detected