static int parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value) { AVCodecParameters *par = stream->codecpar; int res, i; if (!strcmp(attr, "config")) { res = parse_fmtp_config(par, value); if (res < 0) return res; } if (par->codec_id == AV_CODEC_ID_AAC) { /* Looking for a known attribute */ for (i = 0; attr_names[i].str; ++i) { if (!av_strcasecmp(attr, attr_names[i].str)) { if (attr_names[i].type == ATTR_NAME_TYPE_INT) { *(int *)((char *)data+ attr_names[i].offset) = atoi(value); } else if (attr_names[i].type == ATTR_NAME_TYPE_STR) *(char **)((char *)data+ attr_names[i].offset) = av_strdup(value); } } } return 0; }
static int parse_fmtp(AVStream *stream, PayloadContext *data, char *attr, char *value) { int res; if (!strcmp(attr, "config")) { res = parse_fmtp_config(stream, value); if (res < 0) return res; } else if (!strcmp(attr, "cpresent")) { int cpresent = atoi(value); if (cpresent != 0) avpriv_request_sample(NULL, "RTP MP4A-LATM with in-band configuration"); } return 0; }
static int parse_fmtp(AVStream *stream, PayloadContext *data, char *attr, char *value) { int res; if (!strcmp(attr, "config")) { res = parse_fmtp_config(stream, value); if (res < 0) return res; } else if (!strcmp(attr, "cpresent")) { int cpresent = atoi(value); if (cpresent != 0) av_log_missing_feature(NULL, "RTP MP4A-LATM with in-band " "configuration", 1); } return 0; }
static int parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value) { AVCodecParameters *par = stream->codecpar; int res, i; if (!strcmp(attr, "config")) { res = parse_fmtp_config(par, value); if (res < 0) return res; } if (par->codec_id == AV_CODEC_ID_AAC) { /* Looking for a known attribute */ for (i = 0; attr_names[i].str; ++i) { if (!av_strcasecmp(attr, attr_names[i].str)) { if (attr_names[i].type == ATTR_NAME_TYPE_INT) { int val = atoi(value); if (val > 32) { av_log(s, AV_LOG_ERROR, "The %s field size is invalid (%d)\n", attr, val); return AVERROR_INVALIDDATA; } *(int *)((char *)data+ attr_names[i].offset) = val; } else if (attr_names[i].type == ATTR_NAME_TYPE_STR) { char *val = av_strdup(value); if (!val) return AVERROR(ENOMEM); *(char **)((char *)data+ attr_names[i].offset) = val; } } } } return 0; }