Changeset 3ce51320ea315d088049a672bc9fe8b308b3a4fa
- Timestamp:
- 05/01/07 19:18:46
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1178039926 +0000
- git-parent:
[60db87243c9426e59557d0f0f2e30276cc2f9c94]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1178039926 +0000
- Message:
Provide va_list variant to MakeSDPMedia
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r60db872 |
r3ce5132 |
|
| 5 | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | | * Authors: Rémi Denis-Courmont |
|---|
| 8 | | * |
|---|
| 9 | 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | * the Free Software Foundation; either version 2 of the License, or |
|---|
| | 8 | * it under the terms of the GNU Lesser General Public License as published by |
|---|
| | 9 | * the Free Software Foundation; either version 2.1 of the License, or |
|---|
| 12 | 10 | * (at your option) any later version. |
|---|
| 13 | 11 | * |
|---|
| … | … | |
| 154 | 152 | |
|---|
| 155 | 153 | |
|---|
| 156 | | char *MakeSDPMedia (const char *type, int dport, const char *protocol, |
|---|
| 157 | | unsigned pt, const char *rtpmap, const char *fmtpfmt, ...) |
|---|
| | 154 | char *vMakeSDPMedia (const char *type, int dport, const char *protocol, |
|---|
| | 155 | unsigned pt, const char *rtpmap, |
|---|
| | 156 | const char *fmtpfmt, va_list ap) |
|---|
| 158 | 157 | { |
|---|
| 159 | 158 | char *sdp_media = NULL; |
|---|
| … | … | |
| 177 | 176 | /* Format parameters */ |
|---|
| 178 | 177 | char *fmtp = NULL; |
|---|
| 179 | | if (fmtpfmt != NULL) |
|---|
| 180 | | { |
|---|
| 181 | | va_list ap; |
|---|
| 182 | | |
|---|
| 183 | | va_start (ap, fmtpfmt); |
|---|
| 184 | | if (vasprintf (&fmtp, fmtpfmt, ap) == -1) |
|---|
| 185 | | fmtpfmt = NULL; |
|---|
| 186 | | va_end (ap); |
|---|
| 187 | | |
|---|
| 188 | | if (fmtp == NULL) |
|---|
| 189 | | return NULL; |
|---|
| 190 | | } |
|---|
| | 178 | if ((fmtpfmt != NULL) |
|---|
| | 179 | && (vasprintf (&fmtp, fmtpfmt, ap) == -1)) |
|---|
| | 180 | return NULL; |
|---|
| 191 | 181 | |
|---|
| 192 | 182 | char sdp_fmtp[fmtp ? (sizeof ("a=fmtp:123 *\r\n") + strlen (fmtp)) : 1]; |
|---|
| r60db872 |
r3ce5132 |
|
| 113 | 113 | void announce_SAPHandlerDestroy( sap_handler_t *p_sap ); |
|---|
| 114 | 114 | |
|---|
| | 115 | #include <stdarg.h> |
|---|
| | 116 | |
|---|
| 115 | 117 | char *StartSDP (const char *name, const char *description, const char *url, |
|---|
| 116 | 118 | const char *email, const char *phone, vlc_bool_t ssm, |
|---|
| 117 | 119 | const struct sockaddr *orig, socklen_t origlen, |
|---|
| 118 | 120 | const struct sockaddr *addr, socklen_t addrlen); |
|---|
| | 121 | char *vMakeSDPMedia (const char *type, int dport, const char *protocol, |
|---|
| | 122 | unsigned pt, const char *rtpmap, |
|---|
| | 123 | const char *fmtp, va_list ap); |
|---|
| | 124 | static inline |
|---|
| 119 | 125 | char *MakeSDPMedia (const char *type, int dport, const char *protocol, |
|---|
| 120 | | unsigned pt, const char *rtpmap, const char *fmtp, ...); |
|---|
| 121 | | |
|---|
| | 126 | unsigned pt, const char *rtpmap, const char *fmtpfmt, ...) |
|---|
| | 127 | { |
|---|
| | 128 | va_list ap; |
|---|
| | 129 | char *ret; |
|---|
| | 130 | va_start (ap, fmtpfmt); |
|---|
| | 131 | ret = vMakeSDPMedia (type, dport, protocol, pt, rtpmap, fmtpfmt, ap); |
|---|
| | 132 | va_end (ap); |
|---|
| | 133 | return ret; |
|---|
| | 134 | } |
|---|