The new name is more consistent with the rest of the API. Also rename
its parameter from buff->buf, which is also more consistent.
---
ffmpeg.c | 2 +-
ffserver.c | 2 +-
libavformat/avformat.h | 10 +++++++---
libavformat/rtspenc.c | 2 +-
libavformat/sapenc.c | 2 +-
libavformat/sdp.c | 19 +++++++++++++------
libavformat/version.h | 3 +++
7 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 749c9c7..4f2818b 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1799,7 +1799,7 @@ static void print_sdp(AVFormatContext **avc, int n)
{
char sdp[2048];
- avf_sdp_create(avc, n, sdp, sizeof(sdp));
+ av_sdp_create(avc, n, sdp, sizeof(sdp));
printf("SDP:\n%s\n", sdp);
fflush(stdout);
}
diff --git a/ffserver.c b/ffserver.c
index 5c1ab0d..36cd9ce 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2958,7 +2958,7 @@ static int prepare_sdp_description(FFStream *stream,
uint8_t **pbuffer,
avc->streams[i]->codec = stream->streams[i]->codec;
}
*pbuffer = av_mallocz(2048);
- avf_sdp_create(&avc, 1, *pbuffer, 2048);
+ av_sdp_create(&avc, 1, *pbuffer, 2048);
sdp_done:
#if !FF_API_MAX_STREAMS
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 0b50e92..5c8456f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1547,12 +1547,16 @@ int av_filename_number_test(const char *filename);
* all the contexts in the array (an AVCodecContext per RTP stream)
* must contain only one AVStream.
* @param n_files number of AVCodecContexts contained in ac
- * @param buff buffer where the SDP will be stored (must be allocated by
- * the caller)
+ * @param buf buffer where the SDP will be stored (must be allocated by
+ * the caller)
* @param size the size of the buffer
* @return 0 if OK, AVERROR_xxx on error
*/
-int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
+
+#if FF_API_SDP_CREATE
+attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files,
char *buff, int size);
+#endif
/**
* Return a positive value if the given filename has one of the given
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 684f2fe..c1fc97c 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -66,7 +66,7 @@ int ff_rtsp_setup_output_streams(AVFormatContext *s, const
char *addr)
ff_url_join(sdp_ctx.filename, sizeof(sdp_ctx.filename),
"rtsp", NULL, addr, -1, NULL);
ctx_array[0] = &sdp_ctx;
- if (avf_sdp_create(ctx_array, 1, sdp, SDP_MAX_SIZE)) {
+ if (av_sdp_create(ctx_array, 1, sdp, SDP_MAX_SIZE)) {
av_free(sdp);
return AVERROR_INVALIDDATA;
}
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index e675986..455e653 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -208,7 +208,7 @@ static int sap_write_header(AVFormatContext *s)
av_strlcpy(&sap->ann[pos], "application/sdp", sap->ann_size - pos);
pos += strlen(&sap->ann[pos]) + 1;
- if (avf_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
+ if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos],
sap->ann_size - pos)) {
ret = AVERROR_INVALIDDATA;
goto fail;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 02af7dc..005434c 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -474,14 +474,14 @@ void ff_sdp_write_media(char *buff, int size,
AVCodecContext *c, const char *des
sdp_write_media_attributes(buff, size, c, payload_type);
}
-int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size)
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
{
AVMetadataTag *title = av_metadata_get(ac[0]->metadata, "title", NULL, 0);
struct sdp_session_level s;
int i, j, port, ttl, is_multicast;
char dst[32], dst_type[5];
- memset(buff, 0, size);
+ memset(buf, 0, size);
memset(&s, 0, sizeof(struct sdp_session_level));
s.user = "-";
s.src_addr = "127.0.0.1"; /* FIXME: Properly set this */
@@ -506,7 +506,7 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files, char
*buff, int size)
}
}
}
- sdp_write_header(buff, size, &s);
+ sdp_write_header(buf, size, &s);
dst[0] = 0;
for (i = 0; i < n_files; i++) {
@@ -518,11 +518,11 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files,
char *buff, int size)
ttl = 0;
}
for (j = 0; j < ac[i]->nb_streams; j++) {
- ff_sdp_write_media(buff, size,
+ ff_sdp_write_media(buf, size,
ac[i]->streams[j]->codec, dst[0] ? dst :
NULL,
dst_type, (port > 0) ? port + j * 2 : 0,
ttl);
if (port <= 0) {
- av_strlcatf(buff, size,
+ av_strlcatf(buf, size,
"a=control:streamid=%d\r\n", i + j);
}
}
@@ -531,7 +531,7 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files, char
*buff, int size)
return 0;
}
#else
-int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size)
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
{
return AVERROR(ENOSYS);
}
@@ -540,3 +540,10 @@ void ff_sdp_write_media(char *buff, int size,
AVCodecContext *c, const char *des
{
}
#endif
+
+#if FF_API_SDP_CREATE
+int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size)
+{
+ return av_sdp_create(ac, n_files, buff, size);
+}
+#endif
diff --git a/libavformat/version.h b/libavformat/version.h
index cfe1f82..552a1bd 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -107,5 +107,8 @@
#ifndef FF_API_GUESS_IMG2_CODEC
#define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
+#ifndef FF_API_SDP_CREATE
+#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54)
+#endif
#endif //AVFORMAT_VERSION_H
--
1.7.4.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel