Revision 016bc031

View differences:

libavformat/rtpdec.c
531 531
    }
532 532
    av_free(s);
533 533
}
534

  
535
int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
536
                  int (*parse_fmtp)(AVStream *stream,
537
                                    PayloadContext *data,
538
                                    char *attr, char *value))
539
{
540
    char attr[256];
541
    char value[4096];
542
    int res;
543

  
544
    // remove protocol identifier
545
    while (*p && *p == ' ') p++; // strip spaces
546
    while (*p && *p != ' ') p++; // eat protocol identifier
547
    while (*p && *p == ' ') p++; // strip trailing spaces
548

  
549
    while (ff_rtsp_next_attr_and_value(&p,
550
                                       attr, sizeof(attr),
551
                                       value, sizeof(value))) {
552

  
553
        res = parse_fmtp(stream, data, attr, value);
554
        if (res < 0)
555
            return res;
556
    }
557
    return 0;
558
}
libavformat/rtpdec.h
172 172

  
173 173
int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size); ///< from rtsp.c, but used by rtp dynamic protocol handlers.
174 174

  
175
int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
176
                  int (*parse_fmtp)(AVStream *stream,
177
                                    PayloadContext *data,
178
                                    char *attr, char *value));
179

  
175 180
void av_register_rtp_dynamic_payload_handlers(void);
176 181

  
177 182
#endif /* AVFORMAT_RTPDEC_H */

Also available in: Unified diff