#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
+#include "libavutil/dict.h"
#include "libavutil/parseutils.h"
+#include "libavutil/opt.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"
#include "avformat.h"
return NULL;
}
-static int latm_context2profilelevel(AVCodecContext *c) {
+static int latm_context2profilelevel(AVCodecContext *c)
+{
/* MP4A-LATM
* The RTP payload format specification is described in RFC 3016
* The encoding specifications are provided in ISO/IEC 14496-3 */
return profile_level;
}
-static char *latm_context2config(AVCodecContext *c) {
+static char *latm_context2config(AVCodecContext *c)
+{
/* MP4A-LATM
* The RTP payload format specification is described in RFC 3016
* The encoding specifications are provided in ISO/IEC 14496-3 */
return config;
}
-static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type, int flags)
+static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type, AVFormatContext *fmt)
{
char *config = NULL;
payload_type, config ? config : "");
break;
case CODEC_ID_AAC:
- if (flags & AVFMT_FLAG_MP4A_LATM) {
+ if (fmt && fmt->oformat->priv_class &&
+ av_opt_flag_is_set(fmt->priv_data, "rtpflags", "latm")) {
config = latm_context2config(c);
if (!config)
return NULL;
return buff;
}
-void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, int flags)
+void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt)
{
const char *type;
int payload_type;
av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
}
- sdp_write_media_attributes(buff, size, c, payload_type, flags);
+ sdp_write_media_attributes(buff, size, c, payload_type, fmt);
}
int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
{
- AVMetadataTag *title = av_metadata_get(ac[0]->metadata, "title", NULL, 0);
+ AVDictionaryEntry *title = av_dict_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];
ff_sdp_write_media(buf, size,
ac[i]->streams[j]->codec, dst[0] ? dst : NULL,
dst_type, (port > 0) ? port + j * 2 : 0, ttl,
- ac[i]->flags);
+ ac[i]);
if (port <= 0) {
av_strlcatf(buf, size,
"a=control:streamid=%d\r\n", i + j);
return AVERROR(ENOSYS);
}
-void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, int flags)
+void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *dest_addr, const char *dest_type, int port, int ttl, AVFormatContext *fmt)
{
}
#endif