| 122 | } |
| 123 | |
| 124 | const URLProtocol **ffurl_get_protocols(const char *whitelist, |
| 125 | const char *blacklist) |
| 126 | { |
| 127 | const URLProtocol **ret; |
| 128 | int i, ret_idx = 0; |
| 129 | |
| 130 | ret = av_calloc(FF_ARRAY_ELEMS(url_protocols), sizeof(*ret)); |
| 131 | if (!ret) |
| 132 | return NULL; |
| 133 | |
| 134 | for (i = 0; url_protocols[i]; i++) { |
| 135 | const URLProtocol *up = url_protocols[i]; |
| 136 | |
| 137 | if (whitelist && *whitelist && !av_match_name(up->name, whitelist)) |
| 138 | continue; |
| 139 | if (blacklist && *blacklist && av_match_name(up->name, blacklist)) |
| 140 | continue; |
| 141 | |
| 142 | ret[ret_idx++] = up; |
| 143 | } |
| 144 | |
| 145 | return ret; |
| 146 | } |
no test coverage detected