| 944 | } |
| 945 | |
| 946 | int ff_parse_fmtp(AVFormatContext *s, |
| 947 | AVStream *stream, PayloadContext *data, const char *p, |
| 948 | int (*parse_fmtp)(AVFormatContext *s, |
| 949 | AVStream *stream, |
| 950 | PayloadContext *data, |
| 951 | const char *attr, const char *value)) |
| 952 | { |
| 953 | char attr[256]; |
| 954 | char *value; |
| 955 | int res; |
| 956 | int value_size = strlen(p) + 1; |
| 957 | |
| 958 | if (!(value = av_malloc(value_size))) { |
| 959 | av_log(s, AV_LOG_ERROR, "Failed to allocate data for FMTP.\n"); |
| 960 | return AVERROR(ENOMEM); |
| 961 | } |
| 962 | |
| 963 | // remove protocol identifier |
| 964 | while (*p && *p == ' ') |
| 965 | p++; // strip spaces |
| 966 | while (*p && *p != ' ') |
| 967 | p++; // eat protocol identifier |
| 968 | while (*p && *p == ' ') |
| 969 | p++; // strip trailing spaces |
| 970 | |
| 971 | while (ff_rtsp_next_attr_and_value(&p, |
| 972 | attr, sizeof(attr), |
| 973 | value, value_size)) { |
| 974 | res = parse_fmtp(s, stream, data, attr, value); |
| 975 | if (res < 0 && res != AVERROR_PATCHWELCOME) { |
| 976 | av_free(value); |
| 977 | return res; |
| 978 | } |
| 979 | } |
| 980 | av_free(value); |
| 981 | return 0; |
| 982 | } |
| 983 | |
| 984 | int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx) |
| 985 | { |
no test coverage detected