summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-05-21 21:43:40 +0000
committerMartin Storsjö <martin@martin.st>2010-05-21 21:43:40 +0000
commit3d24c2ce026d1d3080124b5af1c067eb635c0bb5 (patch)
treee7062f6364b1c09a03931a6139927bb01a0765dc /libavformat
parent7d8b893b7e7b86c760e6c35c5e422e55b4386b89 (diff)
Make ff_sdp_write_media a lavf-internal function
This is in preparation for RTP hinting in the MOV muxer, where it needs to be able to create SDP fragments for each media stream. backport r23160 by mstorsjo Originally committed as revision 23233 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/internal.h17
-rw-r--r--libavformat/sdp.c9
2 files changed, 24 insertions, 2 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 789988019d..a395c2f24b 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -137,4 +137,21 @@ int ff_url_join(char *str, int size, const char *proto,
const char *authorization, const char *hostname,
int port, const char *fmt, ...);
+/**
+ * Appends the media-specific SDP fragment for the media stream c
+ * to the buffer buff.
+ *
+ * Note, the buffer needs to be initialized, since it is appended to
+ * existing content.
+ *
+ * @param buff the buffer to append the SDP fragment to
+ * @param size the size of the buff buffer
+ * @param c the AVCodecContext of the media to describe
+ * @param dest_addr the destination address of the media stream, may be NULL
+ * @param port the destination port of the media stream, 0 if unknown
+ * @param ttl the time to live of the stream, 0 if not multicast
+ */
+void ff_sdp_write_media(char *buff, int size, AVCodecContext *c,
+ const char *dest_addr, int port, int ttl);
+
#endif /* AVFORMAT_INTERNAL_H */
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index a8cab6a68f..6bf05dbe39 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -294,7 +294,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
return buff;
}
-static void sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, int port, int ttl)
+void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, int port, int ttl)
{
const char *type;
int payload_type;
@@ -352,7 +352,7 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size)
resolve_destination(dst, sizeof(dst));
}
for (j = 0; j < ac[i]->nb_streams; j++) {
- sdp_write_media(buff, size,
+ ff_sdp_write_media(buff, size,
ac[i]->streams[j]->codec, dst[0] ? dst : NULL,
(port > 0) ? port + j * 2 : 0, ttl);
if (port <= 0) {
@@ -369,4 +369,9 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size)
{
return AVERROR(ENOSYS);
}
+
+void ff_sdp_write_media(char *buff, int size, AVCodecContext *c,
+ const char *dest_addr, int port, int ttl)
+{
+}
#endif