Revision f8270bbf

View differences:

libavformat/avio.c
57 57
    else  return first_protocol;
58 58
}
59 59

  
60
const char *avio_enum_protocols(void **opaque, int output)
61
{
62
    URLProtocol **p = opaque;
63
    *p = *p ? (*p)->next : first_protocol;
64
    if (!*p) return NULL;
65
    if ((output && (*p)->url_write) || (!output && (*p)->url_read))
66
        return (*p)->name;
67
    return avio_enum_protocols(opaque, output);
68
}
69

  
60 70
int ffurl_register_protocol(URLProtocol *protocol, int size)
61 71
{
62 72
    URLProtocol **p;
libavformat/avio.h
600 600
int udp_get_file_handle(URLContext *h);
601 601
#endif
602 602

  
603
/**
604
 * Iterate through names of available protocols.
605
 *
606
 * @param opaque A private pointer representing current protocol.
607
 *        It must be a pointer to NULL on first iteration and will
608
 *        be updated by successive calls to avio_enum_protocols.
609
 * @param output If set to 1, iterate over output protocols,
610
 *               otherwise over input protocols.
611
 *
612
 * @return A static string containing the name of current protocol or NULL
613
 */
614
const char *avio_enum_protocols(void **opaque, int output);
615

  
603 616
#endif /* AVFORMAT_AVIO_H */

Also available in: Unified diff