diff --git a/ffmpeg.c b/ffmpeg.c index 83e77dd51fdf03e90506f1411bb6007e68f2478b..46adb9a98d879397fd3eb77030f5e9638373829e 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1797,7 +1797,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 259aaca05eb5baba26df3a7909e9b8d2b7a28819..eab8ae25ad73a1ceaa30c33786e59f96e6c9ad8c 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2957,7 +2957,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 37ec8a9bee9b24c6fdc2a5ab0f9fec6c0de436e5..26fca88ca63533a057bab0fcc63a1647b75082d0 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1558,7 +1558,11 @@ int av_filename_number_test(const char *filename); * @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 *buff, 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 684f2fe558803131cdd6f51b18fbd8fd94b451b8..c1fc97ca8f8c1ef340e64c3673c617231655aacc 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 e675986b7d44c2a8f8b3f818877db26f392c40d7..455e65341f69f9f75e35dfa46d2a319a5baa52a9 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 02af7dce1de437573c107589733c5e1d221d3b66..0e46c3365f66693743ee497a043084a90b8b3572 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -474,7 +474,7 @@ 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 *buff, int size) { AVMetadataTag *title = av_metadata_get(ac[0]->metadata, "title", NULL, 0); struct sdp_session_level s; @@ -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 *buff, 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 cfe1f823936b912f83ffbe4eae058a848efd1f44..552a1bda60ee54dfaee25262df159334705b818b 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