static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
{
    AVFormatContext *ctx = track->rtp_ctx;
    char buf[1000] = "";
    int len;
    ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,
                       NULL, NULL, 0, 0, ctx);
    av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id);
    len = strlen(buf);
    avio_wb32(pb, len + 24);
    ffio_wfourcc(pb, "udta");
    avio_wb32(pb, len + 16);
    ffio_wfourcc(pb, "hnti");
    avio_wb32(pb, len + 8);
    ffio_wfourcc(pb, "sdp ");
    avio_write(pb, buf, len);
    return len + 24;
}
['static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)\n{\n    AVFormatContext *ctx = track->rtp_ctx;\n    char buf[1000] = "";\n    int len;\n    ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track,\n                       NULL, NULL, 0, 0, ctx);\n    av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\\r\\n", track->track_id);\n    len = strlen(buf);\n    avio_wb32(pb, len + 24);\n    ffio_wfourcc(pb, "udta");\n    avio_wb32(pb, len + 16);\n    ffio_wfourcc(pb, "hnti");\n    avio_wb32(pb, len + 8);\n    ffio_wfourcc(pb, "sdp ");\n    avio_write(pb, buf, len);\n    return len + 24;\n}', 'void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,\n                        const char *dest_addr, const char *dest_type,\n                        int port, int ttl, AVFormatContext *fmt)\n{\n    AVCodecContext *c = st->codec;\n    const char *type;\n    int payload_type;\n    payload_type = ff_rtp_get_payload_type(fmt, c, idx);\n    switch (c->codec_type) {\n        case AVMEDIA_TYPE_VIDEO   : type = "video"      ; break;\n        case AVMEDIA_TYPE_AUDIO   : type = "audio"      ; break;\n        case AVMEDIA_TYPE_SUBTITLE: type = "text"       ; break;\n        default                 : type = "application"; break;\n    }\n    av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\\r\\n", type, port, payload_type);\n    sdp_write_address(buff, size, dest_addr, dest_type, ttl);\n    if (c->bit_rate) {\n        av_strlcatf(buff, size, "b=AS:%d\\r\\n", c->bit_rate / 1000);\n    }\n    sdp_write_media_attributes(buff, size, c, payload_type, fmt);\n}', 'size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)\n{\n    int len = strlen(dst);\n    va_list vl;\n    va_start(vl, fmt);\n    len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);\n    va_end(vl);\n    return len;\n}', 'static void sdp_write_address(char *buff, int size, const char *dest_addr,\n                              const char *dest_type, int ttl)\n{\n    if (dest_addr) {\n        if (!dest_type)\n            dest_type = "IP4";\n        if (ttl > 0 && !strcmp(dest_type, "IP4")) {\n            av_strlcatf(buff, size, "c=IN %s %s/%d\\r\\n", dest_type, dest_addr, ttl);\n        } else {\n            av_strlcatf(buff, size, "c=IN %s %s\\r\\n", dest_type, dest_addr);\n        }\n    }\n}']